/* =========================================================
   BELOVED SKINCARE ADMIN
   Luxury cream / olive / antique-gold palette
   ========================================================= */

:root {
  --cream: #f0e0d0;
  --cream-light: #f8eddd;
  --cream-gold: #f0e0b0;
  --olive: #303010;
  --olive-soft: #4d5533;
  --olive-mid: #626b48;
  --gold: #b07010;
  --gold-bright: #d18a1a;
  --gold-light: #e2b15a;
  --text: #303010;
  --muted: #716b5c;
  --white: #fffaf2;
  --danger: #8b3f32;
  --glass: rgba(255, 250, 242, .70);
  --glass-strong: rgba(255, 250, 242, .88);
  --border: rgba(48, 48, 16, .15);
  --shadow: 0 28px 80px rgba(48, 48, 16, .16);
  --radius: 22px;
  --input-bg: rgba(255, 255, 255, .48);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Montserrat", system-ui, sans-serif;
  background: var(--cream);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .62; }

.hidden { display: none !important; }

.admin-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 10% 10%, rgba(176,112,16,.11), transparent 30%),
    radial-gradient(circle at 90% 85%, rgba(48,48,16,.10), transparent 34%),
    linear-gradient(135deg, #f8eddd, #f0e0d0 52%, #f0e0b0);
}

.admin-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, transparent 0 68%, rgba(48,48,16,.035) 68% 69%, transparent 69%),
    linear-gradient(35deg, transparent 0 76%, rgba(176,112,16,.035) 76% 77%, transparent 77%);
  pointer-events: none;
}

.admin-app {
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: 38px 18px;
}

.view {
  width: 100%;
  animation: pageIn .28s ease;
}

.auth-view {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
}

.glass-card {
  background: linear-gradient(145deg, var(--glass-strong), rgba(255,250,242,.58));
  border: 1px solid rgba(48,48,16,.13);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-card {
  width: min(100%, 410px);
  padding: 34px 34px 30px;
  border-radius: 28px;
}

.admin-logo-wrap {
  width: 170px;
  margin: 0 auto 10px;
}

.admin-logo,
.dashboard-logo,
.page-logo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.auth-heading {
  text-align: center;
  margin-bottom: 28px;
}

.auth-heading span,
.section-kicker {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
}

.auth-heading h1 {
  margin: 5px 0 3px;
  font-family: "Cormorant Garamond", serif;
  font-size: 39px;
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--olive);
  font-size: 12px;
  font-weight: 800;
}

.field-label i {
  width: 18px;
  margin-right: 3px;
  color: var(--gold);
}

.field-label em {
  color: var(--danger);
  font-style: normal;
}

.input-wrap,
.select-wrap {
  position: relative;
  margin-bottom: 17px;
}

.input-wrap input,
.input-wrap textarea,
.select-wrap select,
.search-wrap input,
.phone-input input,
.phone-input select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-wrap input,
.phone-input input {
  height: 46px;
  padding: 0 13px;
}

.input-wrap textarea {
  min-height: 78px;
  padding: 12px 13px;
  resize: vertical;
}

.select-wrap select,
.phone-input select {
  height: 46px;
  padding: 0 12px;
  appearance: none;
}

