.print-only {
  display: none !important;
}

:root {
  --app-emerald-900: #123234;
  --app-emerald-800: #1f4d4b;
  --app-emerald-700: #2f6e6a;
  --app-emerald-600: #43948d;
  --app-emerald-500: #57b6aa;
  --app-mint-100: #eef4ee;
  --app-mint-200: #dfe8df;
  --app-gold-300: #e8c67f;
  --app-gold-400: #d8a84a;
  --app-gold-500: #b88936;
  --app-ink: #1c2628;
  --app-card: rgba(255, 250, 241, 0.78);
  --app-card-strong: rgba(255, 253, 248, 0.94);
  --app-border: rgba(31, 77, 75, 0.15);
  --app-shadow-lg: 0 30px 74px rgba(28, 38, 40, 0.14);
  --app-shadow-md: 0 16px 40px rgba(28, 38, 40, 0.11);
  --app-shadow-sm: 0 10px 24px rgba(28, 38, 40, 0.08);
  --app-navy-900: #20343f;
  --app-navy-800: #305163;
  --app-navy-700: #3c6275;
  --app-sand-100: #fcf8f0;
  --app-sand-200: #f4ead6;
  --app-alert: #9a4338;
  --app-font-ui: "Bahnschrift", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --app-font-display: "Arial", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --app-font-official: "Times New Roman", "Traditional Arabic", "Simplified Arabic", Arial, Tahoma, serif;
}

/* App background (screen only) */
.app-shell {
  background:
    radial-gradient(circle at 8% 12%, rgba(216, 168, 74, 0.24), transparent 18%),
    radial-gradient(circle at 92% 10%, rgba(67, 148, 141, 0.2), transparent 24%),
    radial-gradient(circle at 52% 88%, rgba(32, 52, 63, 0.16), transparent 26%),
    radial-gradient(circle at 72% 54%, rgba(255, 255, 255, 0.64), transparent 28%),
    linear-gradient(145deg, #f3ead8 0%, #e9efe8 35%, #f7faf6 100%);
  position: relative;
  overflow-x: hidden;
  color: var(--app-ink);
  isolation: isolate;
  font-family: var(--app-font-ui);
}

@media print {
  /* Force physical sizing on paper (not screen pixels). */
  .table-wrap > table {
    font-size: var(--print-font-size, 13.5pt) !important;
  }

  .table-wrap th,
  .table-wrap td {
    height: var(--print-row-height, auto) !important;
    min-height: var(--print-row-height, auto) !important;
    max-height: var(--print-row-height, none) !important;
    font-weight: 900 !important;
    padding-left: var(--print-cell-padding-x, 2mm) !important;
    padding-right: var(--print-cell-padding-x, 2mm) !important;
  }

  .table-wrap input,
  .table-wrap .print-only {
    font-weight: 900 !important;
  }
}

.app-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23000'/%3E%3Cstop offset='1' stop-color='%23000'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)' fill-opacity='1'%3E%3Ctext x='18' y='70' font-family='Arial' font-size='56' font-weight='700'%3E%24%3C/text%3E%3Ctext x='110' y='150' font-family='Arial' font-size='44' font-weight='700'%3E%24%3C/text%3E%3Ctext x='34' y='210' font-family='Arial' font-size='40' font-weight='700'%3E%24%3C/text%3E%3Ctext x='170' y='70' font-family='Arial' font-size='36' font-weight='700'%3E%24%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 280px 280px;
}

.app-shell::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 16%, transparent 80%, rgba(17, 38, 59, 0.06)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 16%, transparent 84%, rgba(22, 91, 87, 0.05)),
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.36), transparent 34%);
  z-index: -1;
}

/* Keep typed content inside cells */
.table-wrap th,
.table-wrap td {
  overflow: hidden;
  word-break: break-word;
}

.table-wrap th {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

/* Global row height (controlled from settings via CSS variable on .app-shell) */
.table-wrap th,
.table-wrap td {
  height: var(--table-row-height, auto) !important;
  min-height: var(--table-row-height, auto) !important;
  max-height: var(--table-row-height, none) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: var(--table-cell-padding-x, 8px) !important;
  padding-right: var(--table-cell-padding-x, 8px) !important;
  vertical-align: middle;
}

.table-wrap input {
  height: 100% !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.table-wrap input,
.table-wrap .print-only {
  line-height: 1.1;
}

.a4-sheet .table-wrap th,
.a4-sheet .table-wrap td,
.a4-sheet .table-wrap input,
.a4-sheet .table-wrap .print-only,
.print-measure .table-wrap th,
.print-measure .table-wrap td,
.print-measure .table-wrap input,
.print-measure .table-wrap .print-only {
  font-weight: 900 !important;
}

.a4-sheet .print-root,
.a4-sheet .print-fit,
.print-measure .print-root,
.print-measure .print-fit,
.print-measure table,
.print-measure th,
.print-measure td,
.print-measure input {
  font-family: var(--app-font-official) !important;
}

/* Signature block: Accounts manager */
.accounts-signature {
  margin-top: 16mm;
  display: flex;
  justify-content: flex-start;
}

/* In RTL, flex-start is the RIGHT. We want the signature on the physical LEFT edge of the paper. */
html[dir='rtl'] .accounts-signature,
html[dir='rtl'] .accounts-signature-fixed {
  justify-content: flex-end;
}

/* Fixed signature: always bottom-left, not affected by print scaling */
.accounts-signature-fixed {
  position: absolute;
  left: 8mm;
  right: auto;
  bottom: 6mm;
  z-index: 20;
  display: flex;
  justify-content: flex-start;
}

.accounts-signature__box {
  width: 280px;
  max-width: 86mm;
  margin-right: 0;
  margin-left: 0;
  text-align: right;
  padding: 14px 18px 12px;
  border-radius: 18px;
  border: 1px solid rgba(23, 64, 42, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 244, 0.94));
  box-shadow: 0 10px 28px rgba(21, 54, 35, 0.14);
}

.accounts-signature__title {
  font-weight: 800;
  font-size: 19px;
  line-height: 1.2;
  color: #153623;
}

.accounts-signature__meta {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(21, 54, 35, 0.84);
  letter-spacing: 0;
}

.accounts-signature__line {
  border-bottom: 2px solid rgba(21, 54, 35, 0.9);
  height: 30px;
  margin-top: 14px;
}

/* If signature is not fixed (legacy), allow mild scaling in A4 preview.
   Fixed signature keeps same size by design. */
.a4-sheet .accounts-signature .accounts-signature__title {
  font-size: max(16px, calc(19px * var(--a4-density, 1)));
}

.a4-sheet .accounts-signature .accounts-signature__meta {
  font-size: max(11px, calc(12px * var(--a4-density, 1)));
}

.a4-sheet .accounts-signature .accounts-signature__line {
  height: max(24px, calc(30px * var(--a4-density, 1)));
}

/* Center tables in the app UI (screen) */
.table-wrap {
  text-align: center;
}

.table-wrap > table {
  margin-left: auto;
  margin-right: auto;
  font-size: var(--table-font-size, 18px) !important;
  font-family: inherit;
}

.table-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 4px;
  text-align: center;
  background: transparent;
  border: none;
}

