:root {
  --green-950: #073a2c;
  --green-900: #084936;
  --green-800: #0b5a42;
  --green-700: #0f6a4f;
  --green-600: #15805f;
  --green-100: #dff4ec;
  --green-50: #f0faf6;
  --ink: #17312a;
  --muted: #71817b;
  --line: #dbe5e1;
  --panel: #ffffff;
  --bg: #f4f7f6;
  --danger: #b94a48;
  --warning: #b7791f;
  --shadow: 0 14px 35px rgba(25, 62, 50, .08);
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Tahoma, Arial, "Noto Sans Arabic", sans-serif;
  line-height: 1.6;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .9rem; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  width: 282px;
  min-height: 100vh;
  padding: 22px 18px;
  background: linear-gradient(180deg, var(--green-950), var(--green-800));
  color: #fff;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: -16px 0 35px rgba(7, 58, 44, .12);
}
.brand-card {
  background: rgba(255,255,255,.97);
  border-radius: 20px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.brand-logo { width: 105px; height: 56px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.4; }
.brand-copy strong { font-size: .95rem; }
.brand-copy span { color: var(--muted); font-size: .73rem; }
.prototype-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  color: #dff8ed;
  font-size: .78rem;
  text-align: center;
}
.nav-list { display: grid; gap: 7px; }
.nav-item {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.82);
  min-height: 48px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 13px;
  text-align: right;
  transition: .18s ease;
}
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.14); transform: translateX(-2px); }
.nav-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.08); }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; }
.role-card {
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.role-card span { display: grid; }
.role-card small { color: #bfe7d7; }
.role-card select { border: 0; border-radius: 9px; padding: 7px 9px; background: #fff; color: var(--green-900); }
.sidebar-footer p { margin: 0; color: rgba(255,255,255,.62); font-size: .75rem; }

.main-content { margin-right: 282px; min-height: 100vh; }
.topbar {
  min-height: 88px;
  padding: 16px 34px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar-title, .topbar-actions, .user-chip { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 1.45rem; }
.eyebrow { margin: 0 0 2px; color: var(--green-600); font-size: .76rem; font-weight: 700; letter-spacing: .02em; }
.date-pill { background: var(--green-50); color: var(--green-800); border: 1px solid #d4ede4; padding: 9px 12px; border-radius: 12px; font-size: .82rem; }
.user-chip { padding: 7px 9px; border: 1px solid var(--line); background: #fff; border-radius: 14px; }
.user-chip div { display: grid; line-height: 1.35; }
.user-chip small { color: var(--muted); font-size: .73rem; }
.user-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--green-100); color: var(--green-800); font-weight: 800; }
.mobile-menu { display: none; border: 0; background: var(--green-50); color: var(--green-800); border-radius: 10px; padding: 7px 10px; }

.view { display: none; padding: 28px 34px 45px; }
.view.active { display: block; }
.hero-card {
  padding: 30px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.17), transparent 30%),
    linear-gradient(135deg, var(--green-950), var(--green-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-card h2 { margin: 7px 0 8px; max-width: 780px; font-size: clamp(1.5rem, 2.4vw, 2.2rem); line-height: 1.4; }
.hero-card p { margin: 0; color: rgba(255,255,255,.78); max-width: 780px; }
.hero-kicker { font-size: .8rem; color: #bce8d5; font-weight: 700; }

.primary-btn, .secondary-btn, .text-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 15px;
  font-weight: 700;
  transition: .16s ease;
}
.primary-btn { background: var(--green-700); color: #fff; box-shadow: 0 8px 18px rgba(15,106,79,.18); }
.hero-card .primary-btn { background: #fff; color: var(--green-900); white-space: nowrap; }
.primary-btn:hover { transform: translateY(-1px); background: var(--green-800); }
.hero-card .primary-btn:hover { background: var(--green-50); }
.secondary-btn { background: #fff; color: var(--green-800); border: 1px solid #cfe3db; }
.secondary-btn:hover { background: var(--green-50); }
.text-btn { color: var(--green-700); background: transparent; padding-inline: 0; }
.danger-btn { border: 0; background: #fff0ef; color: var(--danger); border-radius: 9px; padding: 7px 10px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 9px; color: var(--ink); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-top: 18px; }
.stat-card {
  background: var(--panel);
  border: 1px solid #e4ece9;
  border-radius: var(--radius-lg);
  padding: 19px;
  box-shadow: 0 8px 25px rgba(33, 73, 60, .045);
}
.stat-card > span { color: var(--muted); font-size: .86rem; }
.stat-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .86rem; }
.stat-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); }
.stat-card strong { display: inline-block; margin: 10px 0 0; font-size: 1.8rem; color: var(--green-950); }
.stat-card small { color: var(--muted); margin-right: 5px; }
.stat-foot { margin-top: 8px; color: var(--muted); font-size: .76rem; }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-top: 16px; }
.dashboard-grid.second-row { grid-template-columns: 1fr 1fr; }
.panel { background: #fff; border: 1px solid #e2ebe7; border-radius: var(--radius-lg); padding: 20px; box-shadow: 0 8px 25px rgba(33,73,60,.04); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel-head h3, .panel h3 { margin: 0; }
.panel-head > div > h3 { margin-top: 2px; }

.bar-chart { height: 230px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 10px; padding-top: 15px; }
.bar-col { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.bar-track { height: 180px; width: 100%; max-width: 50px; background: #edf4f1; border-radius: 14px; display: flex; align-items: flex-end; overflow: hidden; }
.bar-fill { width: 100%; min-height: 3px; background: linear-gradient(180deg, #32a07b, var(--green-700)); border-radius: 14px; transition: height .2s ease; }
.bar-value { font-size: .72rem; color: var(--green-800); font-weight: 700; }
.bar-label { font-size: .72rem; color: var(--muted); white-space: nowrap; }

.activity-list, .summary-list, .cards-list { display: grid; gap: 10px; }
.activity-item, .summary-item, .shipment-card {
  border: 1px solid #e4ece9;
  background: #fbfdfc;
  border-radius: 14px;
  padding: 12px 13px;
}
.activity-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.activity-item div { min-width: 0; }
.activity-item strong { display: block; }
.activity-item span, .activity-item small { color: var(--muted); font-size: .78rem; }
.activity-metric { text-align: left; white-space: nowrap; }
.summary-item { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.summary-item span { color: var(--muted); }
.summary-item strong { color: var(--green-900); }
.empty-state { border: 1px dashed #cddbd5; border-radius: 14px; padding: 24px; text-align: center; color: var(--muted); background: #fbfdfc; }

.section-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.section-intro h2 { margin: 2px 0 5px; font-size: 1.55rem; }
.section-intro p { margin: 0; color: var(--muted); max-width: 780px; }
.status-chip { background: #eef8f4; color: var(--green-700); border: 1px solid #d5ebe2; padding: 8px 11px; border-radius: 999px; font-size: .78rem; }
.form-layout { display: grid; gap: 15px; }
.form-panel { padding: 21px; }
.title-with-step { display: flex; align-items: center; gap: 10px; }
.step-number { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); font-weight: 800; font-size: .75rem; }
.form-grid { display: grid; gap: 13px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
label { display: grid; gap: 6px; color: #3d514a; font-size: .82rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d6e1dd;
  border-radius: 11px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: #72b69d; box-shadow: 0 0 0 3px rgba(21,128,95,.08); }
.full-label { margin-top: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-actions.inside-form { margin-top: 14px; }
.inline-total { margin-top: 12px; border-radius: 12px; background: var(--green-50); padding: 10px 12px; color: var(--green-800); text-align: left; }

.data-table { width: 100%; border-collapse: collapse; min-width: 730px; }
.data-table th, .data-table td { border-bottom: 1px solid #e7eeeb; padding: 11px 10px; text-align: right; vertical-align: middle; font-size: .82rem; }
.data-table th { color: #65756f; font-weight: 700; background: #fbfcfc; }
.data-table tbody tr:hover { background: #fbfdfc; }
.data-table tfoot td { background: var(--green-50); font-weight: 800; color: var(--green-900); }
.compact-table input { min-width: 130px; }
.table-scroll { overflow-x: auto; }
.table-panel { margin-top: 16px; }
.action-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.search-input { width: 250px; }
.search-input.wide { width: min(430px, 100%); }

.calc-card { margin-top: 17px; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.calc-card > div { background: #f7faf9; border: 1px solid #e1ebe7; border-radius: 14px; padding: 14px; display: grid; gap: 4px; }
.calc-card span { color: var(--muted); font-size: .76rem; }
.calc-card strong { color: var(--green-900); font-size: 1.08rem; }
.calc-card .calc-highlight { background: linear-gradient(135deg, var(--green-50), #e2f5ed); border-color: #cbe8dd; }
.calculation-note { margin: 10px 0 0; color: var(--muted); font-size: .8rem; }
.remove-row { border: 0; border-radius: 9px; background: #fff0ef; color: var(--danger); padding: 7px 9px; }

.split-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.inbound-kpis { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.kpi-mini { border: 1px solid #e4ece9; border-radius: 15px; padding: 15px; background: #fbfdfc; }
.kpi-mini span { color: var(--muted); font-size: .78rem; }
.kpi-mini strong { display: block; margin-top: 4px; color: var(--green-900); font-size: 1.35rem; }

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.product-card { background: #fff; border: 1px solid #e1ebe7; border-radius: 20px; padding: 20px; box-shadow: 0 8px 25px rgba(33,73,60,.04); }
.product-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.product-card h3 { margin: 0 0 4px; }
.product-card p { margin: 0; color: var(--muted); font-size: .8rem; }
.product-formula { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 15px; }
.product-formula div { background: #f7faf9; border-radius: 12px; padding: 11px; text-align: center; }
.product-formula span { display: block; color: var(--muted); font-size: .7rem; }
.product-formula strong { color: var(--green-900); }
.product-weight { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--green-50); color: var(--green-800); font-weight: 700; }

.report-controls { margin-bottom: 14px; }
.report-filter { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.report-filter label { min-width: 180px; }
.report-stats { margin-top: 0; margin-bottom: 16px; }
.report-print-head { display: none; }
.report-section { margin-top: 22px; }
.report-section h4 { margin: 0 0 10px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.monthly-reconciliation { margin-top: 16px; }
.month-picker { display: flex; align-items: center; gap: 8px; grid-template-columns: auto 160px; }
.reconcile-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.reconcile-card { border: 1px solid #e1ebe7; border-radius: 16px; padding: 16px; background: #fbfdfc; }
.reconcile-card span { color: var(--muted); font-size: .78rem; }
.reconcile-card strong { display: block; margin-top: 5px; font-size: 1.4rem; color: var(--green-900); }
.reconcile-card small { color: var(--muted); }
.info-note { margin: 13px 0 0; border-right: 3px solid #d09d3d; background: #fff9eb; padding: 10px 12px; color: #7a622e; border-radius: 8px; font-size: .8rem; }

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 100;
  background: #17372d;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s ease;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .form-grid.cols-5 { grid-template-columns: repeat(3,1fr); }
  .calc-card { grid-template-columns: repeat(3,1fr); }
  .reconcile-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(110%); transition: .2s ease; width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .mobile-menu { display: inline-block; }
  .topbar { padding: 14px 18px; }
  .view { padding: 22px 18px 38px; }
  .dashboard-grid, .dashboard-grid.second-row, .split-layout { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .form-grid.cols-4, .form-grid.cols-5 { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 620px) {
  .topbar-actions .date-pill { display: none; }
  .user-chip { display: none; }
  .topbar { gap: 8px; padding: 12px; }
  .topbar-actions { gap: 6px; }
  .topbar h1 { font-size: 1.1rem; }
  .logout-btn { padding: 7px 9px; font-size: .82rem; }
  .hero-card, .section-intro { align-items: stretch; flex-direction: column; }
  .hero-card .primary-btn { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4, .form-grid.cols-5 { grid-template-columns: 1fr; }
  .calc-card { grid-template-columns: repeat(2,1fr); }
  .calc-card .calc-highlight { grid-column: 1 / -1; }
  .product-formula { grid-template-columns: repeat(2,1fr); }
  .reconcile-grid { grid-template-columns: 1fr; }
  .inbound-kpis { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
  .form-actions > button { flex: 1; }
  .panel { padding: 16px; }
  .search-input { width: 100%; }
  .panel-head { align-items: stretch; flex-direction: column; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .section-intro, .report-controls, .report-stats, .monthly-reconciliation, .button-row { display: none !important; }
  .main-content { margin: 0; }
  .view { display: none !important; padding: 0; }
  #view-reports { display: block !important; }
  #printableWeeklyReport { display: block; box-shadow: none; border: 0; padding: 0; }
  .report-print-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #0f6a4f; padding-bottom: 12px; margin-bottom: 18px; }
  .report-print-head img { width: 110px; height: 60px; object-fit: contain; }
  .report-print-head h3 { margin: 0; }
  .report-print-head p { margin: 4px 0 0; color: #666; }
  .table-scroll { overflow: visible; }
  .data-table { min-width: 0; }
  .data-table th, .data-table td { font-size: 10px; padding: 7px 5px; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* v3 — day/night themes, nylon section and subtle motion */
:root {
  --surface-soft: #fbfdfc;
  --surface-elevated: #ffffff;
}

.brand-logo,
.auth-logo,
.report-print-head img {
  filter: sepia(1) saturate(4.5) hue-rotate(90deg) brightness(.68) contrast(1.05);
  transition: filter .25s ease, transform .25s ease;
}
.brand-card:hover .brand-logo { transform: scale(1.035); }

.theme-toggle {
  border: 1px solid #cfe3db;
  background: #fff;
  color: var(--green-900);
  border-radius: 13px;
  min-height: 42px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(15,106,79,.06);
  transition: transform .18s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.theme-toggle:hover { transform: translateY(-1px) rotate(-1deg); background: var(--green-50); }
.theme-toggle-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green-100);
  font-size: 1rem;
}
.theme-toggle-text { font-size: .78rem; }

.material-panel {
  position: relative;
  overflow: hidden;
  border-color: #cfe8dd;
}
.material-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-800), #59b693, transparent);
}
.material-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid #d3e9e0;
  font-size: .72rem;
  font-weight: 800;
}

.panel,
.stat-card,
.product-card,
.hero-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .25s ease, color .25s ease;
}
.panel:hover,
.product-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(23,71,55,.075); }
.stat-card:hover { transform: translateY(-2px); border-color: #cfe4db; }

.view.active > * { animation: salimaRise .32s ease both; }
.view.active > *:nth-child(2) { animation-delay: .035s; }
.view.active > *:nth-child(3) { animation-delay: .07s; }
.view.active > *:nth-child(4) { animation-delay: .105s; }
@keyframes salimaRise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

html[data-theme="night"] {
  color-scheme: dark;
  --green-950: #e4fff4;
  --green-900: #cef6e6;
  --green-800: #b8ebd7;
  --green-700: #8ad5b7;
  --green-600: #72c9a7;
  --green-100: #174f3e;
  --green-50: #123f32;
  --ink: #effbf6;
  --muted: #a8c7bb;
  --line: #2b5b49;
  --panel: #0f3f31;
  --bg: #082d24;
  --surface-soft: #103b30;
  --surface-elevated: #104535;
  --shadow: 0 16px 38px rgba(0,0,0,.18);
}
html[data-theme="night"] body {
  background:
    radial-gradient(circle at 15% 10%, rgba(71,166,129,.12), transparent 28%),
    linear-gradient(180deg, #082d24 0%, #0a3529 100%);
}
html[data-theme="night"] .sidebar {
  background: linear-gradient(180deg, #05271f, #0a4635);
  box-shadow: -16px 0 35px rgba(0,0,0,.2);
}
html[data-theme="night"] .brand-card {
  background: rgba(240,255,248,.96);
  color: #17312a;
}
html[data-theme="night"] .brand-copy span { color: #5f766d; }
html[data-theme="night"] .topbar {
  background: rgba(8,45,36,.9);
  border-color: #235644;
}
html[data-theme="night"] .panel,
html[data-theme="night"] .stat-card,
html[data-theme="night"] .product-card,
html[data-theme="night"] .user-chip {
  background: var(--panel);
  border-color: #2b5b49;
}
html[data-theme="night"] .activity-item,
html[data-theme="night"] .summary-item,
html[data-theme="night"] .shipment-card,
html[data-theme="night"] .kpi-mini,
html[data-theme="night"] .reconcile-card,
html[data-theme="night"] .calc-card > div,
html[data-theme="night"] .product-formula div,
html[data-theme="night"] .empty-state {
  background: var(--surface-soft);
  border-color: #2b5b49;
}
html[data-theme="night"] input,
html[data-theme="night"] select,
html[data-theme="night"] textarea,
html[data-theme="night"] .secondary-btn,
html[data-theme="night"] .icon-btn,
html[data-theme="night"] .theme-toggle {
  background: #123f32;
  color: #effbf6;
  border-color: #346854;
}
html[data-theme="night"] input::placeholder,
html[data-theme="night"] textarea::placeholder { color: #7ca596; }
html[data-theme="night"] .data-table th { background: #103b30; color: #b4d2c7; }
html[data-theme="night"] .data-table th,
html[data-theme="night"] .data-table td { border-color: #295544; }
html[data-theme="night"] .data-table tbody tr:hover { background: #123f32; }
html[data-theme="night"] .date-pill,
html[data-theme="night"] .status-chip,
html[data-theme="night"] .material-badge,
html[data-theme="night"] .inline-total,
html[data-theme="night"] .product-weight { border-color: #346854; }
html[data-theme="night"] .info-note {
  background: #3a3219;
  color: #f1d995;
  border-right-color: #d9ae47;
}
html[data-theme="night"] .hero-card {
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.12), transparent 30%),
    linear-gradient(135deg, #05271f, #12664c);
}
html[data-theme="night"] .hero-card h2,
html[data-theme="night"] .hero-card p,
html[data-theme="night"] .hero-kicker { color: #f4fff9; }
html[data-theme="night"] .primary-btn { color: #05271f; background: #a9e7cf; }
html[data-theme="night"] .primary-btn:hover { background: #c2f3df; }
html[data-theme="night"] .hero-card .primary-btn { background: #effbf6; color: #0a4635; }
html[data-theme="night"] .danger-btn { background: #562d2d; color: #ffb5b1; }

@media (max-width: 620px) {
  .theme-toggle-text { display: none; }
  .theme-toggle { padding: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html[data-theme="night"] label { color: #d9eee6; }
html[data-theme="night"] .bar-track { background: #153f33; }
html[data-theme="night"] .bar-label { color: #a8c7bb; }
html[data-theme="night"] .calculation-note { color: #a8c7bb; }

/* Cloud authentication */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 20%, rgba(23, 121, 88, .14), transparent 34%),
    linear-gradient(145deg, #f6fbf8 0%, #edf7f2 100%);
}
.auth-card {
  width: min(100%, 460px);
  background: rgba(255,255,255,.96);
  border: 1px solid #d7e6df;
  border-radius: 28px;
  padding: 34px;
  box-shadow: 0 28px 70px rgba(16, 76, 57, .13);
  text-align: center;
  animation: salimaRise .4s ease both;
}
.auth-logo { width: 150px; height: auto; margin: 0 auto 18px; display: block; }
.auth-card h1 { margin: 5px 0 8px; color: #0d4f3c; }
.auth-card > p { color: var(--muted); margin: 0 0 24px; }
.auth-form { display: grid; gap: 15px; text-align: right; }
.auth-form label { display: grid; gap: 7px; font-weight: 700; }
.auth-form .primary-btn { width: 100%; justify-content: center; margin-top: 4px; }
.auth-message { margin-top: 16px; min-height: 24px; color: var(--muted); font-size: .92rem; }
.auth-message.error { color: #a53333; }
.live-chip { background: rgba(180, 244, 218, .14); border-color: rgba(180, 244, 218, .28); }
.online-dot { width: 10px; height: 10px; border-radius: 999px; background: #72d9ad; box-shadow: 0 0 0 5px rgba(114,217,173,.12); }
.logout-btn { min-height: 42px; justify-content: center; white-space: nowrap; }
.logout-icon { font-size: 1.15rem; line-height: 1; }
button:disabled { opacity: .58; cursor: wait; transform: none !important; }

html[data-theme="night"] .auth-screen {
  background:
    radial-gradient(circle at 15% 20%, rgba(90, 197, 154, .14), transparent 34%),
    linear-gradient(145deg, #072a22, #0c3b2f);
}
html[data-theme="night"] .auth-card { background: #0f3f31; border-color: #2b5b49; }
html[data-theme="night"] .auth-card h1 { color: #e8fff5; }
html[data-theme="night"] .auth-message.error { color: #ffb1ad; }

.required-mark { color: #b42318; font-weight: 900; }
.form-guidance {
  margin: 0;
  padding: 11px 14px;
  border-right: 3px solid var(--green-600);
  border-radius: 10px;
  background: var(--green-50);
  color: var(--text);
  font-size: .9rem;
}
.field-error { border-color: #c9362b !important; box-shadow: 0 0 0 3px rgba(201,54,43,.12) !important; }
tr.validation-error td { background: rgba(201,54,43,.06); }
.record-meta { display: grid; gap: 3px; min-width: 210px; color: var(--muted); font-size: .78rem; }
.record-lock { color: var(--green-700); font-weight: 800; }
.confirmation-dialog {
  width: min(92vw, 520px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(3,35,26,.24);
}
.confirmation-dialog::backdrop { background: rgba(3,25,19,.48); }
.confirmation-dialog h3 { margin-top: 0; }
.confirmation-dialog p { line-height: 1.9; color: var(--muted); }
html[data-theme="night"] .form-guidance { background: #123f32; border-color: #72d9ad; }
html[data-theme="night"] .confirmation-dialog { background: #0f3f31; border-color: #346854; }