.select-wrap::after {
  content: "\f078";
  position: absolute;
  right: 14px;
  top: 14px;
  color: var(--gold);
  font: 700 11px/1 "Font Awesome 6 Free";
  pointer-events: none;
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder,
.search-wrap input::placeholder,
.phone-input input::placeholder {
  color: #9b927f;
}

.input-wrap input:focus,
.input-wrap textarea:focus,
.select-wrap select:focus,
.search-wrap input:focus,
.phone-input input:focus,
.phone-input select:focus {
  border-color: rgba(176,112,16,.62);
  box-shadow: 0 0 0 3px rgba(176,112,16,.10);
  background: rgba(255,255,255,.72);
}

.input-action {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: var(--olive-soft);
  background: transparent;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 1px 0 20px;
  color: var(--olive);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 17px;
  font-size: 12px;
  font-weight: 800;
  transition: transform .18s, filter .18s, box-shadow .18s;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn-primary {
  color: var(--white);
  background: var(--olive);
  box-shadow: 0 10px 24px rgba(48,48,16,.16);
}

.btn-secondary {
  color: var(--olive);
  background: rgba(255,255,255,.50);
  border-color: var(--border);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-full { width: 100%; }
.btn i { margin-right: 6px; }

.page-card {
  width: 100%;
  padding: 28px 34px 38px;
  border-radius: var(--radius);
}

.wide-view { max-width: 1180px; margin: 0 auto; }

.back-btn { margin-bottom: 17px; }

.dashboard-card { max-width: 900px; margin: 0 auto; }

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-logo {
  width: 155px;
}

.logout-btn { white-space: nowrap; }

.dashboard-welcome {
  text-align: center;
  margin: 8px 0 30px;
}

.dashboard-welcome span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
}

.dashboard-welcome h1,
.page-heading h1,
.section-heading h1 {
  margin: 4px 0 3px;
  font-family: "Cormorant Garamond", serif;
  color: var(--olive);
  font-size: 36px;
  line-height: 1.05;
}

.dashboard-welcome p,
.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.dashboard-option {
  min-height: 180px;
  padding: 25px 18px;
  border: 1px solid rgba(48,48,16,.13);
  border-radius: 19px;
  color: var(--olive);
  background: rgba(255,255,255,.38);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
}

.dashboard-option:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,.62);
  border-color: rgba(176,112,16,.35);
  box-shadow: 0 15px 35px rgba(48,48,16,.10);
}

.dashboard-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--cream-light);
  background: var(--olive);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.08);
}

.dashboard-icon i { color: var(--gold-light); font-size: 23px; }

.dashboard-option strong {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
}

.dashboard-option small {
  max-width: 240px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.page-heading {
  text-align: center;
  margin: 0 auto 28px;
}

.page-logo {
  width: 150px;
  margin: 0 auto 7px;
}

.page-heading > span { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: 3px; }
.page-heading h1 { font-size: 31px; }

.form-section {
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px solid rgba(48,48,16,.10);
}

.section-title { margin-bottom: 17px; }
.section-title h2 {
  margin: 4px 0 0;
  color: var(--olive);
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
}

.invoice-meta-grid,
.country-grid,
.date-range-grid,
.report-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.three-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 18px;
}

.country-inline-field {
  max-width: 420px;
  margin-top: 4px;
}

.field-help {
  display: block;
  margin-top: -9px;
  color: var(--muted);
  font-size: 9px;
}

.phone-input {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 7px;
  margin-bottom: 17px;
}

.phone-input input { min-width: 0; }

.same-address-row {
  margin: -2px 0 18px;
}

.product-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(48,48,16,.13);
  border-radius: 15px;
  background: rgba(255,255,255,.32);
}

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

.invoice-product-table th,
.invoice-product-table td {
  padding: 10px 9px;
  border-bottom: 1px solid rgba(48,48,16,.10);
  text-align: left;
  vertical-align: middle;
}

.invoice-product-table th {
  color: var(--cream-light);
  background: var(--olive);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.invoice-product-table td {
  font-size: 11px;
}

.invoice-product-table tr:last-child td { border-bottom: 0; }

.invoice-product-table th:first-child,
.invoice-product-table td:first-child {
  width: 48px;
  text-align: center;
}

.invoice-product-table th:nth-child(3),
.invoice-product-table td:nth-child(3) { width: 90px; }

.invoice-product-table th:nth-child(4),
.invoice-product-table td:nth-child(4),
.invoice-product-table th:nth-child(5),
.invoice-product-table td:nth-child(5) { width: 125px; }

.product-row-input,
.product-row-select {
  width: 100%;
  height: 38px;
  padding: 0 9px;
  border: 1px solid rgba(48,48,16,.13);
  border-radius: 9px;
  outline: none;
  color: var(--olive);
  background: rgba(255,255,255,.55);
  font-size: 11px;
}

.product-row-select { appearance: auto; }

.product-total {
  font-weight: 800;
  white-space: nowrap;
}

.row-remove {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: var(--danger);
  background: rgba(139,63,50,.08);
}

.payment-summary-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.invoice-summary-box {
  padding: 16px 18px;
  border-radius: 15px;
  background: rgba(255,255,255,.46);
  border: 1px solid rgba(48,48,16,.12);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 36px;
  color: var(--olive);
  font-size: 12px;
}

.summary-row strong { font-weight: 800; }
.summary-divider { height: 1px; margin: 7px 0; background: rgba(48,48,16,.12); }

.summary-row.total-row {
  padding-top: 4px;
  font-size: 16px;
  font-weight: 800;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 22px;
}

.section-heading h1 { font-size: 31px; }

.search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.search-wrap > i {
  position: absolute;
  left: 14px;
  top: 15px;
  color: var(--gold);
}

.search-wrap input {
  height: 47px;
  padding: 0 42px;
}

.clear-search {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 33px;
  height: 33px;
  border: 0;
  border-radius: 8px;
  color: var(--olive);
  background: transparent;
}

.invoice-list,
.report-list,
.expense-list {
  display: grid;
  gap: 11px;
}

.invoice-item,
.report-item,
.expense-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(48,48,16,.12);
  border-radius: 15px;
  background: rgba(255,255,255,.36);
}