.table-wrap .print-only {
  word-break: break-word;
  white-space: normal;
}

/* Unified Totals (screen + print) */
.totals-banner {
  /* Physical right edge alignment even in RTL */
  direction: ltr;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 12px;
  margin: 8px 0 10px;
  width: 100%;
}

.totals-banner__box {
  direction: rtl;
  min-width: 240px;
  border: 3px solid #ccff00;
  background: #f6ff7a;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.totals-banner__label {
  font-weight: 900;
  font-size: 16px;
  line-height: 1.1;
  color: #000;
}

.totals-banner__value {
  margin-top: 6px;
  font-weight: 900;
  font-size: var(--totals-font-size, 32px);
  line-height: 1;
  color: #000;
  letter-spacing: 0.5px;
}

/* Totals at the bottom only (left normal, right fluorescent) */
.totals-footer {
  direction: ltr;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  margin: 12px 0 0;
  width: 100%;
}

.totals-footer__right-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.totals-footer__right-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.totals-footer__metric {
  direction: rtl;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  gap: 6px;
}

.totals-footer__metric--total {
  grid-column: 1 / -1;
}

.totals-footer__metric-labelBox {
  border: 2px solid #000;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
  font-weight: 900;
  font-size: var(--totals-metric-label-font-px, 14px);
  line-height: 1.1;
  color: #000;
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.totals-footer__metric-valueBox {
  border: 2px solid #000;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
  font-weight: 900;
  font-size: var(--totals-metric-value-font-px, 24px);
  line-height: 1;
  color: #000;
  letter-spacing: 0.5px;
  min-width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sequence-highlighted label only (used for: الرواتب + المصاريف only) */
.totals-footer__metric--yellow .totals-footer__metric-labelBox {
  background: #ffeb3b;
}
.totals-footer__metric--yellow .totals-footer__metric-valueBox {
  background: #fff;
}

.totals-footer__metric--highlight .totals-footer__metric-valueBox {
  border: 3px solid #ccff00;
  background: #f6ff7a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.totals-footer__kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.totals-footer__kv-label {
  font-weight: 900;
  font-size: 16px;
  line-height: 1.1;
  color: #000;
  white-space: nowrap;
}

.totals-footer__kv-value {
  font-weight: 900;
  font-size: var(--totals-value-font-px, 32px);
  line-height: 1;
  color: #000;
  letter-spacing: 0.5px;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 120px;
  text-align: center;
  background: #fff;
}

.totals-footer__box {
  direction: rtl;
  min-width: 240px;
  border: 2px solid #000;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

.totals-footer__box--right {
  border: 3px solid #ccff00;
  background: #f6ff7a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.totals-footer__label {
  font-weight: 900;
  font-size: 16px;
  line-height: 1.1;
  color: #000;
}

.totals-footer__value {
  margin-top: 6px;
  font-weight: 900;
  font-size: var(--totals-value-font-px, 32px);
  line-height: 1;
  color: #000;
  letter-spacing: 0.5px;
}

/* Screen-only A4 guide (all pages) */
.a4-viewport {
  padding: 22px 18px 40px;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: flex-start;
  align-items: center;
  background: transparent;
}

.a4-viewport.a4-viewport--tight {
  gap: 0;
}

.a4-sheet {
  width: 297mm;
  min-width: 297mm;
  max-width: 297mm;
  height: 210mm;
  min-height: 210mm;
  max-height: 210mm;
  aspect-ratio: 297 / 210;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0;
  outline: 1px solid rgba(20, 83, 45, 0.08);
  outline-offset: -1px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(252, 255, 251, 0.98) 100%);
  box-shadow:
    0 24px 60px rgba(16, 54, 40, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

.a4-scroll {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow-x: auto;
  overflow-y: auto;
  padding: 2.5mm;
  box-sizing: border-box;
}

/* Screen A4: compress vertically when many rows are added.
   JS sets --a4-density on .print-fit (1 .. ~0.5). */
.a4-sheet .print-fit {
  --a4-density: 1;
  --a4-scale: 1;
  --a4-shift-x: 0px;
    width: 100% !important;
    max-width: 100% !important;
  max-height: none;
  overflow: visible;
  zoom: var(--a4-scale, 1);
  margin-left: auto;
  margin-right: auto;
}

  .a4-sheet .print-fit .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  .a4-sheet .print-fit table {
    width: 100% !important;
    min-width: 100% !important;
  }

.a4-sheet .print-fit h2 {
  margin: 0 0 14px 0 !important;
  padding: 8px !important;
}

.a4-sheet .print-fit th,
.a4-sheet .print-fit td {
  line-height: 1.1 !important;
  padding-left: var(--table-cell-padding-x, 8px) !important;
  padding-right: var(--table-cell-padding-x, 8px) !important;
}

/* Ensure row height control works in A4 screen preview too (override vertical padding). */
.a4-sheet .print-fit th,
.a4-sheet .print-fit td {
  height: var(--table-row-height, auto) !important;
  min-height: var(--table-row-height, auto) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.a4-sheet .print-fit input {
  line-height: inherit !important;
}

/* App/toolbars (screen only) */
.toolbar {
  gap: 10px !important;
}

.app-command-deck,
.app-hero-shell,
.a4-viewport {
  position: relative;
  z-index: 1;
}

.app-command-deck {
  width: min(1440px, calc(100vw - 36px));
  margin: 18px auto 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 26px;
  background:
    linear-gradient(140deg, rgba(27, 39, 42, 0.94), rgba(32, 52, 63, 0.92)),
    radial-gradient(circle at top right, rgba(216, 168, 74, 0.18), transparent 24%),
    radial-gradient(circle at bottom left, rgba(67, 148, 141, 0.16), transparent 24%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 44px rgba(28, 38, 40, 0.16);
}

.app-command-button {
  min-height: 46px;
  padding: 11px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(10, 12, 14, 0.18);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease, border-color 0.22s ease;
}

.app-command-button--emerald {
  background: linear-gradient(135deg, #204d43, #2f6e6a);
  border-color: rgba(255, 255, 255, 0.09);
}

.app-command-button--forest {
  background: linear-gradient(135deg, #41553b, #5f7a51);
  border-color: rgba(255, 255, 255, 0.09);
}

.app-command-button--navy {
  background: linear-gradient(135deg, #273845, #406277);
  border-color: rgba(255, 255, 255, 0.09);
}

.app-command-button--teal {
  background: linear-gradient(135deg, #2f6e6a, #43948d);
  border-color: rgba(255, 255, 255, 0.09);
}

.app-command-button--slate {
  background: linear-gradient(135deg, #505459, #71767c);
  border-color: rgba(255, 255, 255, 0.09);
}

.app-command-button--ink {
  background: linear-gradient(135deg, #272d31, #3b4850);
  border-color: rgba(255, 255, 255, 0.09);
}

.app-command-button--wine {
  background: linear-gradient(135deg, #7b4137, #a56153);
  border-color: rgba(255, 255, 255, 0.09);
}

.app-settings-panel__actions .app-command-button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 8px 16px rgba(10, 12, 14, 0.12);
}

.app-hero-shell {
  width: min(1480px, calc(100vw - 36px));
  margin: 24px auto 14px;
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) 380px;
  gap: 28px;
  align-items: stretch;
}

.app-hero__content,
.app-hero__clock-panel,
.app-nav-shell,
.app-settings-panel {
  border-radius: 30px;
  border: 1px solid rgba(31, 77, 75, 0.1);
  backdrop-filter: blur(18px);
  box-shadow: var(--app-shadow-lg);
}

.app-hero__content {
  position: relative;
  overflow: hidden;
  padding: 38px 40px;
  background:
    linear-gradient(135deg, rgba(255, 252, 246, 0.98), rgba(243, 248, 243, 0.94)),
    radial-gradient(circle at top right, rgba(216, 168, 74, 0.24), transparent 24%),
    radial-gradient(circle at bottom left, rgba(67, 148, 141, 0.14), transparent 28%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 26px 54px rgba(28, 38, 40, 0.12);
}

.app-hero__content::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 56%, rgba(31, 77, 75, 0.05) 56% 61%, transparent 61% 100%),
    linear-gradient(180deg, rgba(255,255,255,0.34), transparent 24%),
    radial-gradient(circle at 12% 14%, rgba(255,255,255,0.22), transparent 18%);
  pointer-events: none;
}

.app-hero__content::before {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 24px;
  border: 1px solid rgba(216, 168, 74, 0.12);
  pointer-events: none;
}

.app-hero__brand-row {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 28px;
}

.app-brand-mark {
  min-width: 144px;
  padding: 20px 20px;
  border-radius: 22px;
  background: linear-gradient(145deg, #18252f, #224a51 46%, #2f6e6a 74%, #d8a84a);
  color: #fff7e8;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  letter-spacing: 1px;
  box-shadow: 0 20px 34px rgba(28, 38, 40, 0.18), inset 0 1px 0 rgba(255,255,255,0.22);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.app-hero__titles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-hero__eyebrow,
.app-nav-shell__eyebrow {
  font-size: 12px;
  font-weight: 900;
  color: #9b7640;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

.app-hero__title {
  margin: 0;
  font-size: clamp(34px, 3.5vw, 56px);
  line-height: 0.98;
  color: #1a2628;
  text-wrap: balance;
  font-family: var(--app-font-display);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

.app-hero__subtitle {
  margin: 0;
  max-width: 60ch;
  color: rgba(28, 38, 40, 0.7);
  font-size: 15px;
  line-height: 2;
}

.app-hero__badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.app-hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 77, 75, 0.12);
  color: #234545;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--app-shadow-sm), inset 0 1px 0 rgba(255,255,255,0.8);
}

.app-hero__badge--sync.is-live,
.app-status-card__tone.is-live,
.app-hero__clock-pill.is-live {
  background: rgba(41, 119, 87, 0.14);
  color: #245d45;
  border-color: rgba(41, 119, 87, 0.22);
}

.app-hero__badge--sync.is-pending,
.app-status-card__tone.is-pending,
.app-hero__clock-pill.is-pending {
  background: rgba(216, 178, 102, 0.18);
  color: #835d1e;
  border-color: rgba(216, 178, 102, 0.24);
}

.app-hero__badge--sync.is-alert,
.app-status-card__tone.is-alert,
.app-hero__clock-pill.is-alert {
  background: rgba(139, 46, 36, 0.14);
  color: #8b2e24;
  border-color: rgba(139, 46, 36, 0.24);
}

.app-hero__badge--sync.is-ready,
.app-status-card__tone.is-ready,
.app-hero__clock-pill.is-ready {
  background: rgba(23, 91, 87, 0.14);
  color: #175b57;
  border-color: rgba(23, 91, 87, 0.22);
}

.app-hero__badge--sync.is-off,
.app-status-card__tone.is-off,
.app-hero__clock-pill.is-off {
  background: rgba(66, 80, 93, 0.12);
  color: #4d5b67;
  border-color: rgba(66, 80, 93, 0.22);
}

.app-hero__status-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.app-status-card {
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 243, 0.88));
  border: 1px solid rgba(31, 77, 75, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), var(--app-shadow-sm);
  position: relative;
  overflow: hidden;
}

.app-status-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--app-gold-400), var(--app-emerald-700));
  opacity: 0.9;
}

.app-status-card__label {
  display: block;
  font-size: 12px;
  font-weight: 900;
  color: rgba(22, 41, 41, 0.52);
  margin-bottom: 9px;
}

.app-status-card__value {
  display: block;
  font-size: 19px;
  font-weight: 900;
  color: #1f3f3d;
}

.app-status-card__tone {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 900;
}

.app-period-control {
  padding: 20px 22px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(24, 35, 40, 0.98), rgba(32, 77, 75, 0.95) 52%, rgba(86, 164, 157, 0.92) 82%, rgba(216, 168, 74, 0.84));
  color: #f9fbfa;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 30px rgba(28, 38, 40, 0.18);
}

.app-period-control__range,
.app-period-control__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-period-control__range {
  justify-content: space-between;
}

.app-period-control__label {
  font-size: 13px;
  font-weight: 900;
  color: rgba(255, 248, 232, 0.84);
}

.app-hero__clock-panel {
  position: relative;
  overflow: hidden;
  padding: 34px 24px 30px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 232, 176, 0.24), transparent 24%),
    radial-gradient(circle at 100% 100%, rgba(70, 164, 154, 0.22), transparent 34%),
    radial-gradient(circle at 50% 45%, rgba(255,255,255,0.06), transparent 34%),
    linear-gradient(160deg, rgba(15, 25, 31, 0.99), rgba(24, 41, 49, 0.98) 42%, rgba(27, 56, 68, 0.96) 68%, rgba(18, 30, 39, 0.99));
  border: 1px solid rgba(236, 210, 151, 0.12);
  border-radius: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 54px rgba(12, 20, 27, 0.22);
}

.app-hero__clock-panel::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 30px;
  border: 1px solid rgba(236, 210, 151, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.app-hero__clock-panel::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  right: -54px;
  top: 24px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(216, 168, 74, 0.14), transparent 68%);
  filter: blur(6px);
  pointer-events: none;
}

.app-hero__clock-head {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 248, 231, 0.96), rgba(228, 194, 123, 0.94));
  border: 1px solid rgba(232, 198, 127, 0.32);
  color: #5b3f14;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.1px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(216, 178, 102, 0.16);
}

.app-hero__clock-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 292px;
  height: 292px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.84), transparent 18%),
    radial-gradient(circle at 70% 78%, rgba(16, 39, 51, 0.1), transparent 26%),
    linear-gradient(145deg, rgba(255, 249, 238, 0.99), rgba(214, 226, 224, 0.98));
  border: 1px solid rgba(232, 198, 127, 0.24);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.88),
    inset 0 -22px 38px rgba(17, 38, 59, 0.08),
    0 30px 50px rgba(10, 20, 28, 0.22);
}

