﻿:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #000000;
  --muted: #4c5563;
  --line: #d8e1ec;
  --soft: #edf3fa;
  --accent: #082C5D;
  --accent-strong: #061F42;
  --brand-orange: #FF914D;
  --success: #082C5D;
  --warning: #FF914D;
  --danger: #000000;
  --sidebar: #00204d;
  --sidebar-2: #0f3b75;
  --shadow: 0 14px 34px rgba(8, 44, 93, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", "Segoe UI", "Tahoma", "Arial", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  white-space: nowrap;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 145, 77, 0.2);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.activation-screen,
.login-screen,
.license-block-screen {
  height: 100vh;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(8, 44, 93, 0.1), rgba(255, 145, 77, 0.06) 42%, rgba(255, 255, 255, 0.88)),
    #eef2f5;
}

.license-block-screen {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(8, 44, 93, 0.07) 45%, rgba(255, 255, 255, 0.92)),
    #f3f5f7;
}

.license-block-card {
  width: min(820px, 100%);
  border: 1px solid #FF914D;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(8, 44, 93, 0.16);
  padding: 28px;
}

.license-block-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.license-block-brand h1 {
  margin-bottom: 0;
  color: var(--danger);
  font-size: 34px;
  line-height: 1.35;
}

.license-block-alert {
  border-right: 5px solid var(--danger);
  border-radius: 8px;
  background: #fff8f3;
  padding: 18px;
}

.license-block-alert strong {
  display: block;
  color: var(--danger);
  font-size: 24px;
  line-height: 1.45;
}

.license-block-alert p {
  margin: 10px 0 0;
  color: #4d5967;
  font-size: 16px;
  line-height: 1.9;
}

.license-block-contact {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
}

.license-block-contact span {
  color: var(--muted);
  font-weight: 800;
}

.license-block-contact div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.license-block-contact strong {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

.activation-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  direction: rtl;
}

.activation-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.activation-intro,
.activation-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(8, 44, 93, 0.1);
}

.activation-intro {
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: 30px;
  background:
    linear-gradient(140deg, rgba(8, 44, 93, 0.98), rgba(0, 0, 0, 0.9)),
    var(--sidebar);
  color: #fff;
}

.activation-logo {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.activation-intro h1 {
  margin: 18px 0 10px;
  font-size: 34px;
  line-height: 1.3;
}

.activation-intro p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.8;
}

.activation-rules {
  display: grid;
  gap: 10px;
}

.activation-rules div {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 13px;
}

.activation-rules strong,
.activation-rules span {
  display: block;
}

.activation-rules strong {
  margin-bottom: 3px;
  font-size: 22px;
}

.activation-rules span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.activation-card {
  padding: 26px;
}

.activation-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.activation-card h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

.activation-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.serial-grid {
  direction: ltr;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.serial-part {
  min-height: 54px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.serial-grid {
  display: flex;
  align-items: center;
  gap: 8px;
}

.separator {
  font-size: 18px;
  font-weight: bold;
  color: #666;
}

.activation-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
}

.activation-actions .primary-button,
.activation-actions .ghost-button {
  flex: 1;
}

.download-shell {
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
}

.download-card {
  justify-content: center;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.download-link {
  display: grid;
  place-items: center;
  min-height: 48px;
  text-decoration: none;
}

.download-note {
  margin-top: 6px;
}

/* =========================================================
   OWNER VAULT — SCROLL FIX
   ========================================================= */

.owner-vault-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(8, 44, 93, 0.96), rgba(0, 0, 0, 0.86)),
    var(--sidebar);
  overflow-y: auto;
}

.owner-login-card {
  width: min(760px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.24);
  padding: 26px;
}

.owner-login-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.owner-login-head h1 {
  margin: 8px 0 4px;
  font-size: 28px;
}

.owner-login-head p {
  margin: 0;
  color: var(--muted);
}

.owner-vault-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.owner-vault-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 20px 24px;
}

.owner-vault-header h1 {
  margin-bottom: 4px;
  font-size: 28px;
}

.owner-vault-header p {
  margin: 0;
  color: var(--muted);
}

.owner-vault-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px;
  scroll-behavior: smooth;
}

.owner-vault-main::-webkit-scrollbar {
  width: 8px;
}