.invoice-name,
.report-name,
.expense-name {
  margin: 0 0 5px;
  color: var(--olive);
  font-family: "Cormorant Garamond", serif;
  font-size: 21px;
  font-weight: 700;
}

.invoice-meta,
.report-meta,
.expense-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 15px;
  color: var(--muted);
  font-size: 10px;
}

.invoice-meta i,
.report-meta i,
.expense-meta i { color: var(--gold); margin-right: 4px; }

.invoice-actions,
.report-actions,
.expense-actions {
  display: flex;
  gap: 7px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  color: var(--olive);
  background: rgba(255,255,255,.52);
}

.icon-btn:hover { background: var(--cream-gold); }
.icon-btn.delete:hover { color: #fff; background: var(--danger); }

.invoice-amount,
.report-amount,
.expense-amount {
  margin-bottom: 7px;
  color: var(--olive);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.invoice-number {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.period-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 3px 0 10px;
  scrollbar-width: thin;
}

.period-tab {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid rgba(48,48,16,.13);
  border-radius: 20px;
  color: var(--olive);
  background: rgba(255,255,255,.38);
  font-size: 10px;
  font-weight: 800;
}

.period-tab.active {
  color: var(--cream-light);
  background: var(--olive);
  border-color: var(--olive);
}

.date-range-grid {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  margin-top: 7px;
}

.apply-filter-btn {
  min-width: 100px;
  margin-bottom: 17px;
}

.report-filters { margin-top: 2px; }

.report-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 3px 0 18px;
}

.report-stat {
  padding: 17px;
  border-radius: 14px;
  border: 1px solid rgba(48,48,16,.11);
  background: rgba(255,255,255,.42);
}

.report-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 4px;
}

.report-stat strong {
  color: var(--olive);
  font-family: "Cormorant Garamond", serif;
  font-size: 27px;
}

.country-report-card {
  margin-bottom: 18px;
  padding: 17px;
  border-radius: 15px;
  border: 1px solid rgba(48,48,16,.11);
  background: rgba(255,255,255,.34);
}

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

.country-breakdown-item {
  padding: 12px;
  border-radius: 11px;
  background: rgba(240,224,176,.48);
}

.country-breakdown-item span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.country-breakdown-item strong {
  display: block;
  margin-top: 3px;
  color: var(--olive);
  font-size: 13px;
}

.expense-form-panel {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid rgba(48,48,16,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.32);
}

.expense-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr 1fr;
  gap: 16px;
}

.expense-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.expense-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 0 0 18px;
  padding: 17px;
  border-radius: 14px;
  border: 1px solid rgba(176,112,16,.20);
  background: rgba(240,224,176,.40);
}

.expense-summary span { color: var(--muted); font-size: 11px; }
.expense-summary strong { color: var(--olive); font-size: 21px; }