.app-hero__clock-frame::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  border: 1px solid rgba(233, 207, 151, 0.52);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.48),
    inset 0 0 0 10px rgba(207, 174, 103, 0.16);
  opacity: 0.96;
}

.app-hero__clock-frame::after {
  content: '';
  position: absolute;
  inset: 22px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(216, 178, 102, 0.12), transparent 64%);
  pointer-events: none;
}

.app-hero__clock-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: min(100%, 300px);
  padding: 14px 18px 12px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(239, 214, 158, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 28px rgba(0,0,0,0.12);
}

.app-hero__clock-time {
  font-size: 38px;
  font-weight: 900;
  color: #fff6e4;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.app-hero__clock-date {
  font-size: 18px;
  font-weight: 900;
  color: rgba(255, 245, 226, 0.88);
  text-align: center;
  line-height: 1.8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.app-hero__clock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.app-hero__clock-note {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 245, 226, 0.72);
  text-align: center;
  max-width: 30ch;
}

.app-nav-shell {
  margin-top: 20px;
  padding: 28px 28px;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.95), rgba(244, 247, 242, 0.9)),
    radial-gradient(circle at top left, rgba(216, 168, 74, 0.17), transparent 24%),
    radial-gradient(circle at bottom right, rgba(67, 148, 141, 0.12), transparent 24%);
  position: relative;
  overflow: hidden;
}