.owner-vault-main::-webkit-scrollbar-track {
  background: transparent;
}

.owner-vault-main::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.owner-vault-main::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.owner-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.owner-toolbar select {
  width: 180px;
}

.owner-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.owner-table-wrap table {
  min-width: 1320px;
}

/* =========================================================
   OWNER VAULT — PASSWORD ALIGNMENT FIX
   ========================================================= */

/* Serial column — fixed width, left aligned */
.owner-serial-value {
  display: inline-block;
  width: 214px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: embed;
}

/* Copyable value — flex row, aligned center */
.copyable-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

/* Password text — FIXED WIDTH + LEFT ALIGN */
.copyable-value > span:first-child {
  display: inline-block;
  width: 214px;           /* ✅ Same as serial */
  min-width: 214px;
  text-align: left;       /* ✅ Left align */
  direction: ltr;         /* ✅ Force LTR */
  unicode-bidi: embed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.92em;
  letter-spacing: 0.02em;
  line-height: 1.3;
  vertical-align: middle;
}

/* Copy button */
.copy-icon-button {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 26px;
  flex-shrink: 0;
}

.copy-icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Table cells — reduce gap between serial & password */
#owner-license-table td:nth-child(2) {
  padding-right: 4px;     /* Less space after serial */
}

#owner-license-table td:nth-child(3) {
  padding-left: 0;        /* No extra padding before password */
}

/* Ensure table cells align properly */
#owner-license-table td {
  vertical-align: middle;
}

/* =========================================================
   OWNER VAULT — MODAL
   ========================================================= */