.empty-state {
  padding: 42px 15px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.empty-state i {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 32px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  z-index: 100;
  max-width: min(92vw, 460px);
  padding: 12px 17px;
  border-radius: 12px;
  color: var(--olive);
  background: rgba(255,250,242,.94);
  border: 1px solid rgba(48,48,16,.14);
  box-shadow: 0 18px 45px rgba(48,48,16,.18);
  backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 700;
  transform: translate(-50%, 120px);
  opacity: 0;
  transition: .25s ease;
  pointer-events: none;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.success { border-color: rgba(48,48,16,.28); }
.toast.error { color: #7d3025; border-color: rgba(139,63,50,.35); }

/* =========================================================
   A4 INVOICE PRINT
   Matches the supplied reference composition:
   logo/header -> invoice heading -> bill/ship -> product table
   -> payment details -> totals -> thank-you footer.
   ========================================================= */

#printRoot { display: none; }

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    width: 210mm;
    min-height: 297mm;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body > *:not(#printRoot) { display: none !important; }

  #printRoot {
    display: block !important;
    width: 210mm !important;
  }

  .invoice-print-page {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    padding: 13mm 12mm 11mm;
    overflow: hidden;
    color: #303010;
    background: #f8f3ea;
    font-family: "Montserrat", Arial, sans-serif;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-leaf {
    position: absolute;
    color: rgba(48,48,16,.10);
    font-size: 80px;
    line-height: 1;
  }

  .print-leaf.top-right { top: -5mm; right: -2mm; transform: rotate(25deg); }
  .print-leaf.bottom-left { bottom: -4mm; left: -3mm; transform: rotate(-25deg); }

  .print-header {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 8mm;
    align-items: center;
    padding-bottom: 7mm;
    border-bottom: .35mm solid rgba(48,48,16,.22);
  }

  .print-brand img {
    width: 52mm;
    max-height: 25mm;
    object-fit: contain;
    object-position: left center;
  }

  .print-company {
    padding-left: 5mm;
    border-left: .35mm solid rgba(48,48,16,.25);
  }

  .print-company p {
    margin: 0 0 2.2mm;
    font-size: 8.5pt;
    line-height: 1.35;
  }

  .print-company i {
    width: 4mm;
    margin-right: 2mm;
    color: #b07010;
  }

  .print-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8mm;
    margin: 7mm 0 5mm;
  }

  .print-title {
    margin: 0;
    color: #303010;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 31pt;
    line-height: .9;
    letter-spacing: 5px;
  }

  .print-meta {
    min-width: 58mm;
    font-size: 8.5pt;
  }

  .print-meta-row {
    display: grid;
    grid-template-columns: 24mm 4mm 1fr;
    gap: 1mm;
    margin: 0 0 2mm;
  }

  .print-meta-row strong { font-weight: 700; }
  .print-meta-row span:last-child {
    border-bottom: .25mm solid #777;
    padding-bottom: .7mm;
  }

  .print-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
    margin-bottom: 6mm;
  }

  .print-party {
    min-height: 31mm;
    padding: 5mm;
    border-radius: 3mm;
    background: #f0e0d0;
  }

  .print-party h3 {
    margin: 0 0 3.5mm;
    color: #303010;
    font-size: 9.5pt;
    letter-spacing: 2.2px;
  }

  .print-party p {
    margin: 0 0 1.7mm;
    font-size: 8pt;
    line-height: 1.35;
  }

  .print-party strong {
    display: inline-block;
    width: 16mm;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 6mm;
  }

  .print-table th {
    padding: 3mm 2mm;
    color: #fffaf2;
    background: #626b48;
    font-size: 7.7pt;
    letter-spacing: 1.3px;
    text-transform: uppercase;
  }

  .print-table td {
    height: 9mm;
    padding: 2.3mm 2mm;
    border: .2mm solid rgba(48,48,16,.24);
    font-size: 7.8pt;
    vertical-align: middle;
  }

  .print-table th:nth-child(1), .print-table td:nth-child(1) { width: 10%; text-align: center; }
  .print-table th:nth-child(2), .print-table td:nth-child(2) { width: 45%; }
  .print-table th:nth-child(3), .print-table td:nth-child(3) { width: 12%; text-align: center; }
  .print-table th:nth-child(4), .print-table td:nth-child(4) { width: 16%; text-align: right; }
  .print-table th:nth-child(5), .print-table td:nth-child(5) { width: 17%; text-align: right; }

  .print-bottom {
    display: grid;
    grid-template-columns: 1.12fr .88fr;
    gap: 6mm;
    align-items: start;
  }

  .print-payment {
    min-height: 38mm;
    padding: 5mm;
    border-radius: 3mm;
    background: #f0e0d0;
  }

  .print-payment h3 {
    margin: 0 0 4mm;
    font-size: 9.5pt;
    letter-spacing: 2.2px;
  }

  .print-payment p {
    margin: 0 0 2.4mm;
    font-size: 8.3pt;
  }

  .print-check {
    display: inline-flex;
    align-items: center;
    gap: 2mm;
    margin-right: 7mm;
  }

  .print-check-box {
    width: 4mm;
    height: 4mm;
    border: .35mm solid #626b48;
    background: #fff;
  }

  .print-totals {
    border: .2mm solid rgba(48,48,16,.22);
    border-radius: 2.5mm;
    overflow: hidden;
  }

  .print-total-row {
    display: grid;
    grid-template-columns: 1fr 30mm;
    min-height: 9mm;
    border-bottom: .2mm solid rgba(48,48,16,.22);
  }

  .print-total-row:last-child { border-bottom: 0; }

  .print-total-row > span {
    padding: 2.5mm 3mm;
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: 1px;
  }

  .print-total-row > strong {
    padding: 2.5mm 3mm;
    text-align: right;
    font-size: 8pt;
    font-weight: 800;
  }

  .print-total-row.grand {
    color: #fffaf2;
    background: #626b48;
  }

  .print-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8mm;
    margin-top: 8mm;
    padding-top: 5mm;
    border-top: .35mm solid rgba(48,48,16,.16);
  }

  .print-thanks {
    font-family: "Allura", cursive;
    color: #303010;
    font-size: 29pt;
    line-height: .9;
  }

  .print-footer-caption {
    margin-top: 2mm;
    color: #b07010;
    font-size: 7pt;
    letter-spacing: 3px;
  }

  .print-footer-brand {
    text-align: right;
    color: #626b48;
    font-size: 7pt;
    letter-spacing: 1.5px;
    line-height: 1.6;
  }
}