.app-nav-shell::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 24px;
  border: 1px solid rgba(31, 77, 75, 0.08);
  pointer-events: none;
}

.app-nav-shell__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.app-nav-shell__title {
  font-size: 30px;
  font-weight: 900;
  color: #213234;
  font-family: var(--app-font-display);
}

.app-nav-shell__subtitle {
  margin-top: 8px;
  color: rgba(28, 38, 40, 0.62);
  font-size: 14px;
  line-height: 1.8;
}

.app-topbar-right {
  display: block;
}

.app-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.app-nav-button {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  padding: 20px 22px 20px 20px;
  border-radius: 24px;
  border: 1px solid rgba(31, 77, 75, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 247, 242, 0.92)),
    radial-gradient(circle at top right, rgba(216, 168, 74, 0.08), transparent 30%);
  color: #223334;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(28, 38, 40, 0.09), inset 0 1px 0 rgba(255,255,255,0.85);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.app-nav-button::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(180deg, rgba(216, 168, 74, 0.92), rgba(67, 148, 141, 0.92));
  opacity: 0.82;
}

.app-nav-button__title {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.app-nav-button__note {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.75;
  font-weight: 700;
  color: rgba(34, 51, 52, 0.68);
}

.app-nav-button::after {
  content: '';
  position: absolute;
  inset: auto 18px 14px 18px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(216, 168, 74, 0.95), rgba(67, 148, 141, 0.95));
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.app-nav-button.is-active {
  background: linear-gradient(135deg, #1b2b35, #23555b 52%, #2f6e6a 78%, #d8a84a);
  color: #fff9ef;
  border-color: rgba(39, 56, 69, 0.64);
  box-shadow: 0 20px 34px rgba(28, 38, 40, 0.22);
}

.app-nav-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 34px rgba(28, 38, 40, 0.14), inset 0 1px 0 rgba(255,255,255,0.9);
}

.app-nav-button.is-active .app-nav-button__note,
.app-nav-button--secondary.is-active .app-nav-button__note {
  color: rgba(255, 249, 239, 0.82);
}

.app-nav-button.is-active::after,
.app-nav-button:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.app-nav-button--secondary.is-active {
  background: linear-gradient(135deg, #505459, #71767c);
  border-color: rgba(80, 84, 89, 0.78);
}

/* Professional main dashboard polish */
.app-shell {
  background:
    linear-gradient(180deg, #f7f2e8 0%, #ece1cf 42%, #f9f6ef 100%);
}

.app-shell::before,
.app-shell::after {
  display: none;
}

.app-command-deck {
  width: min(1480px, calc(100vw - 36px));
  margin: 16px auto 0;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1b2024, #2b2f32 58%, #5f4622);
  border: 1px solid rgba(214, 176, 97, 0.26);
  box-shadow: 0 14px 30px rgba(35, 29, 21, 0.18);
  backdrop-filter: none;
}

.app-command-button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0;
  box-shadow: none;
}

.app-command-button--ink {
  background: #111827;
}

.app-command-button--wine {
  background: #7f2f34;
}

.app-command-button--emerald,
.app-command-button--forest,
.app-command-button--teal {
  background: #1f675d;
}

.app-command-button--navy,
.app-command-button--slate {
  background: #574733;
}

.app-hero-shell {
  width: min(1480px, calc(100vw - 36px));
  margin: 14px auto 16px;
}

.app-hero {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.app-hero__content,
.app-hero__clock-panel,
.app-nav-shell,
.app-settings-panel {
  border-radius: 16px;
  border: 1px solid rgba(169, 127, 46, 0.18);
  box-shadow: 0 16px 36px rgba(52, 40, 24, 0.13);
  backdrop-filter: none;
}

.app-hero__content {
  padding: 24px 26px;
  background:
    linear-gradient(135deg, rgba(255, 252, 245, 0.99), rgba(246, 237, 218, 0.97));
  box-shadow: 0 16px 36px rgba(52, 40, 24, 0.13);
}

.app-hero__content::before,
.app-hero__content::after,
.app-nav-shell::before,
.app-hero__clock-panel::before,
.app-hero__clock-panel::after {
  display: none;
}

.app-hero__brand-row {
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.app-brand-mark {
  min-width: 96px;
  padding: 16px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, #161d21, #234940 64%, #b88936);
  font-size: 24px;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 18px rgba(39, 28, 15, 0.18);
}

.app-hero__eyebrow,
.app-nav-shell__eyebrow {
  color: #9b6f25;
  letter-spacing: 0;
  text-transform: none;
}

.app-hero__title {
  font-size: clamp(30px, 2.6vw, 44px);
  line-height: 1.15;
  letter-spacing: 0;
  color: #171b1f;
  text-shadow: none;
}

.app-hero__subtitle {
  max-width: 72ch;
  color: rgba(35, 30, 24, 0.68);
  line-height: 1.75;
}

.app-hero__badge-row {
  margin-top: 12px;
}

.app-hero__badge {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff8eb;
  border-color: rgba(184, 137, 54, 0.16);
  color: #3c3020;
  box-shadow: none;
}

.app-hero__status-row {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.app-status-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: #fffaf0;
  border-color: rgba(184, 137, 54, 0.14);
  box-shadow: none;
}

.app-status-card::before {
  width: 4px;
  background: linear-gradient(180deg, #c89b3c, #1f675d);
}

.app-status-card__label {
  margin-bottom: 6px;
  color: rgba(23, 35, 38, 0.54);
}

.app-status-card__value {
  font-size: 17px;
  color: #1c2f2b;
}

.app-status-card__tone {
  margin-top: 8px;
  padding: 4px 9px;
}

.app-period-control {
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #161d21, #214940 68%, #8a672b);
  box-shadow: none;
}

.app-hero__clock-panel {
  padding: 18px;
  gap: 10px;
  justify-content: flex-start;
  background: linear-gradient(160deg, #11161a, #20272b 52%, #4e3a20);
  border-color: rgba(214, 176, 97, 0.22);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(31, 47, 52, 0.12);
}

.app-hero__clock-head {
  min-height: 32px;
  padding: 6px 14px;
  background: rgba(214, 176, 97, 0.14);
  border-color: rgba(214, 176, 97, 0.24);
  color: #fff2d0;
  letter-spacing: 0;
  box-shadow: none;
}

.app-hero__clock-frame {
  width: 264px;
  height: 264px;
  box-shadow: none;
}

.app-hero__clock-panel .analog-clock {
  width: 216px;
  height: 216px;
  transform: none;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.18));
}

.app-hero__clock-panel .analog-clock::before {
  display: none;
}

.app-hero__clock-panel .analog-clock-face {
  border-width: 8px;
}

.app-hero__clock-panel .analog-clock-orbit--outer {
  width: 132px;
  height: 132px;
}

.app-hero__clock-panel .analog-clock-orbit--inner {
  width: 88px;
  height: 88px;
}

.app-hero__clock-panel .analog-clock-tick {
  transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-92px);
}

.app-hero__clock-panel .analog-clock-tick.major {
  height: 16px;
  transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-90px);
}

.app-hero__clock-panel .analog-clock-number {
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-82px) rotate(calc(-1 * var(--deg, 0deg)));
  font-size: 17px;
}

.app-hero__clock-panel .analog-clock-complication--day {
  right: 28px;
  top: 44px;
}

.app-hero__clock-panel .analog-clock-complication--date {
  left: 28px;
  top: 92px;
}

.app-hero__clock-panel .analog-clock-complication--seconds {
  bottom: 22px;
}

.app-hero__clock-meta {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: none;
}

.app-hero__clock-time {
  font-size: 26px;
  letter-spacing: 0;
}

.app-hero__clock-date {
  font-size: 14px;
  line-height: 1.5;
}

.app-hero__clock-note {
  max-width: 26ch;
  line-height: 1.6;
}

.app-nav-shell {
  margin-top: 16px;
  padding: 18px;
  background: linear-gradient(180deg, #fffdf8, #f8f0df);
  overflow: visible;
}

.app-nav-shell__header {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(184, 137, 54, 0.16);
}

.app-nav-shell__title {
  font-size: 22px;
  color: #171b1f;
}

.app-nav-shell__subtitle {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.6;
}

.app-footer-signature {
  border-radius: 999px;
  background: #fff8eb;
  color: #5f4622;
  border: 1px solid rgba(184, 137, 54, 0.18);
}

.app-nav-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.app-nav-button {
  min-height: 84px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fffaf0;
  border-color: rgba(184, 137, 54, 0.16);
  box-shadow: none;
}

.app-nav-button::before {
  width: 4px;
  background: linear-gradient(180deg, #c89b3c, #1f675d);
  opacity: 0.85;
}

.app-nav-button::after {
  inset: auto 14px 10px 14px;
  height: 2px;
  background: linear-gradient(90deg, #c89b3c, #1f675d);
}

.app-nav-button__title {
  font-size: 15px;
}

.app-nav-button__note {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.55;
}

.app-nav-button:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 137, 54, 0.32);
  box-shadow: 0 10px 20px rgba(52, 40, 24, 0.12);
}

.app-nav-button.is-active {
  background: linear-gradient(135deg, #171b1f, #214940 62%, #b88936);
  border-color: rgba(184, 137, 54, 0.36);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(52, 40, 24, 0.22);
}

.app-nav-button--secondary.is-active {
  background: linear-gradient(135deg, #3e2f2f, #7f2f34);
  border-color: rgba(127, 47, 52, 0.5);
}

.app-settings-panel {
  background: linear-gradient(180deg, #fffdf8, #f8f0df);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(52, 40, 24, 0.12);
}

.app-settings-panel {
  width: min(1440px, calc(100vw - 36px));
  margin: 0 auto 16px;
  padding: 18px 22px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.92), rgba(243, 246, 240, 0.88)),
    radial-gradient(circle at top right, rgba(216, 168, 74, 0.14), transparent 24%);
}

.app-settings-panel__group,
.app-settings-panel__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 77, 75, 0.08);
}

.app-settings-panel__label {
  font-size: 13px;
  font-weight: 900;
  color: #163d39;
}

.app-settings-panel__value {
  min-width: 54px;
  text-align: center;
  font-weight: 900;
  color: #175b57;
}

.app-settings-panel__hint {
  font-size: 12px;
  font-weight: 700;
  color: rgba(22, 41, 41, 0.62);
}

.app-settings-panel__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  color: #2f6e6a;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px dashed rgba(31, 77, 75, 0.16);
}