.owner-license-detail-card {
  width: min(1180px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
}

.owner-license-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.owner-license-controls {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  background: #f8fafc;
}

.owner-license-controls h3,
.owner-license-controls p {
  margin-bottom: 0;
}

.owner-license-control-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.owner-license-control-actions label {
  min-width: 150px;
}

.owner-raw-detail pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.owner-license-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.owner-license-link:hover {
  color: var(--accent-strong);
}

/* =========================================================
   LOGIN LAYOUT
   ========================================================= */

.login-layout {
  width: min(920px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(390px, 1.08fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 58px rgba(8, 44, 93, 0.12);
}

.login-showcase {
  min-width: 0;
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: 34px;
  background:
    linear-gradient(140deg, rgba(8, 44, 93, 0.98), rgba(0, 0, 0, 0.9)),
    var(--sidebar);
  color: #fff;
}

.login-showcase-top,
.login-feature-grid {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-showcase-top strong,
.login-showcase-top span,
.login-feature-grid strong,
.login-feature-grid span {
  display: block;
}

.login-showcase-logo {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.login-showcase-top strong {
  font-size: 20px;
}

.login-showcase-top span,
.login-showcase-main p,
.login-feature-grid span {
  color: rgba(255, 255, 255, 0.78);
}

.login-kicker {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  padding: 0 12px;
  color: #FFE0CC;
  font-size: 13px;
  font-weight: 800;
}

.login-showcase-main h1 {
  max-width: 560px;
  margin: 18px 0 12px;
  font-size: 42px;
  line-height: 1.28;
}

.login-showcase-main p {
  max-width: 520px;
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.login-feature-grid div {
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px;
}

.login-feature-grid strong {
  margin-bottom: 6px;
  font-size: 16px;
}

.login-panel {
  display: grid;
  align-content: center;
  padding: 44px;
  background: #ffffff;
}

.login-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand {
  align-items: flex-start;
  margin-bottom: 30px;
}

.login-logo {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
}

.brand-mark,
.brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.brand-mark {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.brand-logo {
  display: block;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.login-brand strong,
.brand strong {
  display: block;
  font-size: 18px;
}

.login-brand strong {
  margin-top: 7px;
  color: var(--text);
  font-size: 24px;
}

.login-brand span,
.brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.login-form,
.stack-form {
  display: grid;
  gap: 14px;
}

.login-form {
  gap: 16px;
}

.login-form label {
  color: #4d5967;
  font-weight: 700;
}

.login-form input {
  min-height: 48px;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px 12px;
  font-weight: 600;
}

.login-form input:focus {
  background: #fff;
}

.login-submit {
  min-height: 50px;
  margin-top: 2px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: 0 10px 22px rgba(8, 44, 93, 0.18);
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.login-footer strong {
  position: relative;
  color: var(--success);
  font-size: 13px;
}

.login-footer strong::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--success);
}

.login-loading {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--accent-strong);
  font-size: 14px;
}

.login-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d8e1ec;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.settings-note {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  min-height: 0;
  padding: 20px 16px;
  background: var(--sidebar);
  color: white;
  overflow: auto;
}

.sidebar .brand {
  margin-bottom: 22px;
  padding: 0 6px;
}

.sidebar .brand span {
  color: #b7c0d3;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.settings-tab {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  text-align: right;
  cursor: pointer;
}

.nav-item {
  background: transparent;
  color: #d8deea;
  padding: 11px 12px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-2);
  color: #fff;
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  padding: 22px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin-bottom: 4px;
  font-size: 28px;
}

.topbar p,
.panel-header p,
.cart-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.topbar-actions,
.cart-actions,
.modal-actions,
.settings-actions,
.toolbar-actions,
.toolbar,
.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
}

.primary-button,
.ghost-button,
.danger-soft-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.danger-soft-button {
  border: 1px solid #FF914D;
  background: #fff8f3;
  color: var(--danger);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel,
.kpi-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(8, 44, 93, 0.06);
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-header h2,
.cart-head h2,
.settings-panel h2 {
  margin-bottom: 4px;
  font-size: 19px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(8, 44, 93, 0.1), rgba(255, 145, 77, 0.08) 48%, rgba(255, 255, 255, 0.96)),
    #ffffff;
  box-shadow: 0 10px 28px rgba(8, 44, 93, 0.1);
  padding: 22px;
}

.dashboard-hero h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.dashboard-hero p {
  margin: 0;
  color: var(--muted);
}

.dashboard-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  padding: 18px;
}

.kpi-card span,
.kpi-card small {
  display: block;
  color: var(--muted);
}

.kpi-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 30px;
}

.kpi-card.alert strong {
  color: var(--warning);
}

.kpi-card.danger strong {
  color: var(--danger);
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.finance-kpi.warn strong {
  color: var(--warning);
}

.finance-kpi.good strong {
  color: var(--success);
}

.finance-history-panel {
  margin-top: 16px;
}

.finance-reminder-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-reminder-list {
  display: grid;
  gap: 10px;
}

.finance-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.finance-reminder.is-due {
  border-color: #FF914D;
  background: #fff8f3;
}

.finance-reminder strong,
.finance-reminder span,
.finance-reminder small {
  display: block;
}

.finance-reminder span {
  margin-top: 4px;
  color: var(--text);
}

.finance-reminder small {
  margin-top: 4px;
  color: var(--muted);
}

.dashboard-grid,
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
}

.dashboard-notes-panel {
  margin-top: 16px;
}

.dashboard-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.dashboard-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.dashboard-note::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.dashboard-note strong,
.dashboard-note span {
  display: block;
}

.dashboard-note span {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dashboard-note.warn {
  border-color: #FF914D;
  background: #fff8f3;
}

.dashboard-note.danger {
  border-color: #FF914D;
  background: #fff8f3;
}

.dashboard-note.warn strong {
  color: var(--warning);
}

.dashboard-note.warn::before {
  background: var(--warning);
}

.dashboard-note.danger strong {
  color: var(--danger);
}

.dashboard-note.danger::before {
  background: var(--danger);
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
}

.toolbar {
  align-items: stretch;
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1;
}

.toolbar select {
  width: 180px;
}

.filter-menu {
  position: relative;
  width: 120px;
  flex: 0 0 120px;
}

.filter-menu > button {
  width: 100%;
}

.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 6;
  width: 230px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.filter-option {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0 10px;
  text-align: right;
}

.filter-option:hover,
.filter-option.active {
  background: #edf3fa;
  color: var(--accent-strong);
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.inventory-page {
  display: grid;
  gap: 16px;
}

.inventory-hero-panel {
  padding: 20px;
}

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.inventory-summary-card {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 13px;
}

.inventory-summary-card span,
.inventory-summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.inventory-summary-card strong {
  display: block;
  margin: 7px 0 2px;
  font-size: 24px;
}

.inventory-summary-card.warn strong {
  color: var(--warning);
}

.inventory-summary-card.danger strong {
  color: var(--danger);
}

.inventory-summary-card.good strong {
  color: var(--success);
}

.inventory-toolbar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 8px;
}

.product-card {
  min-height: 132px;
  display: grid;
  grid-template-rows: 54px auto auto auto;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  cursor: pointer;
  text-align: right;
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(8, 44, 93, 0.12);
}

.product-card strong {
  min-height: 34px;
  line-height: 1.35;
  font-size: 13px;
}

.product-card-media {
  width: 100%;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.product-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-placeholder {
  color: var(--muted);
  font-size: 11px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.product-image-field {
  align-content: start;
}

.product-image-preview {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.product-image-preview.has-image {
  border-style: solid;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.category-board,
.category-product-grid {
  display: grid;
  gap: 12px;
}

.category-board {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.category-card {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: right;
  cursor: pointer;
}

.category-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(8, 44, 93, 0.12);
}

.category-card strong,
.category-page-title strong,
.product-node strong {
  display: block;
  margin-bottom: 3px;
}

.category-card span,
.category-page-title span,
.product-node span,
.catalog-hint {
  color: var(--muted);
  font-size: 13px;
}

.category-actions,
.product-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.category-products {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.category-page {
  display: grid;
  gap: 14px;
}

.category-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.category-product-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.product-node {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.catalog-tools {
  align-self: start;
  position: sticky;
  top: 0;
}

.catalog-hint {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.inventory-pdf-tools {
  display: none;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cart-panel {
  position: sticky;
  top: 0;
  align-self: start;
}

.cart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cart-lines {
  min-height: 220px;
  max-height: 300px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  margin-bottom: 12px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.cart-line strong {
  display: block;
  margin-bottom: 4px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-control button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.cart-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.totals {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
}

.totals div,
.report-line,
.balance-row,
.activity-row,
.rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.totals div:last-child strong {
  font-size: 24px;
  color: var(--success);
}

.cart-actions .primary-button,
.cart-actions .ghost-button {
  flex: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: right;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #fff8f3;
}

.compact-table table {
  min-width: 520px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.status.good {
  background: #edf3fa;
  color: var(--success);
}

.status.warn {
  background: #fff8f3;
  color: var(--warning);
}

.status.danger {
  background: #fff8f3;
  color: var(--danger);
}

.action-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.danger-link {
  color: var(--danger);
}

.row-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.return-match-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.returns-invoice-scroll {
  max-height: 310px;
  overflow: auto;
  padding-left: 4px;
}

.return-match {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 11px 12px;
  text-align: right;
  white-space: normal;
}

.return-match:hover,
.return-match.active {
  border-color: var(--accent);
  background: #fff8f3;
}

.return-match strong,
.return-match span {
  display: block;
}

.return-match span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.return-sale-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.return-sale-card > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.return-sale-card span,
.return-sale-card strong {
  display: block;
}

.return-sale-card span {
  color: var(--muted);
  font-size: 12px;
}

.return-sale-card strong {
  margin-top: 6px;
}

.return-qty-input {
  width: 96px;
}

.party-grid,
.balance-list,
.rank-list,
.activity-list,
.order-board,
.report-lines {
  display: grid;
  gap: 10px;
}

.customers-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 16px;
}

.dues-grid {
  display: grid;
  align-content: start;
  gap: 16px;
}

.dues-panel {
  min-height: 220px;
}

.party-card,
.balance-row,
.rank-row,
.activity-row,
.held-order,
.report-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.party-card {
  position: relative;
}

.party-card.customer {
  border-right: 4px solid var(--success);
}

.party-card.supplier {
  border-right: 4px solid var(--warning);
}

.balance-row.customer strong {
  color: var(--warning);
}

.balance-row.supplier strong {
  color: var(--danger);
}

.party-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.party-card strong {
  display: block;
  margin-bottom: 6px;
}

.party-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.party-menu {
  position: relative;
}

.party-menu-trigger {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.party-menu:hover .party-menu-trigger,
.party-menu:focus-within .party-menu-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 145, 77, 0.18);
}

.party-menu div {
  position: absolute;
  top: 40px;
  left: 0;
  z-index: 4;
  min-width: 118px;
  display: none;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.party-menu:hover div,
.party-menu:focus-within div {
  display: grid;
}

.party-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: right;
  padding: 0 9px;
}

.party-menu button:hover {
  background: #fff8f3;
}

.party-menu button.danger-link {
  color: var(--danger);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 70px;
  align-items: center;
  gap: 10px;
}

.bar-track {
  height: 12px;
  border-radius: 4px;
  background: var(--soft);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
}

.control-center {
  display: grid;
  gap: 16px;
}

.control-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
}

.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.control-hero h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.control-hero p {
  margin: 0;
  color: var(--muted);
}

.control-actions,
.quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.control-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.control-metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.control-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.metric-warning strong {
  color: var(--warning);
}

.metric-danger strong {
  color: var(--danger);
}

.settings-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}

.settings-tabs {
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.settings-tab {
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  font-weight: 700;
}

.settings-tab:hover,
.settings-tab.active {
  background: #fff1e8;
  color: var(--accent-strong);
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.command-card,
.settings-subpanel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.command-card h3,
.settings-subpanel h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.alert-row strong,
.alert-row span {
  display: block;
}

.alert-row div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.printer-list {
  display: grid;
  gap: 10px;
}

.printer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.printer-card strong,
.printer-card span {
  display: block;
}

.printer-card div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.printer-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.settings-subpanel {
  margin-top: 18px;
}

.barcode-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.invoice-template-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.invoice-template-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 12px;
  text-align: right;
}

.invoice-template-card strong,
.invoice-template-card span {
  display: block;
}

.invoice-template-card span {
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.invoice-template-card:hover,
.invoice-template-card.active {
  border-color: var(--accent);
  background: #edf3fa;
  box-shadow: inset 0 0 0 2px rgba(8, 44, 93, 0.08);
}

.barcode-label-preview,
.barcode-label {
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: center;
}

.barcode-label strong,
.barcode-label-preview strong {
  font-size: 14px;
}

.barcode-bars {
  width: 100%;
  height: 44px;
  background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px);
}

.latin-number {
  direction: ltr;
  unicode-bidi: embed;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.switch-row {
  min-height: 40px;
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.switch-row input,
.permission-grid input {
  width: auto;
  min-height: auto;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.permission-grid label {
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
}

.inline-form {
  align-items: stretch;
}

.inline-form input,
.inline-form select {
  min-width: 150px;
}

.settings-actions {
  margin-top: 16px;
}

.audit-table {
  margin-top: 16px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 24, 38, 0.52);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(760px, 100%);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 20px;
}

.sale-details-card {
  width: min(1080px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-title-row h2 {
  margin-bottom: 4px;
}

.invoice-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.invoice-summary-grid article,
.invoice-detail-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.invoice-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.invoice-summary-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 17px;
  color: var(--text);
}

.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.invoice-detail-box h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.detail-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 9px 0;
}

.detail-line:first-of-type {
  border-top: 0;
}

.detail-line span {
  color: var(--muted);
}

.invoice-lines-table {
  max-height: 320px;
}

.invoice-lines-table td strong,
.invoice-lines-table td span {
  display: block;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 44px));
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.empty-note {
  display: grid;
  place-items: center;
  min-height: 100px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.receipt-print {
  display: none;
}

.receipt {
  width: 280px;
  color: #111;
  font-family: "Tahoma", "Arial", sans-serif;
  font-size: 12px;
  line-height: 1.45;
}

.receipt h1,
.receipt h2,
.receipt p {
  margin: 0;
}

.receipt-header {
  border-bottom: 1px dashed #333;
  padding-bottom: 8px;
  text-align: center;
}

.receipt-header h1 {
  font-size: 18px;
}

.receipt-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.receipt-meta,
.receipt-totals,
.receipt-footer {
  border-top: 1px dashed #333;
  margin-top: 8px;
  padding-top: 8px;
}

.receipt-row,
.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.receipt-lines {
  margin-top: 8px;
}

.receipt-line {
  border-bottom: 1px dotted #bbb;
  padding: 4px 0;
}

.receipt-line span:first-child {
  flex: 1;
}

.receipt-total {
  font-size: 15px;
  font-weight: 800;
}

.receipt-footer {
  text-align: center;
}

.receipt-template-compact {
  font-size: 11px;
  line-height: 1.28;
}

.receipt-template-compact .receipt-header {
  padding-bottom: 5px;
}

.receipt-template-compact .receipt-line {
  padding: 2px 0;
}

.receipt-template-boxed .receipt-header,
.receipt-template-boxed .receipt-meta,
.receipt-template-boxed .receipt-lines,
.receipt-template-boxed .receipt-totals,
.receipt-template-boxed .receipt-footer {
  border: 1px solid #222;
  padding: 7px;
  margin-top: 6px;
}

.receipt-template-boxed .receipt-line:last-child {
  border-bottom: 0;
}

.receipt-template-modern .receipt-header {
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 10px 8px;
}

.receipt-template-modern .receipt-meta,
.receipt-template-modern .receipt-totals,
.receipt-template-modern .receipt-footer {
  border-top: 2px solid #111827;
}

.receipt-template-modern .receipt-total {
  background: #f3f4f6;
  padding: 6px;
  border-radius: 6px;
}

.receipt-template-statement .receipt-header {
  text-align: start;
  border-bottom: 2px solid #111;
}

.receipt-template-statement .receipt-row,
.receipt-template-statement .receipt-line {
  display: grid;
  grid-template-columns: 1fr auto;
}

.receipt-template-statement .receipt-total {
  border-top: 2px solid #111;
  padding-top: 6px;
}

body.compact .workspace {
  padding: 14px;
}

body.compact .panel,
body.compact .kpi-card {
  padding: 13px;
}

body.compact th,
body.compact td {
  padding: 8px 10px;
}

@media (max-width: 1120px) {
  .activation-shell {
    grid-template-columns: 1fr;
  }

  .activation-intro {
    min-height: 320px;
  }

  .login-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .license-block-contact div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-showcase {
    min-height: 360px;
  }

  .app {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .pos-layout,
  .dashboard-grid,
  .split-grid,
  .report-grid,
  .command-grid,
  .catalog-layout,
  .customers-layout {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .finance-summary,
  .control-metrics,
  .inventory-summary,
  .invoice-template-grid,
  .owner-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .activation-screen,
  .login-screen,
  .license-block-screen {
    padding: 14px;
  }

  .activation-intro,
  .activation-card {
    padding: 20px;
  }

  .activation-intro {
    min-height: auto;
  }

  .activation-intro h1 {
    font-size: 27px;
  }

  .activation-card-head,
  .activation-actions,
  .owner-vault-header {
    align-items: stretch;
    flex-direction: column;
  }

  .serial-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-layout {
    border-radius: 8px;
  }

  .login-showcase {
    min-height: auto;
    padding: 24px;
  }

  .login-showcase-main h1 {
    font-size: 26px;
  }

  .login-showcase-main p {
    font-size: 14px;
  }

  .login-feature-grid {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 24px;
  }

  .login-logo {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .login-brand strong {
    font-size: 20px;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    height: auto;
    max-height: 38vh;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    height: auto;
    padding: 14px;
  }

  .topbar,
  .panel-header,
  .category-page-header,
  .dashboard-hero,
  .control-hero,
  .toolbar,
  .toolbar-actions,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .cart-actions {
    flex-wrap: wrap;
  }

  .kpi-grid,
  .finance-summary,
  .control-metrics,
  .inventory-summary,
  .invoice-template-grid,
  .invoice-summary-grid,
  .return-sale-card,
  .form-grid,
  .finance-reminder-fields,
  .settings-layout,
  .permission-grid,
  .cart-controls {
    grid-template-columns: 1fr;
  }

  .finance-reminder {
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-detail-grid {
    grid-template-columns: 1fr;
  }

  .toolbar select {
    width: 100%;
  }

  .owner-login-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .owner-kpis {
    grid-template-columns: 1fr;
  }

  .license-block-card {
    padding: 20px;
  }

  .license-block-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .license-block-brand h1 {
    font-size: 27px;
  }

  .license-block-alert strong {
    font-size: 20px;
  }

  .license-block-contact div {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: 80mm auto;
    margin: 4mm;
  }

  body {
    background: #fff;
    overflow: visible;
  }

  body > *:not(.receipt-print) {
    display: none !important;
  }

  .receipt-print {
    display: block;
  }

  .receipt {
    width: 72mm;
  }

  .barcode-labels-print {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40mm, 1fr));
    gap: 3mm;
  }

  .barcode-label {
    min-height: 28mm;
    break-inside: avoid;
    box-shadow: none;
  }
}