@media (max-width: 760px) {
  .admin-app { padding: 14px 10px 28px; }

  .auth-view { min-height: calc(100vh - 28px); }
  .auth-card { padding: 28px 20px 24px; }

  .page-card { padding: 18px 16px 28px; border-radius: 19px; }

  .dashboard-top { align-items: flex-start; }
  .dashboard-logo { width: 125px; }
  .dashboard-grid { grid-template-columns: 1fr; }

  .invoice-meta-grid,
  .country-grid,
  .three-grid,
  .report-filters,
  .date-range-grid,
  .payment-summary-section,
  .expense-grid {
    grid-template-columns: 1fr;
  }

  .country-inline-field { max-width: none; }

  .section-heading,
  .section-title-row {
    align-items: flex-start;
  }

  .section-heading {
    flex-direction: column;
  }

  .section-heading .compact-btn,
  .section-title-row .compact-btn {
    width: 100%;
  }

  .date-range-grid { gap: 0; }
  .apply-filter-btn { width: 100%; margin-bottom: 8px; }

  .report-summary-grid,
  .country-breakdown {
    grid-template-columns: 1fr;
  }

  .invoice-item,
  .report-item,
  .expense-item {
    grid-template-columns: 1fr;
  }

  .invoice-actions,
  .report-actions,
  .expense-actions {
    justify-content: flex-end;
  }

  .form-actions { grid-template-columns: 1fr; }

  .expense-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .auth-heading h1 { font-size: 34px; }
  .dashboard-welcome h1,
  .page-heading h1,
  .section-heading h1 { font-size: 27px; }

  .phone-input { grid-template-columns: 98px 1fr; }
  .expense-form-actions { grid-template-columns: 1fr; }
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #b9852d;
    border-radius: 8px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: #9f7025;
}

/* =========================================================
   INVOICE CHANGES
   ========================================================= */

.date-picker-wrap {
  position: relative;
  margin-bottom: 17px;
}

.date-picker-wrap > #invoiceDate {
  width: 100%;
  height: 46px;
  padding: 0 48px 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.date-picker-wrap > #invoiceDate:focus {
  border-color: rgba(176,112,16,.62);
  box-shadow: 0 0 0 3px rgba(176,112,16,.10);
  background: rgba(255,255,255,.72);
}

.date-picker-button {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: var(--gold);
  background: transparent;
}

.native-date-picker {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden;
}

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

.payment-values-grid .input-wrap {
  margin-bottom: 0;
}

.discount-summary-row {
  align-items: center;
}