.toolbar button,
.app-command-button,
.app-topbar-right button {
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.toolbar button:hover,
.app-command-button:hover,
.app-topbar-right button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(17, 52, 53, 0.18) !important;
  filter: saturate(1.04);
}

.toolbar button:active,
.app-command-button:active,
.app-topbar-right button:active {
  transform: translateY(0);
}

.toolbar input[type='month'],
.toolbar input[type='date'],
.toolbar input[type='number'],
.toolbar input[type='range'],
.toolbar select,
.app-period-control input[type='month'],
.app-period-control input[type='date'],
.app-period-control input[type='number'],
.app-settings-panel input[type='range'] {
  border-radius: 14px;
  border: 1px solid rgba(20, 83, 45, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 10px rgba(20, 83, 45, 0.05);
}

.toolbar input[type='month']:focus,
.toolbar input[type='date']:focus,
.toolbar input[type='number']:focus,
.toolbar select:focus,
.app-period-control input[type='month']:focus,
.app-period-control input[type='date']:focus,
.app-period-control input[type='number']:focus {
  outline: none;
  border-color: rgba(31, 122, 67, 0.45);
  box-shadow: 0 0 0 4px rgba(47, 161, 90, 0.12);
}

/* Bottom ticker (screen only via .no-print) */
.app-ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  z-index: 10001;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, rgba(17, 38, 59, 0.96), rgba(23, 91, 87, 0.96), rgba(42, 141, 133, 0.96));
  border-top: 1px solid rgba(231, 203, 138, 0.45);
  color: #fff6e2;
  box-shadow: 0 -10px 26px rgba(17, 38, 59, 0.18);
  pointer-events: none;
}

