

:root {
  --bg: #f4f5f7;
  --bg-2: #eceef1;
  --panel: #ffffff;
  --panel-soft: #ffffff;
  --border: #e2e4e8;
  --border-strong: #d4d7dc;
  --text: #1d2025;
  --muted: #68707b;
  --muted-2: #9299a3;
  --red: #650b1b;
  --red-2: #7c1025;
  --red-3: #9b1b35;
  --wine: #5e0a18;
  --wine-dark: #3b050e;
  --rose: #f8eef1;
  --blue: #67707d;
  --green: #167a59;
  --ink: #1d2025;
  --shadow: 0 9px 28px rgba(33, 37, 45, .065);
  --sidebar-width: 292px;
}

html { color-scheme: light; background: var(--bg); }
body {
  color: var(--text);
  background: var(--bg);
  font-family: Inter, Aptos, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body::before { display: none; }
.ambient { display: none; }
.glass {
  border-color: var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.kicker { color: var(--red-2); font-size: 10px; font-weight: 850; letter-spacing: .14em; }
::selection { color: #fff; background: var(--red-2); }

button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(124, 16, 37, .16);
  outline-offset: 2px;
}
input, select, textarea,
.login-form input, .field select, .field input, .field textarea,
.date-filters input, .select-box select {
  border-color: var(--border-strong) !important;
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
input::placeholder, textarea::placeholder { color: #9da3ab !important; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(124, 16, 37, .48) !important;
  box-shadow: 0 0 0 4px rgba(124, 16, 37, .07) !important;
}

.primary-button,
.secondary-button,
.ghost-button,
.back-button,
.danger-button {
  border-radius: 9px;
  font-weight: 750;
  letter-spacing: -.01em;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.primary-button {
  border: 1px solid #570715;
  background: linear-gradient(135deg, #7d1025, #590817);
  color: #fff;
  box-shadow: 0 7px 16px rgba(94, 10, 24, .18);
}
.primary-button:hover { transform: translateY(-1px); background: linear-gradient(135deg, #90152d, #650b1b); }
.secondary-button, .ghost-button, .back-button {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--wine);
  box-shadow: none;
}
.secondary-button:hover, .ghost-button:hover, .back-button:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 16, 37, .28);
  background: var(--rose);
}

.app-page { overflow-x: hidden; }
.app-shell {
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: var(--bg);
}
.sidebar.glass {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 14px 22px;
  border: 0;
  border-right: 1px solid rgba(255,255,255,.08);
  border-radius: 0;
  background:
    radial-gradient(circle at 12% 2%, rgba(255,255,255,.09), transparent 14rem),
    linear-gradient(180deg, #650b1b 0%, #520714 52%, #39040d 100%);
  box-shadow: 10px 0 35px rgba(57, 4, 13, .13);
  color: #fff;
  scrollbar-color: rgba(255,255,255,.24) transparent;
}
.brand-mini {
  min-height: 82px;
  gap: 12px;
  margin: 0 -14px 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.13);
}
.brand-mini img {
  width: 49px;
  height: 49px;
  flex: 0 0 49px;
  object-fit: contain;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  background: rgba(255,255,255,.07);
}
.brand-mini-copy { min-width: 0; }
.brand-mini strong {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.025em;
  text-shadow: none;
}
.brand-mini span {
  margin-top: 5px;
  color: rgba(255,255,255,.56);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .19em;
}
.nav-list { gap: 4px; margin-top: 0; }
.nav-link {
  min-height: 47px;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.22;
}
.nav-symbol {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255,255,255,.055);
}
.nav-symbol img {
  width: 18px;
  height: 18px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: .78;
}
.nav-link:hover, .nav-link.parent-active {
  color: #fff;
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.075);
}
.nav-link.active {
  color: var(--wine);
  border-color: #fff;
  background: #fff;
  box-shadow: 0 8px 20px rgba(37, 2, 8, .19);
}
.nav-link.active .nav-symbol { background: var(--rose); }
.nav-link.active .nav-symbol img {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(11%) sepia(81%) saturate(4282%) hue-rotate(338deg) brightness(68%) contrast(105%);
}
.chevron { color: currentColor; opacity: .7; }
.nav-submenu { padding: 4px 0 5px 43px; }
.nav-sublink {
  min-height: 35px;
  padding: 8px 11px;
  border-left: 1px solid rgba(255,255,255,.17);
  color: rgba(255,255,255,.54);
  font-size: 11px;
  font-weight: 600;
}
.nav-sublink:hover, .nav-sublink.active {
  border-left-color: #fff;
  background: rgba(255,255,255,.045);
  color: #fff;
}

.main-area { min-width: 0; min-height: 100vh; background: var(--bg); }
.topbar.glass {
  position: sticky;
  top: 0;
  z-index: 220;
  min-height: 76px;
  padding: 12px 28px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255,255,255,.97);
  box-shadow: 0 2px 12px rgba(31, 35, 43, .035);
}
.topbar-title { min-width: 180px; gap: 11px; }
.topbar h1 { margin-top: 3px; color: var(--text); font-size: 19px; font-weight: 780; letter-spacing: -.025em; }
.topbar-actions { gap: 8px; }
.global-search { width: min(490px, 36vw); }
.global-search > label {
  height: 44px;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f7f8f9;
  box-shadow: inset 0 1px 2px rgba(31,35,43,.02);
}
.global-search > label:focus-within {
  border-color: rgba(124,16,37,.30);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124,16,37,.055);
}
.global-search > label > span { width: 19px; height: 19px; display: grid; place-items: center; }
.global-search > label img { width: 18px; height: 18px; opacity: .55; }
.global-search input { border: 0 !important; background: transparent !important; color: var(--text) !important; box-shadow: none !important; font-size: 12px; }
.search-dropdown.glass { border-radius: 10px; background: #fff; box-shadow: 0 18px 42px rgba(31,35,43,.14); }
.notification-button, .topbar-icon-button, .topbar-logout-button, .mobile-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--wine);
  box-shadow: none;
}
.notification-button:hover, .topbar-icon-button:hover, .topbar-logout-button:hover, .mobile-toggle:hover {
  border-color: rgba(124,16,37,.26);
  background: var(--rose);
  transform: translateY(-1px);
}
.notification-button img, .topbar-icon-button img, .topbar-logout-button img, .mobile-toggle img {
  width: 18px;
  height: 18px;
  display: block;
  opacity: .76;
}
.notification-button b { border-color: #fff; background: var(--red-3); }
.topbar-logout-button { border-color: rgba(124,16,37,.16); background: var(--rose); }
.topbar-account {
  min-height: 42px;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
}
.topbar-account::before {
  content: "";
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8d1830, #520714);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.10);
}
.topbar-account strong { color: var(--text); font-size: 12px; }
.topbar-account .topbar-separator { color: #c5c8cd; }
.viewer-badge {
  border-color: rgba(22,122,89,.14);
  border-radius: 7px;
  background: #eef8f4;
  color: #116448;
}
.viewer-badge.admin-badge { border-color: rgba(124,16,37,.15); background: var(--rose); color: var(--wine); }
.today { color: var(--muted); }
.finance-alert-chip { border-color: #ead8a8; border-radius: 9px; background: #fff9e8; color: #795610; }
.theme-switcher { min-height: 42px; border-color: var(--border); border-radius: 9px; background: #f5f6f7; box-shadow: none; }
.theme-option { border-radius: 6px; color: var(--muted); }
.theme-option[aria-pressed="true"] { border-color: rgba(124,16,37,.14); background: #fff; color: var(--wine); box-shadow: 0 2px 8px rgba(31,35,43,.07); }

.view { padding: 30px 30px 48px; }
.page-intro { align-items: center; padding: 0 0 22px; }
.page-intro h2, .detail-title-row h2 { color: #1b1e23; font-weight: 780; letter-spacing: -.035em; }
.page-intro h2 { font-size: clamp(26px, 3vw, 34px); }
.page-intro p, .detail-title-row p { color: var(--muted); }
.panel {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(31,35,43,.04);
}
.panel-head h3 { color: var(--text); font-weight: 740; }
.dashboard-card-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.dashboard-card {
  min-height: 137px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 15px rgba(31,35,43,.035);
}
.dashboard-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--wine); }
.dashboard-card:hover { transform: translateY(-2px); border-color: rgba(124,16,37,.24); box-shadow: 0 10px 24px rgba(31,35,43,.075); }
.dashboard-card small { color: var(--muted); font-size: 11px; letter-spacing: .045em; }
.dashboard-card strong { margin: 14px 0 7px; color: var(--text); font-size: 32px; font-weight: 780; }
.dashboard-card span { color: var(--muted); font-size: 12px; }
.dashboard-card i {
  right: 17px;
  bottom: 15px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--rose);
  color: var(--wine);
  font-size: 20px;
}
.dashboard-grid { gap: 14px; }
.summary-card, .detail-summary > div {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(31,35,43,.035);
}
.summary-card strong, .detail-summary strong { color: var(--text); }
.order-row {
  border-color: var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(31,35,43,.03);
}
.order-row:hover { transform: translateY(-1px); border-color: rgba(124,16,37,.22); background: #fff; box-shadow: 0 9px 22px rgba(31,35,43,.065); }
.order-main strong, .order-stat strong { color: var(--text); }
.company-mark { border-radius: 9px; background: var(--rose); color: var(--wine); }
.company-mark.usd { background: #eef1f5; color: #56606e; }
.order-status-badge { border-color: #d8dce2; border-radius: 7px; background: #f4f6f8; color: #56606e; }
.order-status-badge.arrived { border-color: #cfe7dd; background: #eff8f4; color: #146b4e; }
.status-select-wrap select { border-color: var(--border-strong); border-radius: 8px; background: #fff; color: var(--text); }
.compact-search { border-color: var(--border); border-radius: 9px; background: #f7f8f9; }
.compact-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--text) !important; }
.status-chip { border-color: var(--border); border-radius: 7px; background: #f6f7f8; color: var(--muted); }
.detail-table th { border-bottom: 1px solid var(--border); background: #f6f7f8; color: #68707b; }
.detail-table td { border-top-color: #eceef1; color: #525a65; }
.detail-table td strong { color: var(--text); }
.current-row, .request-row, .security-row, .template-row, .audit-row, .session-row {
  border-color: var(--border);
  background: #fff;
}
.stock-track { background: #eceef1; }
.stock-track span { background: linear-gradient(90deg, #650b1b, #a41d39); box-shadow: none; }
.security-tabs { flex-wrap: wrap; }
.security-tabs button { border-color: var(--border); border-radius: 8px; background: #fff; color: var(--muted); }
.security-tabs button.active { border-color: rgba(124,16,37,.20); background: var(--rose); color: var(--wine); box-shadow: inset 0 -2px var(--wine); }
.drop-zone { border-color: rgba(124,16,37,.28); border-radius: 11px; background: #fcf9fa; }
.drop-zone:hover, .drop-zone.dragging, .drop-zone:focus-visible { border-color: var(--red-2); background: var(--rose); }
.drop-zone > span { color: var(--red-2); }

.modal-backdrop { background: rgba(24, 4, 9, .62); backdrop-filter: blur(4px); }
.form-modal, .confirm-modal, .upload-modal, .preview-modal, .order-modal,
.payment-alert-modal, .access-denied-modal, .sensitive-orders-modal, .welcome-card {
  border-color: var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(35, 6, 13, .22);
}
.form-modal h2, .confirm-modal h2, .upload-modal h2, .payment-alert-modal h2 { color: var(--text); }
.modal-close { border: 1px solid var(--border); border-radius: 8px; background: #f5f6f7; color: var(--muted); }
.modal-close:hover { background: var(--rose); color: var(--wine); }
.toast { border-color: rgba(255,255,255,.12); background: #3b050e; color: #fff; box-shadow: 0 14px 34px rgba(42,5,12,.25); }
.notification-panel.glass { border-radius: 11px; background: #fff; box-shadow: 0 18px 44px rgba(31,35,43,.14); }
.notification-panel h3, .notification-item strong { color: var(--text); }
.welcome-card::before, .welcome-card::after { opacity: .18; }
.welcome-card h2, .welcome-card h2 strong { color: var(--text); }
.welcome-card .kicker { color: var(--wine); }

.login-page {
  padding: clamp(18px, 3vw, 42px);
  background:
    radial-gradient(circle at 10% 10%, rgba(124,16,37,.08), transparent 24rem),
    #f2f3f5;
}
.login-wrap {
  width: min(1180px, 100%);
  min-height: min(700px, calc(100vh - 84px));
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid #dedfe3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 75px rgba(42, 5, 12, .13);
}
.login-brand-panel {
  padding: clamp(40px, 5vw, 68px);
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.05), transparent 45%),
    radial-gradient(circle at 82% 14%, rgba(255,255,255,.13), transparent 15rem),
    linear-gradient(145deg, #780f23 0%, #570714 58%, #35030b 100%);
  box-shadow: none;
}
.login-brand-panel::before { border-color: rgba(255,255,255,.10); }
.login-brand-panel::after { border-color: rgba(255,255,255,.10); }
.login-logo { filter: brightness(0) invert(1); }
.login-copy .kicker { color: rgba(255,255,255,.66); }
.login-copy h1 { color: #fff; font-size: clamp(38px, 4.5vw, 60px); }
.login-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 5vw, 62px);
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.login-card-head img { padding: 7px; border-radius: 11px; background: linear-gradient(145deg, #7d1025, #4b0612); }
.login-card h2 { color: var(--text); }
.login-form input { height: 50px; border-radius: 9px; }
.remember-login-option input { accent-color: var(--wine); }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #170309;
  --bg-2: #21050c;
  --panel: #26060e;
  --panel-soft: #26060e;
  --border: rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.16);
  --text: #fff9fa;
  --muted: #c2adb2;
  --muted-2: #8d747a;
  --ink: #fff9fa;
  --rose: rgba(255,255,255,.075);
  --shadow: 0 10px 30px rgba(0,0,0,.20);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .main-area { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .topbar.glass,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .detail-summary > div,
html[data-theme="dark"] .order-row,
html[data-theme="dark"] .current-row,
html[data-theme="dark"] .request-row,
html[data-theme="dark"] .security-row,
html[data-theme="dark"] .template-row,
html[data-theme="dark"] .audit-row,
html[data-theme="dark"] .session-row,
html[data-theme="dark"] .notification-panel.glass,
html[data-theme="dark"] .search-dropdown.glass,
html[data-theme="dark"] .form-modal,
html[data-theme="dark"] .confirm-modal,
html[data-theme="dark"] .upload-modal,
html[data-theme="dark"] .preview-modal,
html[data-theme="dark"] .order-modal,
html[data-theme="dark"] .payment-alert-modal,
html[data-theme="dark"] .access-denied-modal,
html[data-theme="dark"] .sensitive-orders-modal,
html[data-theme="dark"] .welcome-card { background: var(--panel); color: var(--text); }
html[data-theme="dark"] .page-intro h2,
html[data-theme="dark"] .detail-title-row h2,
html[data-theme="dark"] .panel-head h3,
html[data-theme="dark"] .dashboard-card strong,
html[data-theme="dark"] .summary-card strong,
html[data-theme="dark"] .detail-summary strong,
html[data-theme="dark"] .order-main strong,
html[data-theme="dark"] .order-stat strong,
html[data-theme="dark"] .detail-table td strong,
html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .topbar-account,
html[data-theme="dark"] .topbar-account strong { color: var(--text); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .global-search > label,
html[data-theme="dark"] .compact-search { background: #300812 !important; color: var(--text) !important; }
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .ghost-button,
html[data-theme="dark"] .back-button,
html[data-theme="dark"] .notification-button,
html[data-theme="dark"] .topbar-icon-button,
html[data-theme="dark"] .topbar-logout-button,
html[data-theme="dark"] .mobile-toggle,
html[data-theme="dark"] .security-tabs button { background: #300812; color: #f8e9ec; }
html[data-theme="dark"] .detail-table th { background: #310812; color: #c7b2b7; }
html[data-theme="dark"] .detail-table td { color: #d8c9cd; }
html[data-theme="dark"] .theme-switcher { background: #300812; }
html[data-theme="dark"] .theme-option[aria-pressed="true"] { background: #fff; color: var(--wine); }
html[data-theme="dark"] .topbar-icon-button img,
html[data-theme="dark"] .notification-button img,
html[data-theme="dark"] .topbar-logout-button img,
html[data-theme="dark"] .mobile-toggle img,
html[data-theme="dark"] .global-search img { filter: brightness(0) invert(1); }

@media (max-width: 1320px) {
  :root { --sidebar-width: 260px; }
  .topbar.glass { padding-inline: 20px; }
  .view { padding-inline: 22px; }
  .topbar-account .viewer-badge, .today { display: none; }
  .dashboard-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar.glass {
    position: fixed;
    z-index: 300;
    left: 0;
    top: 0;
    width: min(292px, calc(100vw - 42px));
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: none; }
  .mobile-toggle { display: grid; }
  .global-search { width: min(380px, 40vw); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar.glass { min-height: 68px; padding: 10px 12px; }
  .topbar-title > div { display: none; }
  .global-search { width: min(100%, 260px); }
  .topbar-account, .theme-switcher, .topbar-icon-button { display: none; }
  .view { padding: 22px 12px 36px; }
  .page-intro { align-items: stretch; }
  .dashboard-card-grid { grid-template-columns: 1fr; }
  .dashboard-card { min-height: 124px; }
  .login-page { padding: 10px; }
  .login-wrap { grid-template-columns: 1fr; border-radius: 14px; }
  .login-brand-panel { min-height: 300px; padding: 30px; }
  .login-card { padding: 30px 24px; }
}

@media (max-width: 460px) {
  .global-search { width: calc(100vw - 156px); }
  .notification-button { display: none; }
  .page-intro h2 { font-size: 25px; }
}

:root {
  --sidebar-width: clamp(284px, 20.15vw, 322px);
  --topbar-height: 68px;
  --reference-wine: #4d0715;
  --reference-wine-deep: #37040d;
  --reference-wine-active: #8e1835;
  --reference-line: #e5e7eb;
  --reference-canvas: #ffffff;
  --reference-soft: #f8f9fa;
}

html, body { min-height: 100%; background: var(--reference-canvas); }
.app-page { background: #fff; }
.app-shell {
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: #fff;
}

.sidebar.glass {
  top: 0;
  height: 100vh;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(24, 2, 8, .34);
  border-radius: 0;
  background: linear-gradient(180deg, #520817 0%, var(--reference-wine) 58%, var(--reference-wine-deep) 100%);
  box-shadow: none;
}
.brand-mini {
  min-height: var(--topbar-height);
  height: var(--topbar-height);
  gap: 12px;
  margin: 0;
  padding: 0 17px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mini img {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  padding: 4px;
  border: 0;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
}
.brand-mini strong { font-size: 15px; font-weight: 760; letter-spacing: -.015em; }
.brand-mini span { margin-top: 4px; font-size: 8px; letter-spacing: .21em; color: rgba(255,255,255,.54); }
.nav-list {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 12px 10px 14px;
}
.nav-link {
  min-height: 47px;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  gap: 9px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  color: rgba(255,255,255,.72);
  font-size: 14px;
  font-weight: 580;
  line-height: 1.18;
}
.nav-symbol {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
}
.nav-symbol img { width: 20px; height: 20px; opacity: .78; filter: brightness(0) invert(1); }
.nav-link:hover, .nav-link.parent-active {
  border: 0;
  color: #fff;
  background: rgba(255,255,255,.07);
}
.nav-link.active,
.nav-link.active:hover {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, #9b2040, var(--reference-wine-active));
  box-shadow: 0 5px 14px rgba(32, 2, 8, .22), inset 0 1px rgba(255,255,255,.11);
}
.nav-link.active .nav-symbol { background: transparent; }
.nav-link.active .nav-symbol img { opacity: 1; filter: brightness(0) invert(1); }
.chevron { justify-self: center; color: rgba(255,255,255,.68); font-size: 14px; }
.nav-submenu { padding: 3px 4px 5px 42px; }
.nav-sublink {
  min-height: 34px;
  padding: 8px 10px;
  border-left: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.57);
  font-size: 11px;
  font-weight: 570;
}
.nav-sublink:hover, .nav-sublink.active { border-left-color: #fff; background: rgba(255,255,255,.055); color: #fff; }

.corporate-sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.09);
  color: #fff;
}
.corporate-settings-button {
  width: 100%;
  min-height: 59px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 19px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: transparent;
  color: rgba(255,255,255,.76);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 590;
}
.corporate-settings-button:hover { background: rgba(255,255,255,.065); color: #fff; }
.corporate-settings-button img,
.corporate-sidebar-logout img { width: 20px; height: 20px; filter: brightness(0) invert(1); opacity: .78; }
.corporate-sidebar-user {
  min-height: 77px;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
}
.corporate-sidebar-avatar {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: rgba(255,255,255,.09);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.corporate-sidebar-user-copy { min-width: 0; }
.corporate-sidebar-user-copy strong,
.corporate-sidebar-user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.corporate-sidebar-user-copy strong { color: #fff; font-size: 12px; font-weight: 680; }
.corporate-sidebar-user-copy small { margin-top: 4px; color: rgba(255,255,255,.48); font-size: 9px; }
.corporate-sidebar-logout {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.corporate-sidebar-logout:hover { background: rgba(255,255,255,.08); }

.main-area { min-height: 100vh; background: #fff; }
.topbar.glass {
  min-height: var(--topbar-height);
  height: var(--topbar-height);
  padding: 0 28px;
  border: 0;
  border-bottom: 1px solid var(--reference-line);
  border-radius: 0;
  background: rgba(255,255,255,.985);
  box-shadow: none;
}
.topbar-title { width: 48px; min-width: 48px; gap: 0; }
.topbar-context { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mobile-toggle { display: none; }
.topbar-home-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.topbar-home-button:hover { background: #f2f3f5; }
.topbar-home-button img { width: 20px; height: 20px; opacity: .72; }
.topbar-actions { flex: 1; gap: 12px; min-width: 0; }
.global-search {
  width: min(580px, 47vw);
  margin-left: clamp(30px, 10vw, 168px);
  margin-right: auto;
}
.global-search > label {
  height: 46px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f7f7f8;
  box-shadow: 0 1px 4px rgba(20,24,31,.035);
}
.global-search > label:focus-within { border-color: #d9dce1; background: #fff; box-shadow: 0 0 0 3px rgba(77,7,21,.055); }
.global-search input { font-size: 15px; }
.notification-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.notification-button:hover { border: 0; background: #f3f4f5; transform: none; }
.notification-button img { width: 20px; height: 20px; opacity: .82; }
.topbar-account {
  min-height: 48px;
  gap: 10px;
  padding: 5px 7px 5px 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  user-select: none;
}
.topbar-account:hover, .topbar-account.menu-open { background: #f5f6f7; }
.topbar-account::before {
  width: 41px;
  height: 41px;
  flex: 0 0 41px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8f1b38, #5a0819);
  box-shadow: none;
}
.topbar-account strong { color: #16191e; font-size: 14px; font-weight: 650; }
.topbar-account .topbar-separator,
.topbar-account .viewer-badge { display: none; }
.finance-alert-chip { min-height: 38px; }

.corporate-account-menu {
  position: absolute;
  z-index: 380;
  right: 24px;
  top: calc(100% + 8px);
  width: 258px;
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid #e0e2e6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(28,31,38,.16);
}
.corporate-account-menu[hidden] { display: none !important; }
.corporate-account-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.corporate-account-menu-title { padding: 3px 5px 7px; color: #8a8f98; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.corporate-account-menu-close { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #777e88; cursor: pointer; font-size: 18px; }
.corporate-account-menu-close:hover { background: #f2f3f5; color: #4d0715; }
.corporate-account-menu .today { display: block; padding: 8px 9px; border-radius: 7px; background: #f6f7f8; color: #737983; font-size: 11px; }
.corporate-account-menu .topbar-icon-button,
.corporate-account-menu .topbar-logout-button {
  width: 100%;
  height: 40px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  color: #4d0715;
}
.corporate-account-menu .topbar-icon-button::after { content: "Şifre değiştir"; font-size: 12px; font-weight: 650; }
.corporate-account-menu .topbar-logout-button::after { content: "Çıkış yap"; font-size: 12px; font-weight: 650; }
.corporate-account-menu .topbar-icon-button:hover,
.corporate-account-menu .topbar-logout-button:hover { border-color: #d7bcc3; background: #faf3f5; transform: none; }
.corporate-account-menu .theme-switcher {
  width: 100%;
  min-height: 42px;
  order: initial;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f6f7f8;
}
.corporate-account-menu .theme-option { flex: 1; }

.view { padding: 18px 31px 50px; background: #fff; }
.view > .page-intro,
.detail-page-head {
  position: relative;
  isolation: auto;
  overflow: visible;
  min-height: 0;
  margin: 0;
  padding: 0 0 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.view > .page-intro::before,
.view > .page-intro::after,
.detail-page-head::before,
.detail-page-head::after { display: none; content: none; }
.corporate-breadcrumb {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #535963;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.corporate-breadcrumb:hover { color: var(--reference-wine-active); }
.corporate-breadcrumb > span:first-child { font-size: 19px; line-height: 1; }
.page-intro { align-items: flex-end; padding: 0 0 22px; }
.page-intro h2 { color: #102447; font-size: clamp(27px, 2.15vw, 34px); font-weight: 760; letter-spacing: -.035em; }
.page-intro p { margin-top: 6px; color: #626873; font-size: 14px; }
.page-intro .kicker { display: none; }
.panel,
.dashboard-card,
.summary-card,
.detail-summary > div,
.order-row {
  border: 1px solid #e1e3e7 !important;
  border-radius: 10px;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(24,28,35,.045) !important;
}
.dashboard-card-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.dashboard-card {
  min-height: 154px;
  padding: 18px 20px;
}
.dashboard-card::before { width: 0; background: none; }
.dashboard-card:hover { transform: none; border-color: #cfd2d8 !important; box-shadow: 0 4px 12px rgba(24,28,35,.065) !important; }
.dashboard-card small { color: #545a64; font-size: 12px; font-weight: 610; letter-spacing: 0; }
.dashboard-card strong { margin: 13px 0 8px; color: #15191f; font-size: 31px; font-weight: 700; }
.dashboard-card span { color: #646b75; font-size: 12px; }
.dashboard-card i {
  width: auto;
  height: auto;
  right: 18px;
  bottom: 15px;
  border-radius: 0;
  background: transparent;
  color: var(--reference-wine-active);
  font-size: 24px;
}
.dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(380px, .9fr); gap: 16px; }
.dashboard-grid .panel { min-height: 322px; padding: 20px; }
.panel { padding: 20px; }
.security-health-grid > div,
.mini-info-grid > div,
.modal-summary div { border-color: #e4e6ea !important; background: #fafafa !important; }
.panel-head h3 { color: #102447; font-size: 16px; }
.kicker { color: #225694; }
.summary-grid { gap: 14px; }
.summary-card { min-height: 145px; }
.order-list { gap: 9px; }
.order-row { padding: 18px 20px; }
.order-row:hover { transform: none; border-color: #cfd2d8; background: #fff; box-shadow: 0 4px 12px rgba(24,28,35,.06); }
.company-mark { background: #f6ecef; color: var(--reference-wine-active); }
.primary-button { border-radius: 8px; background: linear-gradient(135deg, #8f1b38, #5a0819); }
.secondary-button, .ghost-button, .back-button { border-radius: 8px; }
.compact-search,
.select-box select,
.date-filters input { border-radius: 8px; }
.detail-table th { background: #f7f8f9; color: #626975; }
.security-tabs button { border-radius: 7px; }

html[data-theme="light"] .main-area,
html[data-theme="light"] .view,
html[data-theme="light"] .topbar.glass { background: #fff; }
html[data-theme="dark"] .sidebar.glass { background: linear-gradient(180deg, #520817 0%, #430512 58%, #2d030a 100%); }
html[data-theme="dark"] .corporate-account-menu { background: #26060e; border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .corporate-account-menu-title { color: #bba6ab; }

@media (max-width: 1380px) {
  .global-search { margin-left: clamp(18px, 5vw, 72px); width: min(520px, 42vw); }
  .dashboard-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar-account strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 1120px) {
  :root { --sidebar-width: 270px; }
  .topbar.glass { padding-inline: 18px; }
  .global-search { margin-left: 16px; width: min(430px, 44vw); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar.glass {
    position: fixed;
    z-index: 420;
    left: 0;
    top: 0;
    width: min(300px, calc(100vw - 40px));
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: none; }
  .mobile-toggle { display: grid; }
  .topbar-home-button { display: none; }
  .topbar-title { width: 42px; min-width: 42px; }
  .global-search { margin-left: 8px; width: min(440px, 50vw); }
  .view { padding-inline: 20px; }
}

@media (max-width: 700px) {
  .topbar.glass { padding-inline: 10px; }
  .global-search { margin-left: 3px; width: min(100%, 310px); }
  .topbar-account { display: none; }
  .corporate-account-menu { right: 10px; }
  .view { padding: 17px 12px 36px; }
  .dashboard-card-grid { grid-template-columns: 1fr; }
  .dashboard-card { min-height: 132px; }
}

@media (max-width: 460px) {
  .global-search { width: calc(100vw - 112px); }
  .notification-button { display: grid; }
  .corporate-breadcrumb { margin-bottom: 7px; }
}

.corporate-utility-store,
.corporate-utility-store[hidden],
.corporate-account-menu { display: none !important; }

.topbar-account,
.topbar-account:hover,
.topbar-account.menu-open {
  background: transparent;
  cursor: default;
  user-select: text;
}

.topbar-home-button[hidden] { display: none !important; }

.nav-link.nav-fixed-parent {
  cursor: default;
}

.nav-link.nav-fixed-parent:hover {
  background: transparent;
  color: rgba(255,255,255,.72);
}

.nav-link.nav-fixed-parent .chevron,
.nav-link.nav-fixed-parent .chevron[hidden] { display: none !important; }

.nav-submenu.nav-submenu-fixed,
.nav-submenu.nav-submenu-fixed.open {
  display: block !important;
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.nav-list [hidden],
.nav-submenu.nav-submenu-fixed[hidden],
.nav-submenu.nav-submenu-fixed.open[hidden] { display: none !important; }

.nav-list.authz-pending > * { visibility: hidden !important; }

.mobile-search-button {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  border: 1px solid #e4d5d9;
  border-radius: 10px;
  background: #fff;
  color: var(--reference-wine);
  box-shadow: 0 5px 14px rgba(77,7,21,.07);
}

.mobile-search-button img { width: 19px; height: 19px; opacity: .82; }
.mobile-search-button[hidden], .global-search[hidden] { display: none !important; }

@media (max-width: 700px) {
  .topbar-actions { justify-content: flex-end; }
  .mobile-search-button { display: grid; }
  .mobile-search-button[aria-expanded="true"] {
    border-color: #7d142b;
    background: linear-gradient(145deg, #8f1b38, #5a0819);
  }
  .mobile-search-button[aria-expanded="true"] img { filter: brightness(0) invert(1); opacity: 1; }
  .global-search { display: none !important; }
  body.mobile-search-open .global-search:not([hidden]) {
    display: block !important;
    position: fixed;
    z-index: 520;
    top: 76px;
    left: 10px;
    right: 10px;
    width: auto;
    margin: 0;
  }
  body.mobile-search-open .global-search > label {
    height: 50px;
    border-color: #d9c6cb;
    background: #fff;
    box-shadow: 0 14px 34px rgba(45,3,12,.18);
  }
  body.mobile-search-open .global-search input { min-width: 0; font-size: 16px; }
  body.mobile-search-open .search-dropdown {
    max-height: min(62vh, 520px);
    overflow-y: auto;
    border: 1px solid #eadde0;
    box-shadow: 0 20px 44px rgba(45,3,12,.2);
  }
}

@media (min-width: 981px) {
  .sidebar.glass {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .sidebar.glass .nav-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
  }

  .sidebar.glass .corporate-sidebar-footer {
    flex: 0 0 auto;
    margin-top: 0;
    background: #31040d;
  }
}

.sidebar.glass .brand-mini {
  min-height: 88px;
  height: 88px;
  gap: 14px;
  padding: 0 18px;
  background: linear-gradient(90deg, rgba(255,255,255,.045), transparent 84%);
}

.sidebar.glass .brand-mini img {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  filter: brightness(1.12) drop-shadow(0 5px 13px rgba(20,0,5,.28));
}

.sidebar.glass .brand-mini-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.sidebar.glass .brand-mini strong {
  color: #fff;
  font-size: 21px;
  font-weight: 820;
  letter-spacing: -.025em;
  line-height: 1;
  text-shadow: 0 2px 13px rgba(255,255,255,.22), 0 3px 14px rgba(18,0,5,.3);
}

.sidebar.glass .brand-mini span,
.corporate-sidebar-footer {
  display: none !important;
}

.topbar-title {
  width: 52px;
  min-width: 52px;
}

.topbar-home-button {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(83,7,23,.14);
  border-radius: 50%;
  background: #8e182f;
  box-shadow: 0 5px 14px rgba(83,7,23,.16);
}

.topbar-home-button:hover {
  border-color: rgba(83,7,23,.24);
  background: #7c1025;
  box-shadow: 0 7px 18px rgba(83,7,23,.2);
  transform: translateY(-1px);
}

.topbar-home-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 1;
  filter: none;
  transform: scale(1.05);
}

.topbar-account,
.topbar-account:hover,
.topbar-account.menu-open {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-account::before {
  display: none;
}

.topbar-account strong {
  max-width: 170px;
  overflow: hidden;
  color: #191b20;
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-account .topbar-separator {
  display: inline !important;
  color: #b8bbc1;
  font-size: 15px;
  font-weight: 450;
}

.topbar-account .viewer-badge,
.topbar-account .viewer-badge.admin-badge,
.topbar-account .viewer-badge.finance-badge,
.topbar-account .viewer-badge.sales-badge {
  display: inline !important;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: #6a6f78 !important;
  font-size: 11px;
  font-weight: 620;
  line-height: 1.2;
  white-space: nowrap;
}

.topbar-icon-button,
.topbar-logout-button {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  border: 1px solid #e5e7ea;
  border-radius: 9px;
  background: #fff;
}

.topbar-logout-button {
  border-color: rgba(124,16,37,.16);
  background: #fbf5f6;
}

.topbar-icon-button:hover,
.topbar-logout-button:hover {
  border-color: rgba(124,16,37,.25);
  background: #f8eef1;
  transform: translateY(-1px);
}

@media (max-width: 1120px) {
  .topbar-account strong { max-width: 105px; }
  .topbar-account .viewer-badge { max-width: 115px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 820px) {
  .topbar-account .viewer-badge,
  .topbar-account .topbar-separator { display: none !important; }
}

.sidebar.glass .brand-mini {
  min-height: 102px;
  height: 102px;
  justify-content: center;
  gap: 17px;
  padding: 0 16px;
  background:
    radial-gradient(circle at 54% 50%, rgba(255,255,255,.085), transparent 48%),
    linear-gradient(90deg, transparent, rgba(255,255,255,.035) 48%, transparent);
}

.sidebar.glass .brand-mini img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    0 0 18px rgba(255,255,255,.1),
    0 10px 22px rgba(24,0,6,.32);
  filter: brightness(1.17) contrast(1.03) drop-shadow(0 0 7px rgba(255,255,255,.12));
}

.sidebar.glass .brand-mini-copy {
  position: relative;
  flex: 0 1 auto;
  justify-content: center;
  isolation: isolate;
}

.sidebar.glass .brand-mini-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 56%;
  top: 50%;
  width: 166%;
  height: 185%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 55% 50%, rgba(255,255,255,.23) 0%, rgba(255,255,255,.09) 39%, transparent 74%);
  filter: blur(10px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sidebar.glass .brand-mini strong {
  position: relative;
  color: #fff;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -.035em;
  text-align: center;
  text-shadow:
    0 0 6px rgba(255,255,255,.78),
    0 0 15px rgba(255,255,255,.3),
    0 4px 14px rgba(25,0,6,.42);
}

.topbar-home-button {
  width: 38px;
  height: 38px;
  overflow: visible;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.topbar-home-button:hover {
  border: 0;
  background: #f2f3f5;
  box-shadow: none;
  transform: none;
}

.topbar-home-button img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 0;
  opacity: .72;
  filter: none;
  transform: none;
}

.topbar-account {
  gap: 8px;
}

.topbar-user-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #8e182f;
  box-shadow:
    0 0 0 1px rgba(84,7,23,.14),
    0 6px 15px rgba(84,7,23,.17);
  transform: scale(1.02);
}

@media (max-width: 1120px) {
  .sidebar.glass .brand-mini { gap: 13px; padding-inline: 12px; }
  .sidebar.glass .brand-mini img { width: 58px; height: 58px; flex-basis: 58px; }
  .sidebar.glass .brand-mini strong { font-size: 21px; }
  .topbar-user-logo { width: 36px; height: 36px; flex-basis: 36px; }
}

:root {
  --granite-wine-border: rgba(82, 8, 24, .27);
  --granite-wine-border-hover: rgba(111, 17, 38, .42);
  --granite-wine-glint: rgba(158, 55, 79, .13);
  --granite-wine-shadow: rgba(62, 6, 18, .075);
  --order-yellow-border: rgba(213, 154, 25, .62);
  --order-yellow-glint: rgba(238, 185, 55, .13);
  --order-yellow-shadow: rgba(184, 126, 13, .085);
  --order-green-border: rgba(39, 139, 96, .58);
  --order-green-glint: rgba(73, 169, 126, .12);
  --order-green-shadow: rgba(25, 116, 78, .085);
  --order-blue-border: rgba(53, 120, 212, .56);
  --order-blue-glint: rgba(92, 153, 230, .12);
  --order-blue-shadow: rgba(32, 91, 171, .085);
}

.panel,
.dashboard-card,
.summary-card,
.detail-summary > div,
.current-row,
.current-payment-row,
.request-card,
.request-sheet-row,
.company-picker-option,
.security-health-grid > div,
.mini-info-grid > div,
.modal-summary > div,
.detail-table-wrap,
.request-table-wrap,
.audit-table-wrap,
.form-modal,
.confirm-modal,
.upload-modal,
.preview-modal,
.order-modal,
.payment-alert-modal,
.access-denied-modal,
.sensitive-orders-modal,
.welcome-card,
.order-row {
  border-color: var(--granite-wine-border) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.96),
    inset 0 0 0 1px rgba(158,55,79,.025),
    0 2px 10px var(--granite-wine-shadow) !important;
}

.panel:hover,
.dashboard-card:hover,
.current-row:hover,
.current-payment-row:hover,
.request-card:hover,
.request-sheet-row:hover,
.company-picker-option:hover,
.order-row:hover {
  border-color: var(--granite-wine-border-hover) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.98),
    inset 0 0 0 1px var(--granite-wine-glint),
    0 4px 14px rgba(62,6,18,.095) !important;
}

.order-row.order-status-ordered {
  border-color: var(--order-yellow-border) !important;
  background: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.98),
    inset 0 0 0 1px var(--order-yellow-glint),
    0 3px 12px var(--order-yellow-shadow) !important;
}

.order-row.order-status-ordered:hover {
  border-color: rgba(198, 137, 13, .76) !important;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(238,185,55,.18),
    0 5px 16px rgba(184,126,13,.12) !important;
}

.order-row.order-status-arrived {
  border-color: var(--order-green-border) !important;
  background: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.98),
    inset 0 0 0 1px var(--order-green-glint),
    0 3px 12px var(--order-green-shadow) !important;
}

.order-row.order-status-arrived:hover {
  border-color: rgba(24, 121, 79, .72) !important;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(73,169,126,.17),
    0 5px 16px rgba(25,116,78,.12) !important;
}

.pwa-install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(101,11,27,.22);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fbf7f8);
  color: #650b1b;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(101,11,27,.08);
  cursor: pointer;
}

.order-row.order-status-customs {
  border-color: var(--order-blue-border) !important;
  background: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.98),
    inset 0 0 0 1px var(--order-blue-glint),
    0 3px 12px var(--order-blue-shadow) !important;
}

.order-row.order-status-customs:hover {
  border-color: rgba(40, 101, 186, .72) !important;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(92,153,230,.17),
    0 5px 16px rgba(32,91,171,.12) !important;
}
.pwa-install-button:hover { border-color: rgba(101,11,27,.42); transform: translateY(-1px); }
.pwa-install-button[hidden] { display: none !important; }

.push-device-card {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(101,11,27,.14);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(101,11,27,.055), rgba(255,255,255,.96));
}
.push-device-copy { display: flex; align-items: center; gap: 10px; }
.push-device-copy > div { min-width: 0; }
.push-device-copy strong { display: block; color: #17191d; font-size: 13px; }
.push-device-copy small { display: block; margin-top: 3px; color: #686d74; font-size: 11px; line-height: 1.4; }
.push-device-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: #650b1b;
  color: #fff;
  box-shadow: 0 6px 16px rgba(101,11,27,.18);
}
.push-device-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.push-device-actions button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(101,11,27,.18);
  border-radius: 8px;
  background: #fff;
  color: #650b1b;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.push-device-actions .push-enable-button { background: #650b1b; color: #fff; }
.push-device-actions button:disabled { opacity: .5; cursor: not-allowed; }

.pwa-install-modal {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 30px;
  border: 1px solid rgba(101,11,27,.16);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(35,3,10,.28);
}
.pwa-install-brand { display: flex; align-items: center; gap: 15px; padding-right: 36px; }
.pwa-install-brand img { width: 64px; height: 64px; border-radius: 17px; box-shadow: 0 12px 28px rgba(101,11,27,.2); }
.pwa-install-brand h2 { margin: 5px 0 0; color: #16191e; font-size: clamp(24px, 4vw, 32px); letter-spacing: -.035em; }
.pwa-install-lead { margin: 20px 0; color: #5d626a; font-size: 14px; line-height: 1.65; }
.pwa-install-steps { display: grid; gap: 9px; }
.pwa-install-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e0e2;
  border-radius: 11px;
  background: #fdfbfb;
}
.pwa-install-step > b { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; background: #650b1b; color: #fff; font-size: 12px; }
.pwa-install-step span { min-width: 0; }
.pwa-install-step strong { display: block; color: #17191d; font-size: 13px; }
.pwa-install-step small { display: block; margin-top: 3px; color: #686d74; font-size: 11px; line-height: 1.45; }
.pwa-install-status { min-height: 20px; margin-top: 14px; color: #60656c; font-size: 12px; font-weight: 650; }
.pwa-install-status.success { color: #17734f; }
.pwa-install-status.warning { color: #965f00; }
.pwa-install-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.pwa-install-actions button { min-height: 43px; }

html[data-theme="dark"] .pwa-install-button,
html[data-theme="dark"] .push-device-actions button { background: #1c1f24; color: #fff; border-color: rgba(255,255,255,.13); }
html[data-theme="dark"] .push-device-card,
html[data-theme="dark"] .pwa-install-modal { background: #17191e; border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .push-device-copy strong,
html[data-theme="dark"] .pwa-install-brand h2,
html[data-theme="dark"] .pwa-install-step strong { color: #f4f5f6; }
html[data-theme="dark"] .push-device-copy small,
html[data-theme="dark"] .pwa-install-lead,
html[data-theme="dark"] .pwa-install-step small,
html[data-theme="dark"] .pwa-install-status { color: #b9bdc3; }
html[data-theme="dark"] .pwa-install-step { background: #1f2227; border-color: rgba(255,255,255,.1); }

@media (max-width: 700px) {
  .pwa-install-button { min-height: 36px; padding-inline: 10px; }
  .pwa-install-modal { padding: 23px 17px; border-radius: 15px; }
  .pwa-install-brand { align-items: flex-start; gap: 11px; }
  .pwa-install-brand img { width: 52px; height: 52px; border-radius: 14px; }
  .pwa-install-brand h2 { font-size: 23px; }
  .pwa-install-actions { flex-direction: column-reverse; }
  .pwa-install-actions button { width: 100%; }
}

@media (max-width: 700px) {
  .topbar.glass {
    min-height: 68px;
    height: 68px;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 8px 9px;
  }

  .topbar-title {
    width: 38px;
    min-width: 38px;
    flex: 0 0 38px;
  }

  .mobile-toggle {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  body.mini-ui .topbar-actions,
  .topbar-actions {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap !important;
    justify-content: flex-end;
    gap: 4px;
  }

  .topbar-account,
  body.mini-ui .topbar-account {
    order: -1;
    min-width: 0;
    max-width: none;
    min-height: 38px;
    height: 38px;
    flex: 1 1 auto;
    gap: 4px;
    overflow: hidden;
    padding: 0 2px;
    white-space: nowrap;
  }

  .topbar-user-logo {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-width: 1px;
    box-shadow: 0 0 0 1px rgba(84,7,23,.11), 0 4px 10px rgba(84,7,23,.13);
  }

  .topbar-account strong {
    max-width: min(23vw, 88px);
    flex: 0 1 auto;
    font-size: 11px;
    font-weight: 760;
  }

  .topbar-account .topbar-separator {
    display: inline !important;
    flex: 0 0 auto;
    font-size: 10px;
  }

  .topbar-account .viewer-badge,
  .topbar-account .viewer-badge.admin-badge,
  .topbar-account .viewer-badge.finance-badge,
  .topbar-account .viewer-badge.sales-badge {
    display: inline !important;
    max-width: 46px;
    overflow: hidden;
    flex: 0 1 auto;
    padding: 0;
    font-size: 9px;
    text-overflow: ellipsis;
  }

  .mobile-search-button {
    order: 1;
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .notification-wrap { order: 2; flex: 0 0 auto; }
  .notification-button { width: 36px; height: 36px; }

  .topbar-logout-button,
  body.mini-ui .topbar-logout-button {
    order: 3;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .finance-alert-chip,
  .topbar-actions > .pwa-install-button { display: none !important; }
}

@media (max-width: 370px) {
  .topbar.glass { gap: 3px; padding-inline: 6px; }
  .topbar-title { width: 36px; min-width: 36px; flex-basis: 36px; }
  .mobile-toggle { width: 36px; height: 36px; flex-basis: 36px; }
  .topbar-account strong { max-width: 62px; font-size: 10px; }
  .topbar-account .viewer-badge { max-width: 34px; font-size: 8px; }
  .topbar-user-logo { width: 28px; height: 28px; flex-basis: 28px; }
  .mobile-search-button,
  .notification-button,
  .topbar-logout-button,
  body.mini-ui .topbar-logout-button { width: 34px; height: 34px; flex-basis: 34px; }
}

.stock-summary-intro { align-items: flex-end; }
.stock-summary-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.stock-summary-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stock-summary-overview .summary-card {
  min-height: 118px;
  border-color: var(--granite-wine-border) !important;
  background: linear-gradient(145deg, #fff, #fdfafb) !important;
}

.stock-summary-card-ordered { border-color: rgba(30,137,91,.38) !important; }
.stock-summary-card-ordered strong { color: #14724b !important; }
.stock-summary-card-missing { border-color: rgba(176,45,59,.34) !important; }
.stock-summary-card-missing strong { color: #a52739 !important; }

.stock-summary-panel { overflow: hidden; padding: 0; }
.stock-summary-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid #eadde0;
  background: linear-gradient(180deg, #fff, #fdfafb);
}
.stock-summary-toolbar h3 { margin: 5px 0 0; color: #17191e; font-size: 18px; }
.stock-summary-filters { display: flex; align-items: flex-end; justify-content: flex-end; gap: 9px; }
.stock-summary-filters .select-box { min-width: 210px; }
.stock-summary-filters .compact-search { min-width: 230px; }

.stock-summary-upload-status {
  margin: 13px 20px 0;
  padding: 11px 13px;
  border: 1px solid #e3d6d9;
  border-radius: 9px;
  background: #fcf8f9;
  color: #5d303a;
  font-size: 11px;
  font-weight: 680;
}
.stock-summary-upload-status.loading { border-color: #dcc7cc; color: #6f2233; }
.stock-summary-upload-status.success { border-color: rgba(30,137,91,.28); background: #f1faf6; color: #116b45; }
.stock-summary-upload-status.error { border-color: rgba(176,45,59,.28); background: #fff4f5; color: #a32337; }

.stock-summary-table-head,
.stock-summary-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, .9fr) minmax(220px, 1.3fr) minmax(190px, 1fr);
  align-items: center;
  gap: 14px;
}

.stock-summary-table-head {
  min-height: 42px;
  margin-top: 13px;
  padding: 0 20px;
  border-top: 1px solid #eee5e7;
  border-bottom: 1px solid #eee5e7;
  background: #f9f5f6;
  color: #5d2a36;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stock-summary-list { min-height: 120px; }
.stock-summary-row {
  position: relative;
  min-height: 76px;
  padding: 13px 20px;
  border-bottom: 1px solid #eee5e7;
  background: #fff;
}
.stock-summary-row:last-child { border-bottom: 0; }
.stock-summary-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #b52e40;
}
.stock-summary-row.is-ordered::before { background: #218a5e; }
.stock-summary-row:hover { background: #fefcfc; }
.stock-summary-row > span { min-width: 0; }
.stock-summary-row strong,
.stock-summary-row small { display: block; }
.stock-summary-code strong { overflow: hidden; color: #181a1f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.stock-summary-company strong,
.stock-summary-quantity strong { overflow: hidden; color: #24272d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.stock-summary-company small,
.stock-summary-quantity small { margin-top: 5px; overflow: hidden; color: #767b84; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.stock-summary-order-state {
  width: fit-content;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 820;
  line-height: 1;
  cursor: default;
  user-select: none;
  pointer-events: none;
}
.stock-summary-order-state i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.stock-summary-order-state.ordered { border-color: rgba(28,139,91,.35); background: #edf9f3; color: #126d47; }
.stock-summary-order-state.ordered i { background: #27a66f; box-shadow: 0 0 0 4px rgba(39,166,111,.11); }
.stock-summary-order-state.missing { border-color: rgba(180,45,60,.32); background: #fff1f3; color: #a22336; }
.stock-summary-order-state.missing i { background: #c5374b; box-shadow: 0 0 0 4px rgba(197,55,75,.1); }

.stock-summary-loading {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6e6265;
  font-size: 11px;
  font-weight: 680;
}
.stock-summary-loading span {
  width: 17px;
  height: 17px;
  border: 2px solid #eadde0;
  border-top-color: #7c1025;
  border-radius: 50%;
  animation: stock-summary-spin .75s linear infinite;
}
@keyframes stock-summary-spin { to { transform: rotate(360deg); } }
.stock-summary-empty { min-height: 150px; display: grid; place-content: center; gap: 6px; text-align: center; }
.stock-summary-empty strong { color: #34373d; font-size: 13px; }
.stock-summary-empty small { color: #797e87; font-size: 10px; }
.stock-summary-empty.error strong { color: #a22336; }

html[data-theme="dark"] .stock-summary-overview .summary-card,
html[data-theme="dark"] .stock-summary-toolbar,
html[data-theme="dark"] .stock-summary-row { background: #1b1d22 !important; }
html[data-theme="dark"] .stock-summary-panel,
html[data-theme="dark"] .stock-summary-row,
html[data-theme="dark"] .stock-summary-toolbar,
html[data-theme="dark"] .stock-summary-table-head { border-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .stock-summary-table-head { background: #211a1d; color: #d8bfc5; }
html[data-theme="dark"] .stock-summary-toolbar h3,
html[data-theme="dark"] .stock-summary-code strong,
html[data-theme="dark"] .stock-summary-company strong,
html[data-theme="dark"] .stock-summary-quantity strong,
html[data-theme="dark"] .stock-summary-empty strong { color: #f3f4f6; }

@media (max-width: 980px) {
  .stock-summary-table-head,
  .stock-summary-row { grid-template-columns: minmax(125px,.9fr) minmax(150px,.9fr) minmax(190px,1.2fr) minmax(155px,.9fr); }
  .stock-summary-toolbar { align-items: stretch; flex-direction: column; }
  .stock-summary-filters { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .stock-summary-intro { align-items: stretch; }
  .stock-summary-actions { justify-content: stretch; }
  .stock-summary-actions button { flex: 1 1 145px; }
  .stock-summary-overview { grid-template-columns: 1fr; gap: 8px; }
  .stock-summary-overview .summary-card { min-height: 96px; }
  .stock-summary-toolbar { padding: 16px 13px; }
  .stock-summary-filters { align-items: stretch; flex-direction: column; }
  .stock-summary-filters .select-box,
  .stock-summary-filters .compact-search { width: 100%; min-width: 0; }
  .stock-summary-upload-status { margin-inline: 13px; }
  .stock-summary-table-head { display: none; }
  .stock-summary-list { display: grid; gap: 8px; padding: 10px; background: #faf7f8; }
  .stock-summary-row {
    min-height: 0;
    grid-template-columns: 1fr 1fr;
    gap: 13px 10px;
    padding: 14px 13px 14px 16px;
    border: 1px solid #eadde0;
    border-radius: 11px;
  }
  .stock-summary-row::before { top: 10px; bottom: 10px; border-radius: 0 5px 5px 0; }
  .stock-summary-row > span::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: #806d72;
    font-size: 8px;
    font-weight: 840;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .stock-summary-code,
  .stock-summary-company { grid-column: 1 / -1; }
  .stock-summary-company strong,
  .stock-summary-company small { white-space: normal; }
}

@media (max-width: 430px) {
  .stock-summary-row { grid-template-columns: 1fr; }
  .stock-summary-code,
  .stock-summary-company { grid-column: auto; }
}

.future-goods-order-row.order-status-arrived {
  border-color: rgba(34, 145, 94, .58) !important;
  background: linear-gradient(105deg, rgba(34,145,94,.035), #fff 34%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.98),
    inset 0 0 0 1px rgba(73,169,126,.11),
    0 3px 12px rgba(25,116,78,.085) !important;
}
.future-goods-order-row.order-status-arrived:hover {
  border-color: rgba(24, 121, 79, .72) !important;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(73,169,126,.17),
    0 5px 16px rgba(25,116,78,.12) !important;
}

.current-payment-row.payment-row-paid {
  border-color: rgba(34, 145, 94, .52) !important;
  background: linear-gradient(105deg, rgba(34,145,94,.034), #fff 30%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.98),
    inset 0 0 0 1px rgba(73,169,126,.1),
    0 3px 12px rgba(25,116,78,.075) !important;
}
.current-payment-row.payment-row-paid:hover {
  border-color: rgba(24, 121, 79, .68) !important;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(73,169,126,.16),
    0 5px 16px rgba(25,116,78,.11) !important;
}

.current-payment-row {
  grid-template-columns:
    minmax(120px, 1fr)
    minmax(92px, .72fr)
    70px
    112px
    126px
    repeat(4, minmax(108px, .84fr))
    106px
    68px !important;
  gap: 6px !important;
  align-items: center !important;
  padding: 12px 10px !important;
  overflow: visible !important;
}

.current-payment-row > .current-order-link,
.current-payment-row > .current-payment-amount,
.current-payment-row > .current-payment-date,
.current-payment-row > .finance-text-field,
.current-payment-row > .current-payment-status {
  width: 100%;
  min-width: 0;
  min-height: 72px;
  align-self: center !important;
  box-sizing: border-box;
}
.current-payment-row > .current-order-link {
  display: grid;
  place-items: center;
  text-align: center;
}
.current-payment-row > .current-payment-amount,
.current-payment-row > .current-payment-date,
.current-payment-row > .finance-text-field,
.current-payment-row > .current-payment-status {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: stretch !important;
  text-align: center !important;
}
.current-payment-row .current-payment-amount > span,
.current-payment-row .current-payment-date > span,
.current-payment-row .finance-text-field > span,
.current-payment-row .current-payment-status > span:first-child {
  min-height: 13px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 0 7px !important;
  line-height: 1 !important;
  text-align: center !important;
}
.current-payment-row .current-payment-date input,
.current-payment-row .current-payment-date.final-payment-date strong,
.current-payment-row .finance-value-chip,
.current-payment-row .payment-select,
.current-payment-row .readonly-payment-status {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
}
.current-payment-row .current-payment-date.final-payment-date {
  height: 72px !important;
  min-height: 72px !important;
  max-height: 72px !important;
  padding: 6px !important;
}
.current-payment-row .current-payment-date.final-payment-date > span {
  min-height: 11px;
  margin-bottom: 4px !important;
}
.current-payment-row .current-payment-date.final-payment-date strong {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.current-payment-row .payment-save-button {
  grid-column: auto !important;
  width: 68px !important;
  min-width: 68px !important;
  max-width: 68px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  align-self: center !important;
  justify-self: center !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
  border: 1px solid #570715 !important;
  background: linear-gradient(135deg, #8f1b38, #5a0819) !important;
  color: #fff !important;
  box-shadow: 0 7px 16px rgba(94, 10, 24, .18) !important;
  font-size: 10px !important;
  line-height: 1 !important;
}
.current-payment-row .payment-save-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #a12243, #680a1d) !important;
  transform: translateY(-1px);
}
.current-payment-row .payment-save-button:disabled {
  background: linear-gradient(135deg, #8f1b38, #5a0819) !important;
  color: #fff !important;
  opacity: .52;
}

@media (max-width: 1300px) {
  .current-payment-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .current-payment-row > .current-order-link { grid-column: 1 / -1 !important; }
  .current-payment-row .payment-save-button {
    grid-column: auto !important;
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
  }
}

@media (max-width: 700px) {
  .current-payment-row { grid-template-columns: 1fr !important; }
  .current-payment-row > .current-order-link { grid-column: auto !important; }
  .current-payment-row .payment-save-button { justify-self: center !important; }
}

.summary-card::after,
.detail-summary > div::after {
  content: none !important;
  display: none !important;
}

.simple-order-table {
  table-layout: fixed;
}
.simple-order-table th:nth-child(1),
.simple-order-table td:nth-child(1) { width: 6%; }
.simple-order-table th:nth-child(2),
.simple-order-table td:nth-child(2) { width: 18%; }
.simple-order-table th:nth-child(3),
.simple-order-table td:nth-child(3) { width: 40%; }
.simple-order-table th:nth-child(4),
.simple-order-table td:nth-child(4) {
  width: 17%;
  text-align: left !important;
}
.simple-order-table th:nth-child(5),
.simple-order-table td:nth-child(5) {
  width: 19%;
  text-align: left !important;
}

.export-ratio-layout.upload-permission-hidden {
  grid-template-columns: minmax(0, 1fr) !important;
}

.login-brand-panel {
  align-items: center;
  justify-content: center;
}
.login-brand-panel .login-logo {
  width: min(760px, 86%);
  max-width: 100%;
  margin: 0 auto;
  transform: none;
}
.sensitive-orders-modal .sensitive-role-label {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .login-brand-panel .login-logo {
    width: min(620px, 94%);
  }
}

.sidebar.glass {
  margin: 0 !important;
  border-radius: 0 !important;
}

@media (min-width: 981px), (hover: hover) and (pointer: fine) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .sidebar.glass {
    position: sticky !important;
    z-index: 300 !important;
    top: 0 !important;
    left: auto !important;
    width: auto !important;
    height: 100vh !important;
    min-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    transition: none !important;
  }

  .mobile-toggle {
    display: none !important;
  }
}

@media (max-width: 980px) and (hover: none),
       (max-width: 980px) and (pointer: coarse) {
  .app-shell {
    grid-template-columns: 1fr !important;
  }

  .sidebar.glass {
    position: fixed !important;
    z-index: 420 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: min(300px, calc(100vw - 40px)) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transform: translateX(-105%) !important;
    transition: transform .22s ease !important;
  }

  .sidebar.open {
    transform: none !important;
  }

  .mobile-toggle {
    display: grid !important;
  }
}

.manual-mapper-layout .template-analyzer-panel,
.manual-mapper-layout .template-result-panel {
  color: var(--text) !important;
  background: #fff !important;
}

.manual-mapper-layout .template-mapper-controls {
  border-color: #e5d6da !important;
  background: #fbf8f9 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95) !important;
}

.manual-mapper-layout .template-mapper-help {
  border-left-color: #8e1835 !important;
  background: #f8eef1 !important;
}

.manual-mapper-layout .template-mapper-help strong {
  color: #4b0a18 !important;
}

.manual-mapper-layout .template-mapper-help span {
  color: #665b5e !important;
}

.manual-mapper-layout .template-field-palette button {
  border-color: #ded3d6 !important;
  background: #fff !important;
  color: #3c3436 !important;
  box-shadow: 0 2px 7px rgba(73,11,24,.035) !important;
}

.manual-mapper-layout .template-field-palette button:hover {
  border-color: rgba(142,24,53,.34) !important;
  background: #fbf1f3 !important;
  color: #650b1b !important;
}

.manual-mapper-layout .template-field-palette button.active {
  border-color: #8e1835 !important;
  background: linear-gradient(135deg, #9d1b3b, #650b1b) !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(142,24,53,.10), 0 7px 18px rgba(85,8,25,.13) !important;
}

.manual-mapper-layout .template-field-palette button.assigned::before {
  color: #13825c !important;
}

.manual-mapper-layout .template-field-palette button.active.assigned::before {
  color: #a8f1d5 !important;
}

.manual-mapper-layout .template-map-chip,
.manual-mapper-layout .template-map-row-anchor {
  border-color: #e2d7da !important;
  background: #fff !important;
}

.manual-mapper-layout .template-map-chip span,
.manual-mapper-layout .template-map-row-anchor span {
  color: #807276 !important;
}

.manual-mapper-layout .template-map-chip strong,
.manual-mapper-layout .template-map-row-anchor strong {
  color: #564b4e !important;
}

.manual-mapper-layout .template-map-chip.selected {
  border-color: rgba(142,24,53,.24) !important;
  background: #fbf1f3 !important;
}

.manual-mapper-layout .template-map-chip.selected strong,
.manual-mapper-layout .template-map-row-anchor strong {
  color: #650b1b !important;
}

.manual-mapper-layout .template-map-row-anchor {
  border-color: rgba(142,24,53,.18) !important;
  background: #faf3f5 !important;
}

.manual-mapper-layout .template-preview-empty,
.manual-mapper-layout .template-preview-loading {
  border-color: #ddcdd1 !important;
  background: #fdfbfb !important;
  color: #71666a !important;
}

.manual-mapper-layout .template-loader {
  border-color: #eadde0 !important;
  border-top-color: #8e1835 !important;
}

.manual-mapper-layout .template-excel-workspace {
  border-color: #d9c9cd !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(73,11,24,.055) !important;
  color-scheme: light;
}

.manual-mapper-layout .excel-sheet-toolbar {
  border-bottom-color: #ded2d5 !important;
  background: linear-gradient(180deg, #fcfafa, #f5eff1) !important;
}

.manual-mapper-layout .excel-sheet-toolbar > span {
  color: #74686c !important;
}

.manual-mapper-layout .excel-sheet-tabs button {
  border-color: #ddd1d4 !important;
  background: #fff !important;
  color: #675b5f !important;
}

.manual-mapper-layout .excel-sheet-tabs button:hover {
  border-color: rgba(142,24,53,.30) !important;
  background: #fbf1f3 !important;
  color: #650b1b !important;
}

.manual-mapper-layout .excel-sheet-tabs button.active {
  border-color: #8e1835 !important;
  background: #8e1835 !important;
  color: #fff !important;
}

.manual-mapper-layout .excel-preview-scroll {
  background: #fff !important;
  scrollbar-color: #ad8f97 #f3edef;
}

.manual-mapper-layout .excel-preview-table {
  color: #211b1d !important;
  background: #fff !important;
}

.manual-mapper-layout .excel-preview-table th,
.manual-mapper-layout .excel-preview-table td {
  border-right-color: #e4dcde !important;
  border-bottom-color: #e4dcde !important;
}

.manual-mapper-layout .excel-preview-table thead th,
.manual-mapper-layout .excel-preview-table tbody th {
  color: #6e6266 !important;
  background: #f3edef !important;
}

.manual-mapper-layout .excel-preview-table td {
  color: #241d1f !important;
  background: color-mix(in srgb, var(--cell-bg, #fff) 16%, #fff) !important;
}

.manual-mapper-layout .excel-preview-table td:hover {
  color: #1b1517 !important;
  background: #fff3f5 !important;
  box-shadow: inset 0 0 0 2px rgba(142,24,53,.25) !important;
}

.manual-mapper-layout .excel-preview-table td:hover span {
  color: #1b1517 !important;
  background: #fff3f5 !important;
  box-shadow: 5px 0 0 #fff3f5 !important;
}

.manual-mapper-layout .excel-preview-table tr.selected-data-row td {
  background-color: #f8f3f4 !important;
}

.manual-mapper-layout .excel-preview-table td.map-first-row {
  border-top-color: rgba(101,11,27,.52) !important;
}

.manual-mapper-layout .excel-preview-table td.map-last-row {
  border-bottom-color: rgba(101,11,27,.52) !important;
}

.manual-mapper-layout .excel-preview-table td.template-range-preview {
  background: #f5dde3 !important;
  box-shadow: inset 0 0 0 2px rgba(142,24,53,.56) !important;
}

.manual-mapper-layout .excel-preview-table td.map-code {
  background: #fff5cf !important;
  box-shadow: inset 0 0 0 1px rgba(190,135,12,.52) !important;
}

.manual-mapper-layout .excel-preview-table td.map-description {
  background: #ffecdf !important;
  box-shadow: inset 0 0 0 1px rgba(207,99,35,.44) !important;
}

.manual-mapper-layout .excel-preview-table td.map-quantity {
  background: #e9f8ee !important;
  box-shadow: inset 0 0 0 1px rgba(35,145,82,.42) !important;
}

.manual-mapper-layout .excel-preview-table td.map-price {
  background: #e8f5fb !important;
  box-shadow: inset 0 0 0 1px rgba(30,135,180,.43) !important;
}

.manual-mapper-layout .excel-preview-table td.map-line-total {
  background: #f3eafb !important;
  box-shadow: inset 0 0 0 1px rgba(128,72,174,.39) !important;
}

.manual-mapper-layout .excel-preview-table td.map-supplier {
  background: #fbeaf2 !important;
  box-shadow: inset 0 0 0 1px rgba(180,67,120,.38) !important;
}

.manual-mapper-layout .excel-gap-row td {
  color: #7c7074 !important;
  background: #f6f1f2 !important;
}

.manual-mapper-layout .template-pdf-preview img {
  border-color: #ded3d6 !important;
  background: #fff !important;
}

.manual-mapper-layout .pdf-preview-note {
  border-color: rgba(142,24,53,.18) !important;
  background: #faf1f3 !important;
}

.manual-mapper-layout .pdf-preview-note strong {
  color: #650b1b !important;
}

.manual-mapper-layout .pdf-preview-note span {
  color: #6c6064 !important;
}

.manual-mapper-layout .template-analysis-result {
  border-top-color: #e4d9dc !important;
}

.manual-mapper-layout .template-analysis-success {
  border-color: rgba(21,130,91,.22) !important;
  background: #edf8f3 !important;
}

.manual-mapper-layout .template-analysis-success > span {
  color: #0d7653 !important;
  background: #dff3ea !important;
}

.manual-mapper-layout .template-analysis-success strong {
  color: #125f47 !important;
}

.manual-mapper-layout .template-analysis-success small {
  color: #52766a !important;
}

.manual-mapper-layout .template-detected-grid > div {
  border-color: #e2d7da !important;
  background: #fbf8f9 !important;
}

.manual-mapper-layout .template-detected-grid span {
  color: #796d71 !important;
}

.manual-mapper-layout .template-detected-grid strong {
  color: #2d2528 !important;
}

.manual-mapper-layout .template-mapping code,
.manual-mapper-layout .template-config-preview {
  border-color: #e0d4d7 !important;
  background: #f7f3f4 !important;
  color: #4f3f44 !important;
}

.manual-mapper-layout .template-sample-table {
  border-color: #e0d5d8 !important;
  background: #fff !important;
}

.manual-mapper-layout .template-sample-table > div {
  border-bottom-color: #e8e0e2 !important;
  color: #342b2e !important;
}

.manual-mapper-layout .template-sample-table > div:first-child {
  background: #f5eff1 !important;
  color: #6f6266 !important;
}

.manual-mapper-layout .template-warning {
  color: #8c5b08 !important;
}

.export-invoice-upload-modal {
  width: min(1240px, 100%) !important;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

@media (min-width: 981px), (hover: hover) and (pointer: fine) {
  #exportInvoiceUploadModal {
    left: var(--sidebar-width);
  }
}

.export-invoice-manual-mapper {
  margin-top: 16px;
}

.export-invoice-source-fields {
  margin-bottom: 14px;
}

.order-manual-fallback-note {
  margin: 12px 0 14px;
  border-color: rgba(204, 139, 17, .34);
  background: #fff9ea;
  color: #704a00;
}

.order-manual-template-toggle {
  min-height: 48px;
  align-self: end;
}

.export-invoice-mapper-grid {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.export-invoice-mapper-grid .template-mapper-controls {
  margin: 0;
  max-height: 58vh;
  overflow: auto;
}

.export-invoice-mapper-grid .template-excel-workspace,
.export-invoice-mapper-grid .template-preview-empty,
.export-invoice-mapper-grid .template-preview-loading {
  min-width: 0;
  min-height: 360px;
}

.export-invoice-mapper-grid .excel-preview-scroll {
  max-height: 58vh;
}

@media (max-width: 980px) {
  .export-invoice-upload-modal {
    width: min(760px, 100%) !important;
    max-height: calc(100vh - 20px);
  }

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

  .export-invoice-mapper-grid .template-mapper-controls {
    max-height: none;
  }

  .export-invoice-mapper-grid .excel-preview-scroll {
    max-height: 52vh;
  }
}

.order-preview-review {
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid rgba(204, 139, 17, .38);
  border-radius: 12px;
  background: linear-gradient(135deg, #fffaf0 0%, #fff 72%);
  box-shadow: inset 4px 0 0 #d69a22;
}
.order-preview-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.order-preview-review-head h3 {
  margin: 5px 0 0;
}
.order-preview-review-head > strong {
  padding: 9px 12px;
  border: 1px solid rgba(204, 139, 17, .34);
  border-radius: 9px;
  background: #fff4d9;
  color: #805400;
  white-space: nowrap;
}
.order-preview-review > p {
  margin: 10px 0 16px;
  color: var(--muted);
  line-height: 1.55;
}
.order-preview-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.order-preview-review-grid .field {
  margin: 0;
}
.order-preview-item-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(125, 17, 43, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .76);
}
.order-preview-item-tools-copy {
  display: grid;
  gap: 4px;
}
.order-preview-item-tools-copy span {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}
.order-preview-item-tools-actions {
  display: flex;
  gap: 9px;
  flex: 0 0 auto;
}
.order-preview-item-tools-actions button {
  min-height: 40px;
  padding: 9px 14px;
}
.order-preview-items-table {
  min-width: 1040px;
}
.order-preview-items-table .preview-item-input {
  width: 100%;
  min-width: 96px;
  height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(125, 17, 43, .22);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.order-preview-items-table .preview-item-input:focus {
  outline: 2px solid rgba(125, 17, 43, .14);
  border-color: var(--wine);
}
.order-preview-items-table .preview-item-code {
  min-width: 150px;
  font-weight: 800;
}
.order-preview-items-table .preview-item-description {
  min-width: 280px;
}
.order-preview-items-table .preview-item-number {
  min-width: 112px;
  font-variant-numeric: tabular-nums;
}
.preview-item-remove {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(190, 35, 61, .28);
  border-radius: 8px;
  background: #fff2f4;
  color: #a31732;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.preview-item-remove:hover {
  background: #fde3e8;
}
.order-preview-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-weight: 750;
  line-height: 1.45;
}
.order-preview-confirm input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--wine);
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  .order-preview-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .order-preview-review-head {
    flex-direction: column;
  }
  .order-preview-review-grid {
    grid-template-columns: 1fr;
  }
  .order-preview-item-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .order-preview-item-tools-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