.discount-input-wrap {
  width: min(220px, 45%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.discount-currency {
  color: var(--olive);
  font-weight: 800;
  white-space: nowrap;
}

.discount-input-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--input-bg);
}

.discount-input-wrap input:focus {
  border-color: rgba(176,112,16,.62);
  box-shadow: 0 0 0 3px rgba(176,112,16,.10);
}

.invoice-product-table th:nth-child(2) { min-width: 260px; }
.invoice-product-table th:nth-child(3) { min-width: 115px; }

.invoice-product-table .size-select {
  min-width: 90px;
}

@media (max-width: 800px) {
  .payment-values-grid {
    grid-template-columns: 1fr;
  }
}



.payment-values-card { width: 100%; }

@media (max-width: 900px) {
  .payment-values-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .payment-values-grid { grid-template-columns: 1fr; }
  .discount-input-wrap { width: min(220px, 55%); }
}


/* Invoice details read-only view */
.invoice-item-clickable { cursor: pointer; }
.invoice-item-clickable:focus-visible {
  outline: 2px solid rgba(176,112,16,.55);
  outline-offset: 2px;
}
.invoice-phone-link {
  color: inherit;
  text-decoration: none;
}
.invoice-phone-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

body.invoice-view-open { overflow: hidden; }

.invoice-view-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.invoice-view-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(48,48,16,.48);
  backdrop-filter: blur(5px);
}
.invoice-view-card {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  max-height: min(92vh, 900px);
  overflow: auto;
  padding: 25px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid rgba(48,48,16,.14);
  box-shadow: 0 28px 80px rgba(48,48,16,.28);
}
.invoice-view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}
.invoice-view-header h2 {
  margin: 4px 0 0;
  color: var(--olive);
  font-family: "Cormorant Garamond", serif;
  font-size: 29px;
}
.invoice-view-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.invoice-view-meta > div,
.invoice-view-parties > section,
.invoice-view-payments {
  padding: 15px;
  border-radius: 14px;
  border: 1px solid rgba(48,48,16,.12);
  background: rgba(240,224,208,.48);
}
.invoice-view-meta span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 4px;
}
.invoice-view-meta strong { font-size: 12px; }
.invoice-view-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.invoice-view-parties h3,
.invoice-view-payments h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 1.5px;
}
.invoice-view-parties p {
  margin: 7px 0;
  font-size: 11px;
  line-height: 1.45;
}
.invoice-view-parties p strong {
  display: inline-block;
  width: 70px;
}
.invoice-view-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
  border: 1px solid rgba(48,48,16,.12);
  border-radius: 13px;
}
.invoice-view-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}
.invoice-view-table th,
.invoice-view-table td {
  padding: 9px;
  border-bottom: 1px solid rgba(48,48,16,.10);
  font-size: 10px;
  text-align: left;
}
.invoice-view-table th {
  color: var(--cream-light);
  background: var(--olive);
  text-transform: uppercase;
  letter-spacing: .7px;
}
.invoice-view-table th:nth-child(1),
.invoice-view-table td:nth-child(1),
.invoice-view-table th:nth-child(3),
.invoice-view-table td:nth-child(3),
.invoice-view-table th:nth-child(4),
.invoice-view-table td:nth-child(4) { text-align: center; }
.invoice-view-table th:nth-child(4),
.invoice-view-table td:nth-child(4) { width: 55px; }
.invoice-view-summary {
  width: min(100%, 410px);
  margin-left: auto;
  border: 1px solid rgba(48,48,16,.12);
  border-radius: 13px;
  overflow: hidden;
  margin-bottom: 16px;
}
.invoice-view-summary > div,
.invoice-view-payments > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 12px;
  font-size: 11px;
  border-bottom: 1px solid rgba(48,48,16,.10);
}
.invoice-view-summary .grand,
.invoice-view-payments .balance {
  color: var(--cream-light);
  background: var(--olive);
  font-weight: 800;
}
.invoice-view-payments {
  margin-bottom: 18px;
}
.invoice-view-payments > div:last-child { border-bottom: 0; }
.invoice-view-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 650px) {
  .invoice-view-card { padding: 18px; }
  .invoice-view-meta,
  .invoice-view-parties { grid-template-columns: 1fr; }
  .invoice-view-actions { grid-template-columns: 1fr; }
}