.app-ticker__inner {
  display: inline-block;
  white-space: nowrap;
  font-weight: 900;
  letter-spacing: 1px;
  padding-inline: 20px;
  will-change: transform;
  animation: appTickerMarquee 14s linear infinite;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.26);
}

@keyframes appTickerMarquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}


.analog-clock {
  width: 244px;
  height: 244px;
  position: relative;
  transform: perspective(1400px) rotateX(9deg) rotateZ(-2deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 28px 26px rgba(0, 0, 0, 0.24));
}

.analog-clock::before {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(216, 178, 102, 0.2), transparent 70%);
  filter: blur(12px);
  z-index: 0;
}

.analog-clock::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(216, 178, 102, 0.12);
  pointer-events: none;
  z-index: 1;
}

.analog-clock-face {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(216, 168, 74, 0.14), transparent 22%),
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.98), transparent 18%),
    radial-gradient(circle at 50% 64%, rgba(16, 79, 90, 0.1), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(242, 245, 241, 0.98));
  border: 10px solid rgba(216, 168, 74, 0.78);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.9),
    inset 0 -16px 28px rgba(23, 91, 87, 0.05),
    inset 0 22px 34px rgba(255, 255, 255, 0.42),
    0 14px 24px rgba(17, 38, 59, 0.12);
  z-index: 1;
}

.analog-clock-face::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  z-index: 1;
  background:
    radial-gradient(circle, transparent 0 68%, rgba(0, 0, 0, 0.04) 69%, transparent 71%),
    radial-gradient(circle, transparent 0 82%, rgba(216, 168, 74, 0.12) 83%, transparent 85%);
  opacity: 1;
}

.analog-clock-face::after {
  content: '';
  position: absolute;
  inset: 22px;
  border-radius: 999px;
  border: 1px solid rgba(25, 77, 70, 0.14);
  box-shadow: inset 0 0 18px rgba(20, 83, 45, 0.04), inset 0 0 40px rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.analog-clock-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.analog-clock-orbit--outer {
  width: 154px;
  height: 154px;
  border: 1px dashed rgba(216, 168, 74, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.analog-clock-orbit--inner {
  width: 102px;
  height: 102px;
  border: 1px solid rgba(33, 96, 100, 0.18);
  background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 72%);
}

.analog-clock-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 10px;
  transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-106px);
  transform-origin: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(23, 55, 62, 0.82), rgba(23, 55, 62, 0.18));
  opacity: 0.42;
  z-index: 2;
}

.analog-clock-tick.major {
  width: 4px;
  height: 20px;
  transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-103px);
  background: linear-gradient(180deg, #1f565f, rgba(216, 168, 74, 0.9));
  opacity: 0.94;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.analog-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--deg, 0deg));
  border-radius: 999px;
}

.analog-hand::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 8%;
  width: 32%;
  height: 72%;
  transform: translateX(-50%);
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
}

.analog-hand.second::before {
  width: 100%;
  height: 18px;
  top: auto;
  bottom: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.08));
}

.analog-hand.second::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #ef6b5c;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.analog-clock-number {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-96px) rotate(calc(-1 * var(--deg, 0deg)));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #173f46;
  font-size: 20px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 16px rgba(216, 178, 102, 0.12);
  z-index: 3;
  user-select: none;
}

.analog-clock-complication {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(246, 248, 244, 0.96), rgba(227, 233, 227, 0.95));
  border: 1px solid rgba(31, 77, 75, 0.12);
  color: #24474a;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(17, 38, 59, 0.1), inset 0 1px 0 rgba(255,255,255,0.86);
  z-index: 3;
}

.analog-clock-complication--day {
  right: 36px;
  top: 54px;
  min-width: 64px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.analog-clock-complication--date {
  left: 34px;
  top: 108px;
  width: 42px;
  height: 42px;
  font-size: 15px;
}

.analog-clock-complication--seconds {
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  min-width: 84px;
  min-height: 28px;
  padding: 0 12px;
  font-size: 10px;
  letter-spacing: 1px;
}

.analog-clock-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 3;
  pointer-events: none;
}

.analog-clock-brand span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: rgba(23, 63, 70, 0.54);
}

.analog-clock-brand strong {
  font-size: 11px;
  font-weight: 900;
  color: rgba(181, 129, 22, 0.92);
}

.analog-clock-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 2px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(216,168,74,0.34), transparent);
  z-index: 3;
  opacity: 0.8;
}

.analog-hand.hour {
  width: 12px;
  height: 74px;
  background: linear-gradient(180deg, #193240, #15474d 82%, #0f222c);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.analog-hand.minute {
  width: 8px;
  height: 104px;
  background: linear-gradient(180deg, #2b897f, #18424f 84%, #112430);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}

.analog-hand.second {
  width: 3px;
  height: 112px;
  background: linear-gradient(180deg, #ff8572, #dd5144 42%, #8f1919);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.analog-clock-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fff8d3, #d4af37 56%, #926d13);
  border: 2px solid rgba(22, 78, 72, 0.28);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), 0 0 0 8px rgba(255, 255, 255, 0.34);
  z-index: 5;
}

@media screen {
  .table-wrap th > div[style*='col-resize'],
  .table-wrap th > span[style*='col-resize'],
  .table-wrap th > .no-print[style*='col-resize'] {
    width: 18px !important;
    background: linear-gradient(180deg, rgba(20, 83, 45, 0.04), rgba(20, 83, 45, 0.34), rgba(20, 83, 45, 0.04)) !important;
    opacity: 0.72;
    transition: opacity 0.16s ease, background 0.16s ease;
  }

  .table-wrap th:hover > div[style*='col-resize'],
  .table-wrap th:hover > span[style*='col-resize'],
  .table-wrap th:hover > .no-print[style*='col-resize'] {
    opacity: 1;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0), rgba(212, 175, 55, 0.95), rgba(212, 175, 55, 0)) !important;
  }

  .table-wrap td > div[style*='row-resize'],
  .table-wrap td > .no-print[style*='row-resize'],
  .table-wrap th > div[style*='row-resize'],
  .table-wrap th > .no-print[style*='row-resize'] {
    height: 10px !important;
    background: linear-gradient(90deg, rgba(20, 83, 45, 0), rgba(20, 83, 45, 0.24), rgba(20, 83, 45, 0)) !important;
    opacity: 0.58;
  }

  .table-wrap td:hover > div[style*='row-resize'],
  .table-wrap td:hover > .no-print[style*='row-resize'],
  .table-wrap th:hover > div[style*='row-resize'],
  .table-wrap th:hover > .no-print[style*='row-resize'] {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0), rgba(212, 175, 55, 0.9), rgba(212, 175, 55, 0)) !important;
    opacity: 1;
  }
}

.app-footer-signature {
  position: static;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(244, 246, 239, 0.88));
  border: 1px solid rgba(31, 77, 75, 0.14);
  color: var(--app-emerald-800);
  font-weight: 900;
  letter-spacing: 0.1px;
  box-shadow: var(--app-shadow-md);
  user-select: none;
  backdrop-filter: blur(12px);
}

.toolbar button {
  color: #fff;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
}

.toolbar button:hover {
  background: #2e7d32;
  border-color: #2e7d32;
}

.toolbar button:active {
  transform: translateY(1px);
}

.toolbar input[type='month'],
.toolbar input[type='date'],
.toolbar input[type='number'] {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(20, 83, 45, 0.16);
  font-size: 15px;
  background: rgba(255, 255, 255, 0.94);
}

@media screen and (max-width: 1180px) {
  .app-command-deck,
  .app-hero-shell,
  .app-settings-panel {
    width: min(100vw - 24px, 1440px);
  }

  .app-hero {
    grid-template-columns: 1fr;
  }

  .app-hero__clock-panel {
    min-height: 290px;
  }

  .app-hero__clock-frame {
    width: 274px;
    height: 274px;
  }

  .analog-clock {
    width: 228px;
    height: 228px;
  }

  .app-topbar-inner {
    max-width: calc(100vw - 32px);
  }

  .app-side-brand,
  .app-side-clock {
    opacity: 0.88;
    transform: none;
  }

  .app-side-brand {
    top: auto;
    bottom: 56px;
    right: 12px;
    font-size: 22px;
    padding: 12px 16px;
  }

  .app-side-clock {
    width: 220px;
    height: 220px;
    top: auto;
    left: 12px;
    bottom: 56px;
  }

  .analog-clock {
    width: 192px;
    height: 192px;
  }

  .app-hero__clock-frame {
    width: 234px;
    height: 234px;
  }

  .analog-clock-number {
    transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-75px) rotate(calc(-1 * var(--deg, 0deg)));
    font-size: 17px;
  }

  .analog-clock-tick {
    transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-82px);
  }

  .analog-clock-tick.major {
    transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-80px);
  }
}

@media screen and (max-width: 760px) {
  .app-command-deck,
  .app-hero-shell,
  .app-settings-panel {
    width: calc(100vw - 16px);
  }

  .app-command-deck {
    justify-content: center;
    border-radius: 20px;
    padding: 12px;
  }

  .app-hero__content,
  .app-hero__clock-panel,
  .app-nav-shell,
  .app-settings-panel {
    border-radius: 22px;
  }

  .app-hero__content {
    padding: 22px 18px;
  }

  .app-brand-mark {
    min-width: 106px;
    font-size: 22px;
  }

  .app-hero__badge-row {
    gap: 8px;
  }

  .app-hero__badge,
  .app-hero__clock-pill {
    width: 100%;
  }

  .app-hero__clock-frame {
    width: 236px;
    height: 236px;
  }

  .app-hero__clock-time {
    font-size: 28px;
  }

  .app-hero__clock-date {
    font-size: 18px;
  }

  .app-nav-grid {
    grid-template-columns: 1fr;
  }

  .app-nav-button {
    min-height: 84px;
  }

  .analog-clock {
    width: 196px;
    height: 196px;
  }

  .analog-clock-tick {
    transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-84px);
  }

  .analog-clock-tick.major {
    transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-81px);
  }

  .analog-clock-number {
    transform: translate(-50%, -50%) rotate(var(--deg, 0deg)) translateY(-74px) rotate(calc(-1 * var(--deg, 0deg)));
    font-size: 17px;
  }

  .analog-clock-complication--day {
    right: 24px;
    top: 44px;
  }

  .analog-clock-complication--date {
    left: 22px;
    top: 90px;
    width: 38px;
    height: 38px;
  }

  .analog-clock-complication--seconds {
    bottom: 22px;
    min-width: 72px;
  }

  .app-period-control {
    padding: 14px 14px;
  }

  .app-topbar {
    padding: 14px 10px 4px;
  }

  .app-topbar-inner {
    border-radius: 22px;
    padding: 14px;
    max-width: calc(100vw - 20px);
  }

  .app-topbar-center,
  .app-topbar-right {
    width: 100%;
    justify-content: center;
  }

  .app-shell > .no-print[aria-label='نسخ احتياطي'] {
    left: 8px !important;
    right: 8px;
    top: 8px !important;
    justify-content: center;
  }

  .app-side-brand,
  .app-side-clock,
  .app-footer-signature {
    display: none !important;
  }

  .a4-viewport {
    padding: 14px 8px 46px;
  }

  .a4-sheet {
    border-radius: 20px;
  }

  .app-ticker {
    height: 34px;
  }
}

.a4-dots {
  background-image: radial-gradient(#d6d6d6 0.7px, transparent 0.7px);
  background-size: 10mm 10mm;
  background-position: 0 0;
}

/*
  Print behavior goals:
  1) Print ONLY the table area (not the whole app UI)
  2) Force A4 single-page output
  3) Allow JS to set --print-scale so the content fits on one page
*/

@page {
  size: A4 landscape;
  /* Use a small, stable margin to avoid printer/driver auto-shrink issues. */
  margin: 6mm;
}

/* Used by JS just before calling window.print() to measure in A4 layout.
   IMPORTANT: keep this screen-only and minimal so it doesn't override real print styles. */
@media screen {
  .print-measure body {
    background: #fff !important;
    direction: rtl;
  }

  /* Snapshot capture should never include screen-only paper guides/backgrounds. */
  .print-measure .app-shell {
    background: #fff !important;
    background-image: none !important;
  }

  .print-measure .app-shell::before {
    content: none !important;
    background-image: none !important;
  }

  .print-measure .a4-dots {
    background: none !important;
    background-image: none !important;
  }

  .print-measure .a4-sheet {
    outline: none !important;
    outline-offset: 0 !important;
  }

  .print-measure button,
  .print-measure .no-print {
    display: none !important;
  }

  .print-measure .print-only {
    display: block !important;
  }

  .print-measure .print-root {
    width: var(--print-measure-page-width, auto) !important;
    min-width: var(--print-measure-page-width, 0) !important;
    max-width: var(--print-measure-page-width, none) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 4mm;
    margin: 0 !important;
    overflow: visible !important;
  }

  .print-measure .print-fit {
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    align-self: stretch;
  }

  .print-measure .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  .print-measure table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }

  .print-measure .table-wrap .print-only {
    white-space: nowrap !important;
    word-break: normal !important;
  }

  .print-measure .accounts-signature-fixed {
    width: 100% !important;
    /* Force physical-left alignment regardless of RTL document direction. */
    direction: ltr !important;
    justify-content: flex-start !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 8mm !important;
    padding-right: 0 !important;
    padding-top: 4mm !important;
  }

  .print-measure .accounts-signature-fixed .accounts-signature__box {
    direction: rtl;
  }

  .print-measure .table-wrap {
    overflow: visible !important;
  }
}

@media print {
  /* Force pure white page background (no green app gradients / dots) */
  .app-shell {
    background: #fff !important;
    background-image: none !important;
  }

  .app-shell::before {
    content: none !important;
    background-image: none !important;
  }

  .a4-dots {
    background: none !important;
    background-image: none !important;
  }

  .a4-viewport {
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
  }

  .a4-sheet {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  .a4-sheet + .a4-sheet {
    break-before: page;
    page-break-before: always;
  }

  .a4-scroll {
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    direction: rtl;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-root {
    position: relative;
    width: max-content !important;
    max-width: none !important;
    height: auto !important;
    box-sizing: border-box;
    /* Use a real footer area so signature never overlays content */
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    padding: 2mm !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .print-fit {
    flex: 1 1 auto;
    min-height: 0;
  }

  .accounts-signature-fixed {
    width: 100% !important;
    /* Force physical-left alignment regardless of RTL document direction. */
    direction: ltr !important;
    justify-content: flex-start !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 8mm !important;
    padding-right: 0 !important;
    padding-top: 4mm !important;
  }

  .accounts-signature-fixed .accounts-signature__box {
    direction: rtl;
  }

  /* If multiple print-root blocks exist, start each on a new page */
  .print-root + .print-root {
    break-before: page;
    page-break-before: always;
  }

  /* Scale the print content to stay inside one A4 page */
  .print-fit {
    position: relative;
     width: max-content !important;
     max-width: none !important;
    min-width: 0 !important;
    /* IMPORTANT: use zoom for printing because CSS transforms do NOT affect pagination.
       With transform: scale(), Chromium may still paginate based on the unscaled size.
       zoom DOES affect layout, so it can truly force single-page output. */
    zoom: var(--print-scale, 1);
    margin: 0 auto;
    page-break-inside: avoid;
    break-inside: avoid;
    /* Avoid translate-based shifting (it can misalign in RTL and with zoom). */
    transform: none !important;
    transform-origin: top center;
    height: auto;
  }

  /* In RTL, the logical page start is the RIGHT edge.
     Anchor from top-right and invert shift direction so centering works and nothing gets clipped. */
  html[dir='rtl'] .print-fit {
    transform-origin: top center !important;
    transform: none !important;
  }

  .print-root,
  .print-fit {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .table-wrap {
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
  }

  /* Keep full content visible; JS will scale to fit one page */

  button,
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  table {
    font-family: var(--app-font-official) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-collapse: collapse;
     /* Allow multi-page tables (do NOT force everything into one page). */
     page-break-inside: auto;
     break-inside: auto;
  }

  thead {
    display: table-header-group;
  }

  /* Avoid splitting a single row across pages. */
  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .table-wrap .print-only {
    white-space: nowrap !important;
    word-break: normal !important;
  }

  th,
  td {
    font-family: var(--app-font-official) !important;
    text-align: center !important;
    vertical-align: middle;
    font-weight: 900 !important;
  }

  .table-wrap input,
  .table-wrap .print-only {
    font-family: var(--app-font-official) !important;
    font-weight: 900 !important;
  }

  .print-root,
  .print-fit {
    font-family: var(--app-font-official) !important;
  }

  h2 {
    margin: 0 0 3mm 0 !important;
  }

  /* Let the app's inline/table styles control sizing; zoom already forces one-page fit. */
}
