:root {
  color-scheme: dark;
  --bg: #120e15;
  --surface: #1c1621;
  --surface-2: #261e2d;
  --surface-3: #31273a;
  --line: #44364d;
  --text: #f8f5f8;
  --muted: #afa5b4;
  --red: #ef3340;
  --red-2: #b91f2b;
  --green: #38c77b;
  --blue: #4c8dff;
  --orange: #ff9d4a;
  --yellow: #f4cb55;
  --shadow: 0 16px 50px rgba(0,0,0,.28);
  --app-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--app-font);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f1f4;
  --surface: #ffffff;
  --surface-2: #ebe7ed;
  --surface-3: #ded7e2;
  --line: #d2c9d6;
  --text: #201b22;
  --muted: #6e6472;
  --shadow: 0 14px 40px rgba(47,31,50,.12);
}
html,body,body *,body *::before,body *::after { font-family:var(--app-font); }
button,input,select,textarea { font:inherit; }
[data-theme="light"] .topbar { background: rgba(255,255,255,.96); }
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea { background: #fff; }
[data-theme="light"] th { background: #e7e1e9; color: #332b37; }
[data-theme="light"] td { border-bottom-color: #e2dce5; }
[data-theme="light"] .icon-btn img,
[data-theme="light"] .btn img,
[data-theme="light"] .wallet-card img { filter: none; }
* { box-sizing: border-box; }
[hidden] { display:none!important; }
html {
  min-height:100%;
  background:var(--bg);
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body { margin:0; min-width:320px; min-height:100vh; min-height:100dvh; background:var(--bg); color:var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.network-banner { position: fixed; inset: 0 0 auto; z-index: 100; padding: 10px; background: #9d1c26; text-align: center; font-weight: 800; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 80% 15%, rgba(239,51,64,.13), transparent 28%), var(--bg); }
.login-panel { width: min(420px,100%); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); padding: 34px; border-radius: 8px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 900; font-size: 20px; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #ff6370; background: var(--red); color: white; font-weight: 950; border-radius: 6px; }
.login-panel h1 { margin: 34px 0 8px; font-size: 28px; }
.login-panel p { color: var(--muted); margin: 0 0 26px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span, .field > label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #17121b; color: var(--text); padding: 11px 12px; border-radius: 6px; outline: none; }
textarea { min-height: 86px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,51,64,.12); }
.data-reset-panel .panel-head { border-bottom:1px solid var(--line); }
.data-reset-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:20px; padding:20px; }
.data-reset-actions h3 { margin:0 0 6px; }
.data-reset-actions p { margin:0; }
.data-reset-divider { height:1px; margin:0 20px; background:linear-gradient(90deg,transparent,var(--red),transparent); opacity:.75; }
.selective-reset-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.selective-reset-option { display:flex; align-items:flex-start; gap:11px; min-width:0; padding:13px; border:1px solid var(--line); border-radius:6px; background:var(--surface-2); cursor:pointer; }
.selective-reset-option:hover { border-color:rgba(255,100,113,.48); }
.selective-reset-option input { width:18px; height:18px; margin:2px 0 0; flex:0 0 auto; accent-color:var(--red); }
.selective-reset-option span { min-width:0; }
.selective-reset-option strong,.selective-reset-option small { display:block; }
.selective-reset-option small { margin-top:5px; color:var(--muted); line-height:1.45; }
.selective-reset-option.reset-all-option { grid-column:1/-1; border-color:rgba(255,100,113,.42); background:rgba(239,51,64,.08); }
.selective-reset-preview { display:grid; gap:0; overflow:hidden; border:1px solid var(--line); border-radius:6px; }
.selective-reset-preview > div { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 12px; border-bottom:1px solid var(--line); }
.selective-reset-preview > div:last-of-type { border-bottom:0; }
.selective-reset-preview-head { background:var(--surface-2); }
.selective-reset-preview > small { padding:10px 12px; color:var(--muted); }
.selective-reset-confirm { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
@media (max-width:700px) {
  .data-reset-actions { grid-template-columns:1fr; }
  .data-reset-actions .btn { width:100%; }
  .selective-reset-grid,.selective-reset-confirm { grid-template-columns:1fr; }
}
.stack { display: grid; gap: 16px; }
.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 50; min-height: 66px; display: flex; align-items: center; gap: 18px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: rgba(18,14,21,.96); backdrop-filter: blur(16px); }
.main-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-btn { border: 0; background: transparent; color: var(--muted); padding: 10px 12px; border-radius: 5px; white-space: nowrap; font-weight: 750; }
.nav-btn:hover, .nav-btn.active { color: white; background: var(--surface-2); }
.nav-btn.active { box-shadow: inset 0 -2px var(--red); }
.user-zone { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.theme-toggle { min-width:92px; }
.avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--red); font-weight: 900; }
.work-badge { position: absolute; right: -7px; top: -7px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 20px; background: white; color: #211622; border: 2px solid var(--bg); font-size: 10px; }
.mobile-monthly-work { display:none; }
.user-copy strong, .user-copy small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.user-copy small { color: var(--muted); margin-top: 2px; }
.icon-btn { position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); color: var(--text); background: var(--surface-2); border-radius: 6px; }
.icon-btn img { width: 19px; height: 19px; filter: brightness(0) invert(1); }
.notification-count { position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 20px; background: var(--red); color: white; font-size: 10px; font-weight: 900; }
.notifications-wrap { position:relative; }
.notification-button { width:40px; height:40px; border-radius:8px; background:var(--surface); }
.notification-button img { width:22px; height:22px; }
.notification-button:hover,
.notification-button[aria-expanded="true"] { border-color:rgba(255,100,113,.45); background:rgba(227,32,47,.1); }
.notification-count {
  top:-6px; right:-6px; min-width:19px; height:19px; padding:0 5px;
  border:2px solid var(--bg); border-radius:10px; font-size:9px; font-weight:950;
}
.notification-menu {
  position:absolute; top:50px; right:0; z-index:80; width:min(360px,calc(100vw - 24px));
  overflow:hidden; border:1px solid var(--line); border-radius:8px;
  background:#19191f; box-shadow:0 28px 70px rgba(0,0,0,.52);
}
.notification-menu-head {
  min-height:52px; padding:0 13px; display:flex; align-items:center;
  justify-content:space-between; gap:12px; border-bottom:1px solid var(--line);
}
.notification-menu-head strong { font-size:12px; }
.notification-menu-head button {
  padding:0; border:0; background:transparent; color:#ff6471;
  font-size:9px; font-weight:900;
}
.notification-menu-list { max-height:min(430px,calc(100vh - 90px)); overflow:auto; }
.notification-item {
  width:100%; padding:12px 13px; display:grid; grid-template-columns:8px minmax(0,1fr) auto;
  align-items:start; gap:9px; border:0; border-bottom:1px solid rgba(255,255,255,.06);
  color:var(--text); background:transparent; text-align:left;
}
.notification-item:last-child { border-bottom:0; }
.notification-item:hover { background:rgba(255,255,255,.035); }
.notification-item.unread { background:rgba(227,32,47,.08); }
.notification-item.unread:hover { background:rgba(227,32,47,.13); }
.notification-dot { width:7px; height:7px; margin-top:4px; border-radius:50%; background:#5e5965; }
.notification-item.unread .notification-dot { background:var(--red); box-shadow:0 0 10px rgba(227,32,47,.6); }
.notification-copy strong,.notification-copy span { display:block; }
.notification-copy strong { font-size:10px; }
.notification-copy span { margin-top:4px; color:var(--muted); font-size:9px; line-height:1.4; }
.notification-item time { color:#78727f; font-size:8px; white-space:nowrap; }
.notification-empty { padding:28px 14px; color:var(--muted); font-size:11px; text-align:center; }
[data-theme="light"] .notification-menu { background:#fff; }
[data-theme="light"] .notification-item { border-bottom-color:#ece7ee; }
[data-theme="light"] .notification-item.unread { background:rgba(227,32,47,.06); }
.equipment-prep-modal { width:min(1220px,calc(100% - 32px)); }
.equipment-prep-modal .modal-body { padding:0; }
.equipment-prep-form { padding:22px; }
.equipment-prep-panel-head {
  min-height:64px; margin:-22px -22px 22px; padding:0 22px;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  border-bottom:1px solid var(--line);
}
.equipment-prep-panel-head h3 { margin:0; font-size:16px; }
.equipment-prep-panel-head p { margin:5px 0 0; color:var(--muted); font-size:11px; }
.equipment-prep-panel-head > span {
  min-height:29px; padding:0 10px; display:inline-flex; align-items:center;
  border-radius:7px; color:var(--muted); background:var(--surface-3);
  font-size:9px; font-weight:950; white-space:nowrap;
}
.equipment-preset-toolbar {
  display:grid; grid-template-columns:minmax(220px,1fr) repeat(4,auto);
  gap:10px; align-items:end; margin-bottom:14px; padding:12px;
  border:1px solid var(--line); border-radius:8px; background:var(--surface-2);
}
.equipment-preset-toolbar .btn { min-height:42px; white-space:nowrap; }
.equipment-order-picker {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px;
  align-items:end; margin-bottom:17px;
}
.equipment-order-info {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:18px;
}
.equipment-order-info > div {
  min-height:72px; padding:13px; border:1px solid var(--line);
  border-radius:8px; background:var(--surface-3);
}
.equipment-order-info span,.equipment-order-info strong { display:block; }
.equipment-order-info span { color:var(--muted); font-size:9px; font-weight:900; text-transform:uppercase; }
.equipment-order-info strong { margin-top:7px; font-size:11px; line-height:1.45; }
.equipment-prep-notice {
  display:none; padding:13px 15px; margin-bottom:17px; border:1px solid rgba(242,184,75,.2);
  border-radius:8px; color:var(--yellow); background:rgba(242,184,75,.08);
  font-size:11px; font-weight:850;
}
.equipment-prep-notice.show { display:block; }
.equipment-prep-notice.error { color:#ff8a94; border-color:rgba(255,77,95,.22); background:rgba(255,77,95,.08); }
.equipment-prep-list { display:grid; gap:12px; }
.equipment-prep-row {
  display:grid; grid-template-columns:150px minmax(0,1fr); gap:14px; align-items:start;
  padding:15px; border:1px solid var(--line); border-radius:8px; background:var(--surface-2);
}
.equipment-prep-row > strong { min-height:42px; display:flex; align-items:center; font-size:12px; }
.equipment-selection-stack { display:grid; gap:8px; }
.equipment-selection-line { display:grid; grid-template-columns:minmax(0,1fr) 42px 42px; gap:8px; }
.equipment-selection-line select { min-height:42px; }
.equipment-selection-line .btn { min-width:42px; padding:0; font-size:16px; }
.equipment-selection-line .btn:disabled { opacity:.35; cursor:not-allowed; }
.equipment-prep-counter-row { align-items:center; }
.equipment-counter-grid { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:10px; }
.equipment-counter-card {
  min-height:72px; padding:10px; display:flex; align-items:center; justify-content:space-between; gap:10px;
  border:1px solid var(--line); border-radius:8px; background:var(--surface);
}
.equipment-counter-card > span { color:var(--muted); font-size:10px; font-weight:950; white-space:nowrap; }
.equipment-counter { display:flex; align-items:center; gap:9px; }
.equipment-counter output {
  width:68px; min-height:42px; display:grid; place-items:center;
  border:1px solid var(--line); border-radius:7px; background:#111117;
  font-size:14px; font-weight:950;
}
.equipment-monitor { min-height:42px; display:flex; align-items:center; gap:10px; color:var(--muted); font-size:11px; font-weight:850; }
.equipment-monitor input { width:19px; height:19px; min-height:19px; accent-color:var(--red); }
.equipment-prep-row textarea { min-height:88px; }
.equipment-prep-actions { display:flex; justify-content:flex-end; margin-top:18px; }
.equipment-prep-actions .btn { min-height:46px; min-width:160px; }
.equipment-prep-state { margin-top:12px; color:var(--muted); font-size:10px; font-weight:800; text-align:right; }
[data-theme="light"] .equipment-counter output { background:#fff; }
[data-theme="light"] .equipment-counter-card { background:#fff; }
.shoot-completion-panel .panel-head { min-height:64px; }
.shoot-completion-chip {
  min-height:29px; padding:0 12px; display:inline-flex; align-items:center;
  border-radius:16px; color:var(--muted); background:var(--surface-3);
  font-size:10px; font-weight:900;
}
.prepared-equipment-summary {
  padding:14px 16px; border:1px solid rgba(255,77,95,.22);
  border-radius:8px; color:#cbc4d0; background:rgba(227,32,47,.07);
  font-size:12px; font-weight:750; line-height:1.55;
}
.shoot-completion-actions {
  display:flex; gap:10px; margin-top:14px;
}
.shoot-action-buttons,
.shoot-status-pair {
  display:contents;
}
.shoot-action-buttons > *,
.shoot-status-pair > * {
  width:100%; min-width:0; flex:1 1 0; justify-content:center;
}
.shoot-complete-button {
  min-height:42px; padding-inline:18px; color:#07170f!important;
  border-color:#35d07f!important; background:#35d07f!important;
}
.shoot-complete-button:hover { background:#55df94!important; }
.shoot-complete-button:disabled { opacity:.7; cursor:not-allowed; }
.shoot-workflow-status {
  min-height:38px; padding:0 12px; display:inline-flex; align-items:center;
  border-radius:8px; color:#f3bd4d; background:rgba(242,184,75,.09);
  font-size:11px; font-weight:900;
}
.shoot-workflow-status.complete { color:#64dfa0; background:rgba(53,208,127,.1); }
[data-theme="light"] .prepared-equipment-summary { color:#554c58; }
.payout-rules-section { margin-top:18px; }
.payout-section-heading {
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px; margin-bottom:14px;
}
.payout-section-heading h2 { margin:0; font-size:20px; }
.payout-section-heading p { margin:6px 0 0; color:var(--muted); font-size:12px; font-weight:700; }
.payout-rate-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.payout-role-card {
  padding:20px; border:1px solid var(--line); border-radius:24px;
  background:
    radial-gradient(circle at 0 100%,rgba(215,25,32,.1),transparent 32%),
    linear-gradient(145deg,rgba(51,40,63,.92),rgba(33,26,45,.88));
}
.payout-role-title {
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:14px;
}
.payout-role-title h3 { margin:0; font-size:15px; }
.payout-chip {
  min-height:30px; padding:0 11px; border-radius:15px;
  display:inline-flex; align-items:center; color:var(--muted);
  background:var(--surface-3); font-size:10px; font-weight:900; white-space:nowrap;
}
.payout-rate-list { display:grid; gap:9px; }
.payout-rate-row {
  min-height:54px; padding:8px 12px; border-radius:17px;
  display:grid; grid-template-columns:minmax(0,1fr) 105px 34px;
  align-items:center; gap:10px; background:rgba(68,57,79,.68);
}
.payout-rate-row > span { font-size:12px; font-weight:850; }
.payout-rate-row > strong { color:#fff; font-size:13px; font-weight:950; text-align:right; white-space:nowrap; }
.payout-edit-btn {
  width:34px; height:34px; padding:0; border:1px solid var(--line);
  border-radius:12px; display:grid; place-items:center;
  color:#fff; background:var(--surface-3);
}
.payout-edit-btn:hover { border-color:#6b586f; background:#46394f; }
.payout-edit-btn img { width:16px; height:16px; filter:brightness(0) invert(1); }
.payout-empty-role {
  min-height:54px; padding:12px; border-radius:17px; display:grid; place-items:center;
  color:var(--muted); background:rgba(68,57,79,.35); font-size:12px; font-weight:800;
}
.payout-special-note {
  margin-top:16px; padding:16px; border:1px solid rgba(255,77,95,.18);
  border-radius:20px; color:var(--muted); background:rgba(255,77,95,.08);
  font-size:12px; font-weight:750; line-height:1.6;
}
.payout-history-panel { margin-top:16px; }
.payout-version-status {
  min-height:28px; padding:0 10px; border-radius:14px;
  display:inline-flex; align-items:center; font-size:10px; font-weight:950; white-space:nowrap;
}
.payout-version-status.active { color:#64dfa0; background:rgba(53,208,127,.12); }
.payout-version-status.archived { color:var(--muted); background:rgba(255,255,255,.06); }
.payout-form-warning {
  padding:13px 14px; border:1px solid rgba(242,184,75,.22); border-radius:8px;
  color:var(--yellow); background:rgba(242,184,75,.08); font-size:11px; font-weight:800; line-height:1.5;
}
[data-theme="light"] .payout-role-card {
  background:radial-gradient(circle at 0 100%,rgba(215,25,32,.08),transparent 32%),linear-gradient(145deg,#fff,#f2edf4);
}
[data-theme="light"] .payout-rate-row { background:#e8e1eb; }
[data-theme="light"] .payout-rate-row > strong { color:var(--text); }
[data-theme="light"] .payout-edit-btn img { filter:none; }
[data-theme="light"] .payout-version-status.archived { background:#ebe7ed; }
.page { width: min(1500px,100%); margin: auto; padding: 28px 24px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; }
.page-head p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { min-height: 40px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text); font-weight: 800; }
.btn:hover { border-color: #6b586f; background: var(--surface-3); }
.btn.primary { background: var(--red); border-color: var(--red); color: white; }
.btn.primary:hover { background: #ff4552; }
.btn.danger { color: #ff8b94; border-color: #6c2e37; }
.btn.success { color: #7fe5ad; border-color: #2c6a49; }
.btn.small { min-height: 32px; padding: 6px 9px; font-size: 12px; }
.btn img { width: 17px; height: 17px; vertical-align: middle; filter: brightness(0) invert(1); }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.stat { border: 1px solid var(--line); border-top: 3px solid var(--red); background: var(--surface); padding: 18px; border-radius: 6px; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 800; }
.stat strong { display: block; margin-top: 10px; font-size: 28px; }
.stat.green { border-top-color: var(--green); }
.stat.blue { border-top-color: var(--blue); }
.stat.yellow { border-top-color: var(--yellow); }
.orders-finance-summary { margin-bottom: 16px; }
.orders-business-panel { margin-bottom:16px; overflow:hidden; }
.orders-business-toggle {
  width:100%; min-height:76px; padding:16px 20px; display:flex; align-items:center;
  justify-content:space-between; gap:16px; border:0; color:var(--text); background:transparent;
  text-align:start;
}
.orders-business-toggle > span:first-child { min-width:0; display:grid; gap:4px; }
.orders-business-toggle strong { font-size:16px; }
.orders-business-toggle small { color:var(--muted); font-size:11px; font-weight:700; }
.orders-business-chevron { flex:0 0 auto; font-size:26px; line-height:1; transition:transform .18s ease; }
.orders-business-toggle[aria-expanded="true"] .orders-business-chevron { transform:rotate(180deg); }
.orders-business-content { border-top:1px solid var(--line); }
.orders-business-content[hidden] { display:none!important; }
.orders-business-content .orders-finance-summary,
.orders-business-content .orders-export-panel { margin:0; border:0; border-radius:0; box-shadow:none; }
.orders-business-content .orders-export-panel { border-top:2px solid var(--line); }
.orders-business-content .orders-export-panel .panel-head { background:var(--surface-2); }
.finance-summary-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; padding:14px; }
.finance-summary-grid .stat { margin:0; padding:14px; min-height:126px; }
.finance-summary-grid .stat strong { font-size:21px; line-height:1.2; }
.finance-summary-grid .stat small { display:block; margin-top:8px; color:var(--muted); font-weight:750; line-height:1.35; }
.summary-filter { display:flex; gap:8px; align-items:center; }
.summary-filter select { min-width:118px; }
.orders-export-panel { margin-bottom:16px; }
.orders-export-form { display:grid; grid-template-columns:1.2fr 1fr 1fr 1fr 1fr auto; gap:12px; align-items:end; padding:14px; }
.orders-export-form .field { margin:0; }
.orders-export-form .btn { min-width:132px; }
.cash-statistics-panel { margin:16px 0; }
.cash-statistics-panel > summary { cursor:pointer; list-style:none; }
.cash-statistics-panel > summary::-webkit-details-marker { display:none; }
.cash-statistics-panel > summary:focus-visible { outline:2px solid var(--primary,#ef3340); outline-offset:-3px; }
.cash-statistics-panel:not([open]) > summary { border-bottom:0; }
.cash-statistics-chevron { font-size:22px; }
.cash-statistics-panel[open] .cash-statistics-chevron { transform:rotate(180deg); }
.cash-statistics-description { margin:14px 14px 0; }
.cash-report-stack { display:grid; gap:10px; padding:14px; }
.cash-report-card { display:grid; grid-template-columns:minmax(180px,1fr) 2fr auto; gap:14px; align-items:center; border:1px solid var(--line); background:rgba(255,255,255,.025); border-radius:7px; padding:14px; }
.cash-report-title strong { display:block; font-size:17px; }
.cash-report-title span { display:block; margin-top:5px; color:var(--muted); font-size:12px; font-weight:750; }
.cash-report-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.cash-report-metrics div { border:1px solid var(--line); border-radius:6px; padding:10px; background:var(--surface-2); }
.cash-report-metrics span { display:block; color:var(--muted); font-size:11px; font-weight:850; text-transform:uppercase; }
.cash-report-metrics strong { display:block; margin-top:6px; font-size:17px; }
.cash-report-actions { display:flex; gap:8px; justify-content:flex-end; }
.finance-monthly-note { margin-bottom:14px; border:1px solid rgba(76,141,255,.38); background:rgba(76,141,255,.12); color:#cfe0ff; border-radius:7px; padding:12px 14px; font-weight:850; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,.55fr); gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-body { padding: 16px; }
.recurring-strip { display:flex; gap:8px; flex-wrap:wrap; padding:12px 16px 16px; border-top:1px solid var(--line); }
.recurring-strip span { border:1px solid var(--line); background:var(--surface-2); color:var(--muted); border-radius:6px; padding:7px 9px; font-size:11px; font-weight:800; }
.filters { display: grid; grid-template-columns: minmax(220px,1fr) repeat(2,minmax(140px,220px)) auto auto; gap: 8px; margin-bottom: 16px; }
.table-wrap { overflow:auto; max-height:min(620px,68vh); }
.users-table th:first-child,
.users-table td:first-child {
  width:112px;
  min-width:112px;
  max-width:112px;
  white-space:nowrap;
  overflow-wrap:normal;
  word-break:normal;
}
.table-wrap.bounded-data-region {
  max-height:min(520px,56vh);
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  border-bottom:1px solid var(--line);
  background:var(--surface);
  box-shadow:inset 0 12px 12px -16px rgba(0,0,0,.75),inset 0 -14px 14px -18px rgba(0,0,0,.9);
}
.table-wrap.bounded-data-region:focus-visible { outline:2px solid var(--blue); outline-offset:-2px; }
.table-wrap.bounded-data-region::-webkit-scrollbar { width:10px; height:10px; }
.table-wrap.bounded-data-region::-webkit-scrollbar-track { background:var(--surface); }
.table-wrap.bounded-data-region::-webkit-scrollbar-thumb { border:3px solid var(--surface); border-radius:8px; background:var(--surface-3); }
.table-wrap.bounded-data-region::-webkit-scrollbar-thumb:hover { background:var(--muted); }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th { position: sticky; top: 0; z-index: 2; background: #2a2130; color: #d9d0dd; text-align: left; font-size: 11px; text-transform: uppercase; padding: 11px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid #352a3d; font-size: 13px; vertical-align: top; }
tbody tr:hover { background: rgba(255,255,255,.025); }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 20px; background: #352a3d; color: #ddd3e1; font-size: 11px; font-weight: 850; white-space: nowrap; }
.status.Active,.status.Ready,.status.Paid,.status.Delivered,.status.Earned { background: rgba(56,199,123,.13); color: #71e3a6; }
.status.Urgent,.status.Cancelled,.status.Inactive,.status.Out { background: rgba(239,51,64,.14); color: #ff7d87; }
.status.Editing,.status.Booked,.status.Pending { background: rgba(76,141,255,.14); color: #82adff; }
.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 850; white-space: nowrap; }
.money.positive { color: var(--green); }
.money.negative { color: #ff7782; }
.cards { display: grid; gap: 12px; }
.order-card { border: 1px solid var(--line); background: var(--surface); padding: 16px; border-radius: 7px; display: grid; grid-template-columns: 150px 1fr auto; gap: 18px; }
.date-block { border-right: 1px solid var(--line); }
.date-block strong { display: block; font-size: 20px; }
.order-card h3 { margin: 0 0 7px; font-size: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 7px 16px; color: var(--muted); font-size: 12px; }
.notes-preview { margin: 12px 0 0; color: #d9d1dc; }
.timeline { position: relative; display: grid; gap: 12px; }
.timeline:before { content:""; position:absolute; left: 102px; top:0; bottom:0; width:1px; background:var(--line); }
.timeline-row { display:grid; grid-template-columns:84px 18px 1fr; gap:10px; align-items:start; }
.timeline-dot { width:12px; height:12px; margin-top:17px; border-radius:50%; background:var(--red); box-shadow:0 0 0 5px var(--bg); z-index:1; }
.timeline-date { padding-top:12px; color:var(--muted); font-size:12px; text-align:right; }
.wallet-grid { display: grid; grid-template-columns: repeat(4,minmax(220px,1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.wallet-card { min-width: 220px; border: 1px solid var(--line); background: var(--surface); border-top: 3px solid var(--green); padding: 16px; border-radius: 7px; }
.wallet-card.Bank-Acc { border-top-color: var(--blue); }
.wallet-card.Instapay { border-top-color: var(--orange); }
.wallet-card.Vodafone-Cash { border-top-color: var(--red); }
.wallet-card header { display:flex; justify-content:space-between; gap:10px; }
.wallet-card-actions { display:flex; align-items:flex-start; gap:8px; }
.wallet-card img { width:22px; height:22px; filter:brightness(0) invert(1); }
.wallet-card strong { display:block; font-size:23px; margin:18px 0 7px; }
.wallet-description { display:block; margin-top:4px; color:var(--muted); line-height:1.35; }
.wallet-edit-details { display:grid; place-items:center; width:28px; height:28px; border:1px solid var(--line); border-radius:7px; background:var(--surface-2); }
.wallet-edit-details img { width:13px; height:13px; filter:brightness(0) invert(1); }
.wallet-default-button { width:max-content; margin-top:10px; }
.warning-note { color:#ff818b; font-size:11px; margin-top:8px; }
.tabs { display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--line); margin-bottom:18px; }
.tab { border:0; border-bottom:2px solid transparent; background:transparent; color:var(--muted); padding:12px 14px; white-space:nowrap; font-weight:800; }
.tab.active { color:white; border-color:var(--red); }
.form-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.form-grid .wide { grid-column:1/-1; }
.form-grid .span-2 { grid-column:span 2; }
.check { display:flex; gap:9px; align-items:center; min-height:42px; color:#ddd4e0; }
.check input { width:18px; height:18px; accent-color:var(--red); }
.modal-backdrop { position:fixed; inset:0; z-index:80; display:grid; place-items:center; padding:20px; background:rgba(6,4,7,.78); }
.modal { width:min(960px,100%); max-height:calc(100vh - 40px); overflow:auto; border:1px solid var(--line); background:var(--surface); box-shadow:var(--shadow); border-radius:8px; }
.modal.small { width:min(520px,100%); }
.modal-head { position:sticky; top:0; z-index:4; display:flex; justify-content:space-between; align-items:center; padding:16px 18px; border-bottom:1px solid var(--line); background:var(--surface); }
.modal-head h2 { margin:0; font-size:18px; }
.modal-body { padding:18px; }
.modal-foot { position:sticky; bottom:0; display:flex; justify-content:flex-end; gap:8px; padding:14px 18px; border-top:1px solid var(--line); background:var(--surface); }
.close { border:0; background:transparent; color:var(--muted); font-size:25px; }
.message-root { position:fixed; right:18px; bottom:18px; z-index:120; display:grid; gap:8px; }
.message { max-width:420px; border:1px solid #6d3540; background:#321b22; color:white; padding:12px 14px; border-radius:6px; box-shadow:var(--shadow); }
.message.ok { border-color:#2e6b4a; background:#163324; }
.empty { padding:32px; color:var(--muted); text-align:center; }
.rank-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:20px; }
.rank-card { border:1px solid var(--line); background:var(--surface); padding:18px; border-radius:7px; }
.rank-card .encourage { color:var(--green); margin-top:14px; font-weight:900; font-size:12px; }
.permission-grid { min-width:900px; }
.permission-grid td:not(:first-child),.permission-grid th:not(:first-child) { text-align:center; }
.permission-grid input { width:17px; height:17px; accent-color:var(--red); }
.print-only { display:none; }
@media (max-width:1100px) {
  .topbar { flex-wrap:wrap; gap:8px; padding:9px 14px; }
  .brand { order:1; }
  .user-zone { order:2; margin-left:auto; }
  .main-nav { order:3; flex-basis:100%; }
  .stats { grid-template-columns:repeat(2,1fr); }
  .finance-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .orders-export-form { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .orders-export-form .btn { width:100%; }
  .cash-report-card { grid-template-columns:1fr; align-items:stretch; }
  .cash-report-actions { justify-content:flex-start; }
  .grid-2 { grid-template-columns:1fr; }
  .wallet-grid { grid-template-columns:repeat(4,260px); }
  .upcoming-filters { grid-template-columns:auto auto 1fr; }
  .upcoming-filters select { display:none; }
  .upcoming-event { grid-template-columns:minmax(180px,1fr) repeat(2,minmax(118px,.75fr)) auto auto; grid-template-areas:"main due location status open" "main execution editor status open"; gap:13px 16px; }
}
@media (max-width:700px) {
  .page { padding:20px 12px 50px; }
  .page-head { align-items:stretch; flex-direction:column; }
  .page-head .actions .btn { flex:1; }
  .user-copy { display:none; }
  .theme-toggle { min-width:0; padding-inline:9px; }
  .stats { grid-template-columns:1fr 1fr; gap:8px; }
  .finance-summary-grid { grid-template-columns:1fr; gap:8px; padding:10px; }
  .summary-filter { width:100%; }
  .summary-filter select { flex:1 1 0; min-width:0; }
  .orders-export-form { grid-template-columns:1fr; padding:10px; }
  .cash-report-stack { padding:10px; }
  .cash-report-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stat { padding:13px; }
  .stat strong { font-size:22px; }
  .filters { grid-template-columns:1fr 1fr; }
  .filters input { grid-column:1/-1; }
  .order-card { grid-template-columns:1fr; gap:10px; }
  .date-block { border-right:0; border-bottom:1px solid var(--line); padding-bottom:10px; }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .span-2 { grid-column:auto; }
  .rank-strip { grid-template-columns:1fr; }
  .timeline:before { left:76px; }
  .timeline-row { grid-template-columns:60px 18px 1fr; }
}
@media print {
  :root { color-scheme:light; }
  body { background:white; color:#111; }
  .topbar,.page-head .actions,.tabs,.no-print,.message-root,.network-banner { display:none!important; }
  .page { width:100%; padding:0; }
  .panel,.stat,.order-card { border-color:#bbb; background:white; break-inside:avoid; }
  .print-only { display:block; }
  table { min-width:0; }
  th { position:static; background:#eee; color:#111; }
  td { border-color:#ddd; }
  .muted { color:#555; }
}

/* V1.1 visual system, matched to the approved HTML previews. */
:root {
  --bg:#08040e;
  --surface:#251d31;
  --surface-2:#30263b;
  --surface-3:#44394f;
  --line:rgba(255,255,255,.09);
  --red:#d71920;
  --red-2:#ff4d5f;
  --muted:#c4bdcf;
}
body {
  background:
    radial-gradient(circle at 0 42%,rgba(215,25,32,.16),transparent 20%),
    linear-gradient(125deg,#05010c,#11091f 55%,#07030d);
}
.topbar { min-height:78px; padding:12px 28px; background:rgba(11,6,20,.92); backdrop-filter:blur(20px); }
.brand-mark { width:38px; height:38px; border-radius:11px; background:#2b2238; color:var(--red-2); border-color:var(--line); }
.nav-btn { min-height:40px; border-radius:14px; font-size:13px; }
.nav-btn.active { background:rgba(255,77,95,.16); box-shadow:inset 0 0 0 1px rgba(255,77,95,.18); }
.avatar { width:42px; height:42px; background:#f3d94e; color:#211a2d; box-shadow:0 0 0 4px rgba(255,77,95,.17); }
.page { width:min(1280px,calc(100% - 48px)); padding-top:34px; }
.page-head h1 { font-size:30px; }
.panel,.order-card,.stat,.wallet-card { background:linear-gradient(145deg,#2d2438,#211a2b); border-color:var(--line); }
.panel { border-radius:18px; }
.order-card { border-radius:22px; }
.btn { border-radius:14px; min-height:42px; background:#2b2238; }
.btn.primary { border:0; background:linear-gradient(90deg,var(--red),var(--red-2),#ff8a94); box-shadow:0 12px 26px rgba(215,25,32,.22); }
.icon-btn { border-radius:12px; background:#44394f; }
input,select,textarea { min-height:46px; border-radius:16px; background:#30263b; }
textarea { min-height:96px; }
.modal { width:min(1100px,100%); border-radius:28px; background:#160e23; }
.modal-head { padding:18px 24px; background:#251d31; }
.modal-body { padding:24px; }
.modal-foot { padding:16px 24px; background:#120a20; }
.modal-subtitle { margin:-8px 0 4px; color:var(--muted); font-size:12px; font-weight:700; }
.form-section { padding:20px; border:1px solid var(--line); border-radius:24px; background:#251d31; }
.section-title { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-bottom:20px; }
.section-title h3 { margin:0; font-size:15px; }
.section-title span { color:var(--muted); font-size:10px; font-weight:850; }
.payout-rule-note { margin:-10px 0 18px; color:var(--muted); font-size:10px; font-weight:700; line-height:1.55; }
.form-grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.company-check { align-self:end; }
.team-picker-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.external-crew-balance { display:flex; flex-direction:column; justify-content:center; gap:4px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; }
.external-crew-balance span,.external-crew-balance small { color:var(--muted); }
.profit-calculation { display:grid; gap:12px; }
.profit-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.profit-summary>div { display:flex; flex-direction:column; gap:5px; padding:12px; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); }
.profit-summary span,.profit-summary small,.profit-cash-note { color:var(--muted); }
.profit-summary strong { font-size:18px; }
.profit-breakdown { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.profit-breakdown>div { display:flex; justify-content:space-between; gap:16px; padding:9px 12px; border-bottom:1px solid var(--line); }
.profit-breakdown>div:nth-child(odd) { border-right:1px solid var(--line); }
.profit-cash-note { display:flex; justify-content:space-between; gap:12px; font-size:12px; }
@media (max-width:760px) { .profit-summary,.profit-breakdown { grid-template-columns:1fr; } .profit-breakdown>div:nth-child(odd) { border-right:0; } .profit-cash-note { flex-direction:column; } }
.team-picker { min-height:92px; padding:12px; border:1px solid var(--line); border-radius:18px; background:#21192b; }
.team-label { display:block; margin-bottom:9px; color:var(--muted); font-size:11px; font-weight:900; }
.team-chips { display:flex; flex-wrap:wrap; gap:7px; min-height:27px; }
.team-chip { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border-radius:14px; background:#4b3e58; font-size:11px; font-weight:800; }
.team-chip button { border:0; padding:0; background:transparent; color:#ff7884; font-weight:950; }
.team-add {
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  gap:8px;
  align-items:stretch;
  margin-top:8px;
}
.team-add select,
.team-add .add-team {
  width:100%;
  height:48px;
  min-height:48px;
  border-radius:16px;
}
.team-add select { padding-block:0; }
.team-add .add-team {
  border-color:rgba(255,77,95,.32);
  color:#fff;
  background:rgba(215,25,32,.13);
  font-size:22px;
  font-weight:800;
  line-height:1;
}
.team-add .add-team:hover {
  border-color:rgba(255,77,95,.7);
  background:rgba(215,25,32,.28);
}
.payout-card { padding:16px; border:1px solid var(--line); border-radius:20px; background:#21192b; }
.payout-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
.payout-card-top > div { display:flex; gap:7px; }
.employee-heading,.employee-field-label { color:#ff6573!important; font-weight:950!important; }
.employee-expense-wrap { padding:14px; border:1px solid rgba(255,77,95,.25); border-radius:18px; background:#21192b; }
.employee-expense-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.employee-expense-row { display:grid; grid-template-columns:1.15fr .8fr .65fr 1.2fr 42px; gap:10px; align-items:end; padding:10px 0; border-bottom:1px solid var(--line); }
.employee-expense-row:last-child { border-bottom:0; }
.wallet-edit-opening { display:inline-grid; place-items:center; width:22px; height:22px; margin-left:5px; border:1px solid var(--line); border-radius:7px; background:#44394f; vertical-align:middle; }
.wallet-edit-opening img { width:12px; height:12px; filter:brightness(0) invert(1); }
.notification-card { width:100%; display:flex; justify-content:space-between; gap:16px; padding:20px; text-align:left; color:var(--text); border:1px solid var(--line); border-radius:18px; background:#251d31; }
.notification-card:hover { border-color:rgba(255,77,95,.55); transform:translateY(-1px); }
.notification-card.read { opacity:.7; }
.notification-card p { margin:10px 0; }
.notification-card small { color:var(--muted); }
.notification-arrow { display:block; margin-top:14px; color:var(--red-2); font-size:18px; }
.danger-zone { margin-top:18px; border-color:rgba(255,77,95,.38); }
.danger-callout { padding:14px; border:1px solid rgba(255,77,95,.38); border-radius:14px; background:rgba(215,25,32,.1); }
.danger-callout p { margin:7px 0 0; color:var(--muted); }
.upcoming-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.upcoming-summary-card { min-height:72px; padding:13px 15px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(145deg,rgba(51,40,63,.92),rgba(33,26,45,.88)); }
.upcoming-summary-card span,.upcoming-summary-card strong { display:block; }
.upcoming-summary-card span { color:var(--muted); font-size:10px; font-weight:900; text-transform:uppercase; }
.upcoming-summary-card strong { margin-top:6px; font-size:21px; }
.upcoming-summary-card.overdue strong { color:#ff8a94; }
.upcoming-summary-card.today { border-left:3px solid var(--red-2); }
.upcoming-summary-card.upcoming { border-left:3px solid var(--blue); }
.upcoming-summary-card.editing { border-left:3px solid var(--green); }
.upcoming-filters { position:sticky; top:90px; z-index:15; display:grid; grid-template-columns:auto auto minmax(200px,1fr) 145px 145px; gap:10px; margin-bottom:26px; padding:12px; border:1px solid var(--line); border-radius:22px; background:rgba(37,29,49,.9); backdrop-filter:blur(18px); }
.segmented { display:flex; padding:4px; border:1px solid var(--line); border-radius:15px; background:#1d1627; }
.segment { min-height:38px; padding:0 13px; border:0; border-radius:12px; color:var(--muted); background:transparent; font-size:11px; font-weight:950; white-space:nowrap; }
.segment.active { color:white; background:linear-gradient(90deg,var(--red),var(--red-2)); box-shadow:0 8px 18px rgba(215,25,32,.2); }
.upcoming-section { margin-bottom:30px; }
.upcoming-section-title { display:flex; align-items:center; gap:11px; margin-bottom:14px; }
.upcoming-section-title h2 { margin:0; font-size:17px; }
.upcoming-section-title span { min-width:28px; height:28px; display:grid; place-items:center; border-radius:14px; color:var(--muted); background:var(--surface-3); font-size:10px; font-weight:950; }
.upcoming-section-title.overdue h2 { color:#ff8a94; }
.upcoming-timeline { position:relative; display:grid; gap:14px; padding-left:38px; }
.upcoming-timeline:before { content:""; position:absolute; left:13px; top:8px; bottom:8px; width:2px; background:linear-gradient(var(--red-2),rgba(255,255,255,.08)); }
.upcoming-event { position:relative; min-height:142px; display:grid; grid-template-columns:minmax(220px,1.25fr) repeat(4,minmax(105px,.62fr)) auto auto; grid-template-areas:"main due location execution editor status open"; align-items:center; gap:17px; padding:19px 20px; border:1px solid var(--line); border-radius:24px; background:radial-gradient(circle at 0 100%,rgba(215,25,32,.1),transparent 28%),linear-gradient(145deg,rgba(51,40,63,.93),rgba(33,26,45,.89)); box-shadow:inset 0 1px 0 rgba(255,255,255,.04); }
.upcoming-event:before { content:""; position:absolute; left:-32px; top:35px; width:14px; height:14px; border-radius:50%; background:var(--red-2); box-shadow:0 0 0 5px rgba(255,77,95,.15); }
.upcoming-event.delivery:before { background:#a7a0b3; box-shadow:0 0 0 5px rgba(167,160,179,.12); }
.upcoming-event.overdue { border-color:rgba(255,77,95,.25); }
.upcoming-event.urgent,.upcoming-event.my-order { box-shadow:inset 4px 0 0 var(--red-2),inset 0 1px 0 rgba(255,255,255,.04); }
.upcoming-event-main { grid-area:main; min-width:0; }.date-data { grid-area:due; }.location-data { grid-area:location; }.team-data:not(.editor-data) { grid-area:execution; }.editor-data { grid-area:editor; }.quick-order-status { grid-area:status; }.upcoming-open { grid-area:open; }
.upcoming-eyebrow { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:9px; }
.event-pill { min-height:27px; padding:0 10px; display:inline-flex; align-items:center; border-radius:14px; font-size:10px; font-weight:950; }
.event-pill.shoot { color:white; background:rgba(255,77,95,.2); }
.event-pill.delivery { color:#e5e1e9; background:rgba(255,255,255,.08); }
.event-pill.urgent { color:white; background:linear-gradient(90deg,var(--red),var(--red-2)); }
.upcoming-code { color:var(--muted); font-size:10px; font-weight:900; }
.upcoming-event h3 { margin:0; overflow:hidden; font-size:17px; text-overflow:ellipsis; white-space:nowrap; }
.upcoming-company { margin-top:8px; color:var(--muted); font-size:11px; font-weight:750; }
.upcoming-event-main p { max-width:470px; margin:10px 0 0; overflow:hidden; color:#ded8e5; font-size:11px; font-weight:700; line-height:1.5; text-overflow:ellipsis; white-space:nowrap; }
.upcoming-warnings { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.upcoming-warnings span { min-height:25px; padding:0 9px; display:inline-flex; align-items:center; border:1px solid rgba(255,77,95,.17); border-radius:12px; color:#ff8a94; background:rgba(255,77,95,.09); font-size:9px; font-weight:950; }
.upcoming-data span,.upcoming-data strong { display:block; }
.upcoming-data > span { margin-bottom:7px; color:var(--muted); font-size:10px; font-weight:900; }
.upcoming-data strong { font-size:12px; line-height:1.5; }
.upcoming-team { display:flex; align-items:center; }
.upcoming-team i { width:32px; height:32px; margin-left:-8px; display:grid; place-items:center; border:2px solid #2b2238; border-radius:50%; background:var(--surface-3); font-size:10px; font-style:normal; font-weight:950; }
.upcoming-team i:first-child { margin-left:0; }
.team-data small { display:block; margin-top:6px; color:#ff8a94; font-size:9px; font-weight:950; }
.editor-data { min-width:0; }.editor-data>span { color:#aebeff; }.editor-data .upcoming-team i { border-color:#252c49; background:#222842; }.editor-data small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#b8c5ff; }
.quick-order-status { min-height:36px; max-width:125px; padding:0 9px; border-radius:13px; font-size:10px; font-weight:850; }
.upcoming-open { width:34px; height:34px; }
.home-activity-log { margin-top:34px; }
.insights-leaderboard { margin-bottom:18px; padding:20px; border:1px solid var(--line); border-radius:22px; background:linear-gradient(145deg,#2d2438,#211a2b); }
.leaderboard-head { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:17px; }
.leaderboard-head h2 { margin:0 0 5px; font-size:17px; }
.leaderboard-head p { margin:0; color:var(--muted); font-size:11px; }
.leaderboard-head > span { color:#ff6573; font-size:10px; font-weight:950; }
.rank-card { display:grid; grid-template-columns:46px 1fr auto; align-items:center; gap:12px; border-radius:18px; }
.rank-avatar,.leader-config-icon { width:46px; height:46px; display:grid; place-items:center; flex:none; color:white; background:linear-gradient(145deg,#d71920,#ff6573); border-radius:14px; font-weight:950; }
.rank-card h2 { margin:4px 0; font-size:15px; }
.rank-score { color:#ff6573; font-size:24px; }
.rank-score small { color:var(--muted); font-size:9px; }
.star-bonus-input { width:120px; min-height:38px; }
.leader-config-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.leader-config-card { display:grid; grid-template-columns:46px 1fr; gap:14px; padding:18px; border:1px solid var(--line); border-radius:18px; background:#21192b; }
.leader-config-card h3 { margin:0; font-size:14px; }
.leader-config-card p { min-height:30px; margin:5px 0 13px; color:var(--muted); font-size:11px; line-height:1.45; }
.leader-config-card small { display:block; margin-top:8px; color:var(--green); font-weight:850; }
.leader-save { grid-column:1/-1; display:flex; justify-content:flex-end; }
.evaluation-rules-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:18px 0; }
.evaluation-rule-card { overflow:hidden; border:1px solid var(--line); border-radius:18px; background:linear-gradient(145deg,#2d2438,#211a2b); }
.evaluation-rule-top { display:flex; justify-content:space-between; gap:10px; padding:16px; border-bottom:1px solid var(--line); }
.evaluation-rule-top h3 { margin:0; }
.evaluation-rule-top p { margin:5px 0 0; color:var(--muted); font-size:10px; line-height:1.4; }
.evaluation-rule-top > strong { color:#ff6573; font-size:23px; }
.evaluation-criterion { display:grid; grid-template-columns:1fr auto; gap:10px; padding:11px 15px; border-bottom:1px solid rgba(255,255,255,.05); font-size:11px; }
.evaluation-criterion:last-child { border-bottom:0; }
.evaluation-criterion b { color:var(--green); }
.shared-criteria { margin-bottom:18px; }
.shared-criteria-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; padding:18px; }
.shared-criteria-grid > div { padding:14px; border:1px solid var(--line); border-radius:14px; background:#21192b; }
.shared-criteria-grid span,.shared-criteria-grid strong { display:block; }
.shared-criteria-grid span { min-height:32px; color:var(--muted); font-size:10px; }
.shared-criteria-grid strong { margin-top:8px; color:var(--green); font-size:19px; }
.evaluation-policy { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.evaluation-policy > div { padding:14px; border:1px solid rgba(255,183,73,.17); border-radius:14px; background:rgba(255,183,73,.07); }
.evaluation-policy strong,.evaluation-policy span { display:block; }
.evaluation-policy strong { color:#f0b749; font-size:11px; }
.evaluation-policy span { margin-top:6px; color:var(--muted); font-size:10px; line-height:1.5; }
.evaluation-entry { overflow:hidden; border:1px solid var(--line); border-radius:18px; background:#21192b; }
.evaluation-entry-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:15px; border-bottom:1px solid var(--line); }
.evaluation-entry-head strong,.evaluation-entry-head span { display:block; }
.evaluation-entry-head span { margin-top:4px; color:var(--muted); font-size:10px; }
.evaluation-entry-head b { color:#ff6573; font-size:23px; }
.evaluation-entry-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; padding:8px 15px 15px; }
.evaluation-entry-grid label { display:grid; grid-template-columns:1fr 90px; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid rgba(255,255,255,.05); font-size:11px; }
.evaluation-entry-grid label > span,.evaluation-entry-grid small { display:block; }
.evaluation-entry-grid small { margin-top:3px; color:var(--muted); font-size:9px; }
.evaluation-entry-grid input { min-height:38px; }

.preview-shell { display:none; position:fixed; inset:0; z-index:150; padding:24px; overflow:auto; background:rgba(4,2,7,.9); backdrop-filter:blur(12px); }
.preview-shell.open { display:block; }
.preview-toolbar { position:sticky; top:0; z-index:2; width:min(930px,100%); margin:0 auto 14px; padding:12px; display:flex; align-items:center; gap:10px; color:#fff; background:#241c2e; border:1px solid var(--line); border-radius:8px; box-shadow:0 12px 35px rgba(0,0,0,.3); }
.preview-toolbar > div:first-child { display:grid; gap:3px; }
.preview-toolbar span { color:var(--muted); font-size:10px; }
.preview-toolbar .actions { margin-left:auto; }
.paper { width:210mm; min-height:297mm; margin:0 auto; padding:16mm 17mm 13mm; display:flex; flex-direction:column; direction:ltr; unicode-bidi:isolate; text-align:left; color:#242027; background:#fff; box-shadow:0 25px 70px rgba(0,0,0,.45); }
.paper-header { display:grid; grid-template-columns:1fr auto; gap:25px; align-items:start; padding-bottom:10mm; border-bottom:2px solid #d71920; }
.paper-brand { display:flex; align-items:center; gap:10px; }
.paper-logo { width:42px; height:42px; display:grid; place-items:center; border-radius:7px; color:#fff; background:#d71920; font-size:12px; font-weight:950; }
.paper-brand h2 { margin:0; color:#171319; font-size:18px; }
.paper-brand p { margin:4px 0 0; color:#777078; font-size:9px; font-weight:700; }
.print-meta { min-width:155px; }
.print-meta div { display:flex; justify-content:space-between; gap:16px; padding:4px 0; color:#6f6871; font-size:8px; border-bottom:1px solid #eee9ef; }
.print-meta strong { color:#28222a; }
.report-title { padding:9mm 0 7mm; }
.report-title span { color:#d71920; font-size:8px; font-weight:950; text-transform:uppercase; }
.report-title h1 { margin:5px 0 0; color:#171319; font-size:23px; }
.report-title p { margin:5px 0 0; color:#716a73; font-size:9px; }
.employee-strip { display:grid; grid-template-columns:1.5fr 1fr 1fr; margin-bottom:7mm; background:#f4f1f5; border-left:4px solid #d71920; }
.employee-strip div { padding:10px 12px; }
.employee-strip span,.paper-summary span { display:block; color:#817982; font-size:7px; font-weight:900; text-transform:uppercase; }
.employee-strip strong,.paper-summary strong { display:block; margin-top:4px; color:#272128; font-size:10px; }
.paper-table { width:100%; min-width:0; border:1px solid #e8e3e9; border-collapse:collapse; }
.paper-table th,.paper-table td { position:static; padding:8px 7px; color:#3d3740; background:#fff; border:1px solid #ece7ed; font-size:8px; }
.paper-table th { color:#fff; background:#2d2730; font-size:7px; text-transform:uppercase; }
.paper-table thead { display:table-header-group; }
.paper-table tfoot { display:table-footer-group; }
.paper-table tr { break-inside:avoid; page-break-inside:avoid; }
.paper-table .paper-money { color:#188a50; font-weight:950; }
.paper-table .paper-negative { color:#c52334; font-weight:950; }
.paper-section-title { margin:7mm 0 3mm; color:#3b343c; font-size:10px; font-weight:950; }
.paper-summary { margin-top:7mm; display:grid; grid-template-columns:repeat(5,1fr); gap:7px; }
.paper-summary > div { padding:10px; background:#f5f2f6; border:1px solid #ebe6ec; }
.paper-summary .total { background:#2d2730; }
.paper-summary .total span { color:#d4ced6; }
.paper-summary .total strong { color:#fff; }
.wallet-summary { margin-top:0; margin-bottom:7mm; }
.paper-note { margin-top:8mm; padding:9px 11px; color:#6e6770; background:#faf8fa; border:1px solid #ece7ed; font-size:8px; line-height:1.6; }
.paper-footer { margin-top:auto; padding-top:8mm; display:flex; justify-content:space-between; color:#78717a; border-top:1px solid #ded8df; font-size:8px; }
.paper-footer strong { color:#29232b; }

@media (max-width:700px) {
  .page { width:calc(100% - 24px); }
  .form-grid-2,.team-picker-grid { grid-template-columns:1fr; }
  .section-title { align-items:flex-start; flex-direction:column; }
  .employee-expense-row { grid-template-columns:1fr 1fr; }
  .employee-expense-row .ee-remove { grid-column:2; justify-self:end; }
  .modal-body { padding:14px; }
  .form-section { padding:14px; border-radius:18px; }
  .preview-shell { padding:12px; }
  .preview-toolbar { flex-wrap:wrap; }
  .preview-toolbar .actions { width:100%; margin-left:0; }
  .paper-frame { width:100%; overflow:auto; }
  .paper { transform-origin:top left; }
  .upcoming-summary { grid-template-columns:1fr 1fr; }
  .upcoming-filters { top:148px; grid-template-columns:1fr; border-radius:18px; }
  .upcoming-filters select { display:none; }
  .segmented { width:100%; }
  .segment { flex:1; }
  .upcoming-timeline { padding-left:27px; }
  .upcoming-timeline:before { left:8px; }
  .upcoming-event { min-height:0; grid-template-columns:1fr auto; padding:17px; }
  .upcoming-event:before { left:-25px; top:31px; width:12px; height:12px; }
  .upcoming-data,.quick-order-status { display:none; }
  .upcoming-event h3,.upcoming-event-main p { white-space:normal; }
  .leaderboard-head { align-items:flex-start; flex-direction:column; }
  .leader-config-grid,.evaluation-rules-grid,.evaluation-policy { grid-template-columns:1fr; }
  .leader-save { grid-column:auto; }
  .shared-criteria-grid,.evaluation-entry-grid { grid-template-columns:1fr; }
  .rank-card { grid-template-columns:42px 1fr; }
  .rank-score { grid-column:2; }
}

/* Master preview visual system. */
:root {
  --bg:#0d0d12;
  --surface:#17171e;
  --surface-2:#202029;
  --surface-3:#2a2a34;
  --line:#34343f;
  --text:#f7f7f9;
  --muted:#a8a8b3;
  --red:#e3202f;
  --red-2:#ff5060;
  --green:#38c878;
  --shadow:0 18px 50px rgba(0,0,0,.38);
}
body { background:var(--bg); }
.topbar {
  min-height:72px;
  padding:10px 18px;
  gap:18px;
  border-bottom-color:var(--line);
  background:rgba(13,13,18,.94);
  backdrop-filter:blur(18px);
}
.brand { min-width:190px; font-size:15px; font-weight:800; }
.brand-mark {
  width:38px;
  height:38px;
  border:1px solid #ff5060;
  border-radius:8px;
  color:white;
  background:linear-gradient(145deg,var(--red),#a80f1d);
  box-shadow:0 0 24px rgba(227,32,47,.28);
}
.nav-btn {
  min-height:38px;
  padding:0 13px;
  border:1px solid transparent;
  border-radius:7px;
  color:#c8c8d0;
  font-size:13px;
  font-weight:700;
}
.nav-btn:hover { border-color:var(--line); background:var(--surface); }
.nav-btn.active {
  border-color:rgba(255,80,96,.46);
  color:white;
  background:rgba(227,32,47,.15);
  box-shadow:none;
}
.avatar {
  width:38px;
  height:38px;
  border:1px solid #ff5361;
  color:white;
  background:#2b141a;
  box-shadow:none;
}
.work-badge { color:white; background:var(--red); border-color:var(--bg); }
.icon-btn {
  width:38px;
  height:38px;
  border-radius:7px;
  background:var(--surface);
}
.page { width:min(1280px,calc(100% - 48px)); padding:28px 0 60px; }
.page-head { margin-bottom:24px; }
.page-head h1 { font-size:26px; }
.panel,.order-card,.stat,.wallet-card,.insights-leaderboard,
.evaluation-rule-card,.leader-config-card {
  border-color:var(--line);
  border-radius:8px;
  background:var(--surface);
  box-shadow:none;
}
.panel { border-radius:8px; }
.order-card { border-radius:8px; }
.stat { border-radius:7px; }
.btn {
  min-height:40px;
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--surface-2);
  box-shadow:none;
}
.btn:hover { border-color:#575763; background:#292933; }
.btn.primary {
  border:1px solid var(--red);
  background:var(--red);
  box-shadow:none;
}
.btn.primary:hover { background:#ff4552; }
.btn.danger { color:#ff7682; border-color:rgba(255,118,130,.28); background:rgba(227,32,47,.08); }
input,select,textarea {
  min-height:42px;
  padding:10px 12px;
  border-color:var(--line);
  border-radius:7px;
  background:#111117;
}
textarea { min-height:86px; }
.modal { width:min(1100px,100%); border-radius:8px; background:var(--surface); }
.modal.small { width:min(520px,100%); }
.modal-head,.modal-foot { background:var(--surface); }
.modal-head { padding:16px 18px; }
.modal-body { padding:18px; }
.modal-foot { padding:14px 18px; }
.form-section,.team-picker,.payout-card,.employee-expense-wrap,
.notification-card,.danger-callout,.evaluation-entry {
  border-radius:8px;
  background:var(--surface-2);
}
.team-chip { border-radius:7px; background:#34343f; }
.tabs { border-color:var(--line); }
.tab { border-radius:0; }
th { background:#202029; color:#d3d3da; }
/* An opaque, softly tinted header keeps sticky columns readable over content. */
@media screen {
  #app .table-wrap thead th,
  #modalRoot .table-wrap thead th {
    background:#302027;
    color:#f1dce0;
    border-bottom-color:#6a303c;
  }
  [data-theme="light"] #app .table-wrap thead th,
  [data-theme="light"] #modalRoot .table-wrap thead th {
    background:#fbeaec;
    color:#632b36;
    border-bottom-color:#edc5cc;
  }
}
td { border-bottom-color:#30303a; }
.table-wrap { border-radius:0 0 8px 8px; }
.wallet-edit-opening { border-radius:6px; background:var(--surface-2); }
.archive-order,.archive-equipment,.archive-company {
  width:34px;
  height:34px;
  border-color:rgba(255,118,130,.25);
  border-radius:7px;
  color:#ff7682;
  background:rgba(227,36,50,.09);
}
.archive-order img,.archive-equipment img,.archive-company img {
  width:17px;
  height:17px;
  filter:brightness(0) saturate(100%) invert(59%) sepia(69%) saturate(1710%) hue-rotate(313deg) brightness(106%);
}
.archive-order:hover,.archive-equipment:hover,.archive-company:hover {
  border-color:#ff7682;
  background:var(--red);
}
.archive-order:hover img,.archive-equipment:hover img,.archive-company:hover img { filter:brightness(0) invert(1); }
.payment-balance {
  display:grid;
  grid-template-columns:1.5fr repeat(4,1fr);
  overflow:hidden;
  border:1px solid var(--line);
  border-left:4px solid var(--red);
  border-radius:8px;
  background:var(--surface-2);
}
.payment-balance > div { padding:12px; border-right:1px solid var(--line); }
.payment-balance > div:last-child { border-right:0; }
.payment-balance span,.backup-choice span { display:block; color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; }
.payment-balance strong,.backup-choice strong { display:block; margin-top:5px; font-size:12px; }
.payment-balance .positive { color:var(--green); }
.payment-balance .remaining,.payment-balance .invalid { color:#ff7682; }
.payment-order span { color:#ff7682; }
.backup-choice {
  display:grid;
  grid-template-columns:1.5fr 1fr .6fr;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface-2);
}
.backup-choice > div { padding:13px; border-right:1px solid var(--line); }
.backup-choice > div:last-child { border-right:0; }
.upcoming-summary-card,.upcoming-filters,.upcoming-event {
  border-color:var(--line);
  border-radius:8px;
  background:var(--surface);
}
.upcoming-filters { top:84px; background:rgba(23,23,30,.94); }
.segmented { border-radius:7px; background:#111117; }
.segment { border-radius:6px; }
.segment.active { background:var(--red); box-shadow:none; }
.upcoming-open,.quick-order-status { border-radius:7px; }
.rank-avatar,.leader-config-icon { border-radius:7px; background:var(--red); }
.shared-criteria-grid > div,.evaluation-policy > div { border-radius:7px; background:var(--surface-2); }
.preview-toolbar { background:var(--surface); }
[data-theme="light"] body { background:#f3f1f4; }
[data-theme="light"] .panel,
[data-theme="light"] .order-card,
[data-theme="light"] .stat,
[data-theme="light"] .wallet-card { background:white; }

@media (max-width:700px) {
  .brand { min-width:auto; }
  .payout-section-heading { align-items:flex-start; flex-direction:column; }
  .payout-section-heading .btn { width:100%; }
  .payout-rate-grid { grid-template-columns:1fr; }
  .payout-role-card { padding:16px; border-radius:18px; }
  .payout-rate-row { grid-template-columns:minmax(0,1fr) auto 34px; }
  .payout-history-panel .panel-head { align-items:flex-start; flex-direction:column; }
  .notification-menu {
    position:fixed;
    top:60px;
    right:10px;
    width:min(360px,calc(100vw - 20px));
  }
  .notification-menu-list { max-height:calc(100vh - 72px); }
  .equipment-prep-modal { width:100%; }
  .equipment-prep-form { padding:14px; }
  .equipment-prep-panel-head { margin:-14px -14px 16px; padding:12px 14px; align-items:flex-start; flex-direction:column; }
  .equipment-preset-toolbar { grid-template-columns:1fr 1fr; padding:10px; }
  .equipment-preset-toolbar .field { grid-column:1/-1; }
  .equipment-order-picker,.equipment-prep-row { grid-template-columns:1fr; }
  .equipment-order-info { grid-template-columns:1fr 1fr; }
  .equipment-selection-line { grid-template-columns:minmax(0,1fr) 40px 40px; }
  .equipment-counter-grid { grid-template-columns:1fr 1fr; }
  .equipment-counter-card { min-height:64px; }
  .equipment-prep-actions .btn { width:100%; }
  .shoot-completion-panel .panel-head { align-items:flex-start; flex-direction:column; padding-block:14px; }
  .shoot-completion-chip { white-space:normal; }
  .shoot-action-buttons,
  .shoot-status-pair { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .payment-balance { grid-template-columns:1fr 1fr; }
  .payment-order { grid-column:1/-1; }
  .backup-choice { grid-template-columns:1fr; }
  .backup-choice > div { border-right:0; border-bottom:1px solid var(--line); }
  .backup-choice > div:last-child { border-bottom:0; }
  .upcoming-filters { top:144px; }
}
@page { size:A4 portrait; margin:0; }
@media print {
  body > :not(#modalRoot) { display:none!important; }
  #modalRoot > :not(.preview-shell) { display:none!important; }
  .preview-shell { position:static; display:block; padding:0; overflow:visible; background:#fff; }
  .preview-toolbar { display:none!important; }
  .paper { width:210mm; min-height:297mm; margin:0; box-shadow:none; }
  .cash-ledger-paper {
    min-height:auto;
    display:block;
    box-shadow:none;
  }
  .cash-ledger-paper .paper-header,
  .cash-ledger-paper .report-title,
  .cash-ledger-paper .paper-summary,
  .cash-ledger-paper .paper-footer {
    break-inside:avoid;
    page-break-inside:avoid;
  }
  .cash-print-table {
    break-before:auto;
    page-break-before:auto;
  }
  .cash-print-table thead {
    display:table-header-group;
  }
  .cash-print-table tr {
    break-inside:avoid;
    page-break-inside:avoid;
  }
}

/* Installable mobile app layout. */
.install-app { color:#fff; border-color:rgba(56,199,123,.42); background:rgba(56,199,123,.14); }
.install-app:hover { background:rgba(56,199,123,.23); }

@media (display-mode:standalone) {
  .install-app { display:none!important; }
  .topbar { padding-top:max(10px,env(safe-area-inset-top)); }
}

@media screen and (max-width:700px) {
  body { padding-bottom:calc(66px + env(safe-area-inset-bottom)); }
  .app-shell { padding-bottom:0; }
  .topbar {
    min-height:62px;
    padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));
    flex-wrap:nowrap;
    gap:7px;
  }
  .brand { min-width:0; flex:0 0 auto; }
  .brand-name { display:none; }
  .brand-mark { width:38px; height:38px; }
  .user-zone { order:initial; margin-left:auto; gap:6px; }
  .user-zone .btn.small { min-height:40px; padding-inline:10px; }
  .theme-toggle { width:44px; min-width:44px; overflow:hidden; font-size:0; }
  .theme-toggle::after { content:"Theme"; font-size:10px; font-weight:900; }
  .install-app { min-width:54px; }
  .avatar { width:38px; height:38px; }
  .notification-button { width:40px; height:40px; }
  #logoutButton { min-width:52px; padding-inline:8px; }
  .main-nav {
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:75;
    min-height:62px;
    padding:7px max(8px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    display:flex;
    gap:4px;
    overflow-x:auto;
    border-top:1px solid var(--line);
    background:rgba(13,13,18,.97);
    box-shadow:0 -10px 30px rgba(0,0,0,.22);
    backdrop-filter:blur(18px);
  }
  .nav-btn {
    min-width:72px;
    min-height:46px;
    flex:1 0 auto;
    padding:0 10px;
    border-radius:6px;
    font-size:11px;
  }
  .nav-btn.active { box-shadow:inset 0 -2px var(--red); }
  .page,
  .orders-page,
  .quotations-page {
    width:100%;
    padding:20px 12px 34px;
  }
  .page-head { gap:14px; margin-bottom:18px; }
  .page-head h1 { font-size:25px; }
  .page-head .actions { width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .page-head .actions > * { width:100%; min-width:0; }
  .panel,
  .stat,
  .wallet-card,
  .order-card,
  .orders-system-card { border-radius:8px; }
  .panel-head { align-items:flex-start; flex-wrap:wrap; gap:10px; }
  .panel-head .actions { width:100%; flex-wrap:wrap; }
  .panel-head .actions > * { flex:1 1 130px; }
  button,
  .btn,
  input,
  select { min-height:44px; }
  textarea { min-height:104px; }
  .table-wrap { max-width:100%; overflow:auto; -webkit-overflow-scrolling:touch; }
  .table-wrap table { min-width:720px; }
  .wallet-grid { padding-bottom:4px; scroll-snap-type:x proximity; }
  .wallet-card { scroll-snap-align:start; }
  .modal-backdrop { align-items:end; padding:0; }
  .modal {
    width:100%;
    max-height:92dvh;
    border-radius:8px 8px 0 0;
    padding-bottom:env(safe-area-inset-bottom);
  }
  .modal-head { padding:14px; }
  .modal-foot { padding:12px 14px calc(12px + env(safe-area-inset-bottom)); flex-wrap:wrap; }
  .modal-foot .btn { flex:1 1 130px; }
  .message-root { left:12px; right:12px; bottom:calc(76px + env(safe-area-inset-bottom)); }
  .message { width:100%; max-width:none; }
  .notification-menu { position:fixed; top:64px; right:8px; width:calc(100vw - 16px); max-height:70dvh; }
  .login-shell { min-height:100dvh; padding:18px; }
  .login-panel { width:100%; border-radius:8px; }
  [data-theme="light"] .main-nav { background:rgba(255,255,255,.97); }
}

/* High-contrast semantic colors for the light theme. */
@media screen {
  [data-theme="light"] {
    --light-success:#076b3c;
    --light-success-bg:#dff4e8;
    --light-success-line:#8bcfaa;
    --light-danger:#a61b2b;
    --light-danger-bg:#fde7ea;
    --light-danger-line:#e5a1aa;
    --light-info:#2458a6;
    --light-info-bg:#e5edfc;
    --light-info-line:#9db7e2;
    --light-warning:#754700;
    --light-warning-bg:#fff1c7;
    --light-warning-line:#d9b75e;
    --light-accent:#9e1c2a;
  }

  [data-theme="light"] .status,
  [data-theme="light"] .status.archived,
  [data-theme="light"] .status.Archived {
    color:#424b56;
    border:1px solid #cbd1d9;
    background:#e9edf1;
  }
  [data-theme="light"] .status.Active,
  [data-theme="light"] .status.Ready,
  [data-theme="light"] .status.Paid,
  [data-theme="light"] .status.Delivered,
  [data-theme="light"] .status.Earned,
  [data-theme="light"] .status.Completed,
  [data-theme="light"] .status.Complete,
  [data-theme="light"] .status.In,
  [data-theme="light"] .status.active,
  [data-theme="light"] .status.ready,
  [data-theme="light"] .status.paid,
  [data-theme="light"] .status.delivered,
  [data-theme="light"] .status.earned,
  [data-theme="light"] .status.completed {
    color:var(--light-success);
    border-color:var(--light-success-line);
    background:var(--light-success-bg);
  }
  [data-theme="light"] .status.Urgent,
  [data-theme="light"] .status.Cancelled,
  [data-theme="light"] .status.Inactive,
  [data-theme="light"] .status.Out,
  [data-theme="light"] .status.Unpaid,
  [data-theme="light"] .status.Not-Paid,
  [data-theme="light"] .status.Void,
  [data-theme="light"] .status.Overdue,
  [data-theme="light"] .status.urgent,
  [data-theme="light"] .status.cancelled,
  [data-theme="light"] .status.inactive,
  [data-theme="light"] .status.unpaid {
    color:var(--light-danger);
    border-color:var(--light-danger-line);
    background:var(--light-danger-bg);
  }
  [data-theme="light"] .status.Editing,
  [data-theme="light"] .status.Shooting,
  [data-theme="light"] .status.Booked,
  [data-theme="light"] .status.Pending,
  [data-theme="light"] .status.Partially-Paid,
  [data-theme="light"] .status.editing,
  [data-theme="light"] .status.shooting,
  [data-theme="light"] .status.booked,
  [data-theme="light"] .status.pending {
    color:var(--light-info);
    border-color:var(--light-info-line);
    background:var(--light-info-bg);
  }
  [data-theme="light"] .status.Paused,
  [data-theme="light"] .status.Maintenance {
    color:var(--light-warning);
    border-color:var(--light-warning-line);
    background:var(--light-warning-bg);
  }

  [data-theme="light"] .money.positive,
  [data-theme="light"] .positive,
  [data-theme="light"] .payment-balance .positive,
  [data-theme="light"] .quotation-total strong,
  [data-theme="light"] .calendar-day-order-time,
  [data-theme="light"] .evaluation-criterion b,
  [data-theme="light"] .shared-criteria-grid strong,
  [data-theme="light"] .leader-config-card small {
    color:var(--light-success);
  }
  [data-theme="light"] .money.negative,
  [data-theme="light"] .negative,
  [data-theme="light"] .payment-balance .remaining,
  [data-theme="light"] .payment-balance .invalid,
  [data-theme="light"] .payment-order span,
  [data-theme="light"] .warning-note,
  [data-theme="light"] .upcoming-warnings span,
  [data-theme="light"] .team-data small,
  [data-theme="light"] .rank-score,
  [data-theme="light"] .evaluation-rule-top > strong,
  [data-theme="light"] .evaluation-entry-head b,
  [data-theme="light"] .calendar-eyebrow,
  [data-theme="light"] .calendar-day-panel-head span,
  [data-theme="light"] .orders-system-card .order-code,
  [data-theme="light"] .upcoming-summary-card.overdue strong,
  [data-theme="light"] .upcoming-section-title.overdue h2 {
    color:var(--light-danger);
  }

  [data-theme="light"] .calendar-order-badge {
    color:#064b2c;
    border:1px solid var(--light-success-line);
    background:var(--light-success-bg);
  }
  [data-theme="light"] .event-pill.shoot {
    color:var(--light-danger);
    border:1px solid var(--light-danger-line);
    background:var(--light-danger-bg);
  }
  [data-theme="light"] .event-pill.delivery {
    color:#424b56;
    border:1px solid #cbd1d9;
    background:#e9edf1;
  }
  [data-theme="light"] .event-pill.urgent {
    color:#fff;
    border:1px solid #831421;
    background:#a61b2b;
  }
  [data-theme="light"] .upcoming-warnings span {
    border-color:var(--light-danger-line);
    background:var(--light-danger-bg);
  }

  [data-theme="light"] .equipment-prep-notice,
  [data-theme="light"] .payout-form-warning,
  [data-theme="light"] .evaluation-policy > div,
  [data-theme="light"] .shoot-workflow-status {
    color:var(--light-warning);
    border-color:var(--light-warning-line);
    background:var(--light-warning-bg);
  }
  [data-theme="light"] .equipment-prep-notice.error {
    color:var(--light-danger);
    border-color:var(--light-danger-line);
    background:var(--light-danger-bg);
  }
  [data-theme="light"] .evaluation-policy strong { color:var(--light-warning); }
  [data-theme="light"] .shoot-workflow-status.complete,
  [data-theme="light"] .payout-version-status.active {
    color:var(--light-success);
    border:1px solid var(--light-success-line);
    background:var(--light-success-bg);
  }
  [data-theme="light"] .payout-version-status.archived {
    color:#424b56;
    border:1px solid #cbd1d9;
    background:#e9edf1;
  }

  [data-theme="light"] .btn.success,
  [data-theme="light"] .install-app {
    color:var(--light-success);
    border-color:var(--light-success-line);
    background:var(--light-success-bg);
  }
  [data-theme="light"] .btn.success:hover,
  [data-theme="light"] .install-app:hover { background:#ccebd9; }
  [data-theme="light"] .btn.danger {
    color:var(--light-danger);
    border-color:var(--light-danger-line);
    background:var(--light-danger-bg);
  }
  [data-theme="light"] .notification-menu-head button,
  [data-theme="light"] .upcoming-code,
  [data-theme="light"] .leaderboard-head > span { color:var(--light-accent); }
}

@media screen and (max-width:430px) {
  .avatar { display:none; }
  .stats { grid-template-columns:1fr; }
  .page-head .actions { grid-template-columns:1fr; }
  .invoice-detail-grid,
  .invoice-totals { grid-template-columns:1fr; }
}

/* Final light theme layer. Keep print documents on their own fixed palette. */
@media screen {
  [data-theme="light"] {
    color-scheme:light;
    --bg:#f5f6f8;
    --surface:#ffffff;
    --surface-2:#f0f2f5;
    --surface-3:#e3e6eb;
    --line:#d8dce3;
    --text:#20242a;
    --muted:#66707c;
    --red:#d92332;
    --red-2:#ef4050;
    --green:#188b55;
    --blue:#326fd1;
    --orange:#b96618;
    --yellow:#9a6a0a;
    --shadow:0 14px 36px rgba(26,35,48,.11);
  }

  [data-theme="light"] body {
    color:var(--text);
    background:var(--bg);
  }
  [data-theme="light"] .topbar {
    border-color:var(--line);
    background:rgba(255,255,255,.96);
    box-shadow:0 6px 20px rgba(26,35,48,.06);
  }
  [data-theme="light"] .brand,
  [data-theme="light"] .user-name,
  [data-theme="light"] h1,
  [data-theme="light"] h2,
  [data-theme="light"] h3,
  [data-theme="light"] h4,
  [data-theme="light"] strong,
  [data-theme="light"] label,
  [data-theme="light"] .check,
  [data-theme="light"] .order-finance-data strong {
    color:var(--text);
  }
  [data-theme="light"] .nav-btn { color:#4d5662; }
  [data-theme="light"] .nav-btn:hover { color:#242a31; background:#f0f2f5; }
  [data-theme="light"] .nav-btn.active { color:#b31d29; background:#fdecef; }
  [data-theme="light"] .tab.active { color:#b31d29; border-color:#d92332; }
  [data-theme="light"] .avatar { color:#fff; background:#8f2530; }
  [data-theme="light"] .user-role,
  [data-theme="light"] .muted,
  [data-theme="light"] .field-hint,
  [data-theme="light"] .upcoming-event-main p,
  [data-theme="light"] .note-preview { color:var(--muted); }

  [data-theme="light"] input,
  [data-theme="light"] select,
  [data-theme="light"] textarea,
  [data-theme="light"] .segmented,
  [data-theme="light"] .notification-button,
  [data-theme="light"] .icon-btn,
  [data-theme="light"] .btn:not(.primary),
  [data-theme="light"] .icon-action,
  [data-theme="light"] .order-action-icon {
    color:var(--text);
    border-color:var(--line);
    background:#fff;
  }
  [data-theme="light"] input::placeholder,
  [data-theme="light"] textarea::placeholder { color:#8a929d; }
  [data-theme="light"] input:focus,
  [data-theme="light"] select:focus,
  [data-theme="light"] textarea:focus { border-color:#a9b1bc; box-shadow:0 0 0 3px rgba(50,111,209,.1); }
  [data-theme="light"] .btn:not(.primary):hover,
  [data-theme="light"] .icon-action:hover,
  [data-theme="light"] .order-action-icon:hover { background:#eef1f4; }
  [data-theme="light"] .btn.primary,
  [data-theme="light"] .segment.active,
  [data-theme="light"] .message,
  [data-theme="light"] .avatar { color:#fff; }
  [data-theme="light"] .btn.danger { color:#b2212e; border-color:#efb9bf; background:#fff3f4; }
  [data-theme="light"] .segment { color:#59636f; }
  [data-theme="light"] .segment.active { background:#b9212e; }

  [data-theme="light"] .panel,
  [data-theme="light"] .stat,
  [data-theme="light"] .order-card,
  [data-theme="light"] .wallet-card,
  [data-theme="light"] .notification-menu,
  [data-theme="light"] .notification-card,
  [data-theme="light"] .orders-system-card,
  [data-theme="light"] .upcoming-event,
  [data-theme="light"] .upcoming-summary-card,
  [data-theme="light"] .payout-role-card,
  [data-theme="light"] .insights-leaderboard,
  [data-theme="light"] .leader-config-card,
  [data-theme="light"] .evaluation-rule-card,
  [data-theme="light"] .evaluation-entry,
  [data-theme="light"] .calendar-panel {
    color:var(--text);
    border-color:var(--line);
    background:#fff;
    box-shadow:0 8px 24px rgba(26,35,48,.055);
  }
  [data-theme="light"] .form-section,
  [data-theme="light"] .team-picker,
  [data-theme="light"] .payout-card,
  [data-theme="light"] .employee-expense-wrap,
  [data-theme="light"] .payout-rate-row,
  [data-theme="light"] .prepared-equipment-summary,
  [data-theme="light"] .shared-criteria-grid,
  [data-theme="light"] .upcoming-filters,
  [data-theme="light"] .database-path-box,
  [data-theme="light"] .quotation-row {
    color:var(--text);
    border-color:var(--line);
    background:var(--surface-2);
  }
  [data-theme="light"] .orders-system-card,
  [data-theme="light"] .payout-role-card,
  [data-theme="light"] .order-editor-modal {
    background:#fff;
  }
  [data-theme="light"] .order-editor-modal {
    color:var(--text);
    border-color:var(--line);
    box-shadow:0 24px 70px rgba(26,35,48,.22);
  }
  [data-theme="light"] .order-editor-modal .modal-head,
  [data-theme="light"] .order-editor-modal .modal-footer {
    border-color:var(--line);
    background:#f7f8fa;
  }
  [data-theme="light"] .order-editor-modal .form-section,
  [data-theme="light"] .order-editor-modal .team-picker,
  [data-theme="light"] .order-editor-modal .employee-expense-wrap { background:#f2f4f7; }

  [data-theme="light"] table { color:var(--text); }
  [data-theme="light"] th {
    color:#343a43;
    border-color:var(--line);
    background:#e8ebef;
  }
  [data-theme="light"] td { color:var(--text); border-color:var(--line); }
  [data-theme="light"] tbody tr:hover { background:#f7f8fa; }
  [data-theme="light"] .status { color:#4c5561; background:#eceff3; }
  [data-theme="light"] .status.active,
  [data-theme="light"] .status.delivered,
  [data-theme="light"] .status.paid,
  [data-theme="light"] .status.completed { color:#137747; background:#e5f6ed; }
  [data-theme="light"] .status.urgent,
  [data-theme="light"] .status.cancelled,
  [data-theme="light"] .status.unpaid { color:#b2212e; background:#fde8eb; }
  [data-theme="light"] .status.editing,
  [data-theme="light"] .status.booked { color:#285fac; background:#e8f0ff; }

  [data-theme="light"] .team-chip { color:#313841; background:#e1e5ea; }
  [data-theme="light"] .calendar-day { border-color:var(--line); background:#fff; }
  [data-theme="light"] .calendar-day:hover { background:#f4f6f8; }
  [data-theme="light"] .calendar-day.outside { color:#98a0aa; background:#fafbfc; }
  [data-theme="light"] .calendar-day.today { background:#fff5f6; }
  [data-theme="light"] .calendar-order-badge { color:#0c633b; background:#dff5e9; }
  [data-theme="light"] .upcoming-event.delivery { background:#f2f4f7; }
  [data-theme="light"] .notification-item:hover { background:#f3f5f7; }
  [data-theme="light"] .notification-item.unread { background:#fff3f4; }

  [data-theme="light"] .order-action-icon:not(.archive) img,
  [data-theme="light"] .icon-action img,
  [data-theme="light"] .notification-button img { filter:none; }
}

/* Orders preview design */
.orders-page { width:min(1280px,calc(100% - 48px)); }
.orders-calendar-panel {
  margin-bottom:22px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface);
  box-shadow:0 18px 44px rgba(0,0,0,.2);
}
.calendar-head { min-height:76px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:15px 18px; border-bottom:1px solid var(--line); }
.calendar-head h2 { margin:4px 0 0; font-size:20px; }
.calendar-title-row { display:flex; align-items:center; gap:9px; }
.calendar-month-order-count { display:inline-flex; align-items:center; gap:6px; min-height:25px; padding:3px 9px 3px 4px; color:#ffbdc8; border:1px solid rgba(255,80,96,.28); border-radius:999px; background:rgba(255,80,96,.09); font-size:9px; font-weight:850; white-space:nowrap; }
.calendar-month-order-count b { display:grid; place-items:center; min-width:18px; height:18px; color:#fff; border-radius:50%; background:var(--red); font-size:10px; }
.calendar-month-order-count em { font-style:normal; }
.calendar-eyebrow { color:var(--red-2); font-size:9px; font-weight:950; }
.calendar-controls { display:flex; align-items:center; gap:8px; }
.calendar-controls select { width:auto; min-height:38px; padding:0 30px 0 11px; border-radius:6px; font-size:11px; font-weight:850; }
.calendar-nav,.calendar-today { min-height:38px; border:1px solid var(--line); border-radius:6px; color:var(--text); background:var(--surface-2); font-weight:900; }
.calendar-nav { width:38px; padding:0; font-size:22px; line-height:1; }
.calendar-today { padding:0 13px; font-size:11px; }
.calendar-nav:hover,.calendar-today:hover { border-color:var(--red-2); }
.calendar-weekdays,.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.calendar-weekdays { border-bottom:1px solid var(--line); background:var(--surface-2); }
.calendar-weekdays span { padding:9px 11px; color:var(--muted); border-right:1px solid var(--line); font-size:9px; font-weight:950; text-transform:uppercase; }
.calendar-weekdays span:last-child { border-right:0; }
.calendar-day { position:relative; min-width:0; min-height:104px; padding:10px; overflow:hidden; color:var(--text); border:0; border-right:1px solid var(--line); border-bottom:1px solid var(--line); background:transparent; text-align:left; }
.calendar-day:nth-child(7n) { border-right:0; }
.calendar-day:hover { z-index:1; background:rgba(255,255,255,.035); box-shadow:inset 0 0 0 1px var(--red-2); }
.calendar-day.outside { background:rgba(255,255,255,.012); pointer-events:none; }
.calendar-day.today { background:rgba(255,80,96,.06); box-shadow:inset 3px 0 0 var(--red-2); }
.calendar-day-number { display:inline-grid; place-items:center; width:25px; height:25px; border-radius:50%; font-size:11px; font-weight:950; }
.calendar-day.today .calendar-day-number { color:white; background:var(--red); }
.calendar-order-badge { position:absolute; top:10px; right:9px; max-width:calc(100% - 44px); padding:4px 7px; overflow:hidden; color:#10251b; border-radius:10px; background:#54d996; font-size:8px; font-weight:950; text-overflow:ellipsis; white-space:nowrap; }
.calendar-order-badge b { font-weight:950; }
.calendar-order-badge em { font-style:normal; }
.calendar-day-preview { display:grid; gap:4px; margin-top:9px; }
.calendar-day-preview i { overflow:hidden; color:var(--muted); font-size:9px; font-style:normal; font-weight:750; text-overflow:ellipsis; white-space:nowrap; }
.calendar-day-panel { display:grid; gap:16px; }
.calendar-day-panel-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.calendar-day-panel-head span,.calendar-day-panel-head strong { display:block; }
.calendar-day-panel-head span { color:var(--red-2); font-size:9px; font-weight:950; }
.calendar-day-panel-head strong { margin-top:5px; font-size:17px; }
.calendar-day-orders { display:grid; gap:8px; }
.calendar-day-order { width:100%; min-height:70px; display:grid; grid-template-columns:76px minmax(0,1fr) auto; align-items:center; gap:13px; padding:12px; color:var(--text); border:1px solid var(--line); border-radius:8px; background:var(--surface-2); text-align:left; }
.calendar-day-order:hover { border-color:rgba(255,80,96,.65); }
.calendar-day-order-time { color:#54d996; font-size:10px; font-weight:950; }
.calendar-day-order strong,.calendar-day-order small { display:block; }
.calendar-day-order small { margin-top:5px; overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.calendar-empty-day { min-height:130px; display:grid; place-content:center; gap:7px; color:var(--muted); border:1px dashed var(--line); border-radius:8px; text-align:center; }
.calendar-empty-day strong { color:var(--text); }
.orders-toolbar {
  display:grid;
  grid-template-columns:auto minmax(230px,1fr) 165px 165px 170px 48px auto;
  gap:12px;
  align-items:center;
  margin-bottom:22px;
}
.orders-toolbar input,.orders-toolbar select {
  min-height:48px;
  padding-inline:16px;
  border-radius:18px;
  background:var(--surface-2);
}
.orders-add-button,.orders-prepare-button { min-height:48px; border-radius:18px; white-space:nowrap; }
.orders-search-button { min-height:48px; border-radius:18px; }
.orders-month-filters{display:flex;gap:8px;margin:-10px 0 18px;padding:2px 1px 4px;overflow-x:auto;scrollbar-width:thin}.orders-month-filters button{flex:0 0 auto;min-height:38px;padding:7px 15px;border:1px solid var(--line);border-radius:20px;background:var(--surface-2);color:var(--muted);font:inherit;font-size:11px;font-weight:850;white-space:nowrap;cursor:pointer}.orders-month-filters button:hover{border-color:rgba(255,100,113,.5);color:var(--text)}.orders-month-filters button[aria-pressed="true"]{border-color:var(--red-2);background:rgba(227,32,47,.14);color:var(--red-2);box-shadow:inset 0 0 0 1px rgba(227,32,47,.12)}
.settlement-month-filters{direction:rtl;margin:0;padding:12px 16px;border-bottom:1px solid var(--line)}
.orders-list { display:grid; gap:16px; }
.orders-system-card {
  padding:20px 22px;
  display:grid;
  grid-template-columns:minmax(220px,1.5fr) repeat(3,minmax(110px,.72fr)) minmax(135px,.8fr) auto max-content;
  align-items:center;
  gap:18px;
  border:1px solid var(--line);
  border-radius:26px;
  background:
    radial-gradient(circle at 7% 85%,rgba(215,25,32,.11),transparent 28%),
    linear-gradient(145deg,rgba(51,40,63,.92),rgba(33,26,45,.88));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
.order-card-main { min-width:0; }
.order-card-code {
  margin-bottom:8px;
  color:#ff8a94;
  font-size:11px;
  font-weight:950;
}
.orders-system-card .order-card-main h2 {
  margin:0;
  overflow:hidden;
  color:var(--text);
  font-size:17px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.order-type-chip {
  min-height:25px;
  margin-top:10px;
  padding:0 9px;
  display:inline-flex;
  align-items:center;
  border-radius:12px;
  color:var(--muted);
  background:rgba(255,255,255,.07);
  font-size:10px;
  font-weight:850;
}
.orders-system-card .notes-preview {
  max-width:340px;
  margin:9px 0 0;
  overflow:hidden;
  color:var(--muted);
  font-size:10px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.order-card-data span,.order-card-data strong,.order-card-data small { display:block; }
.order-card-data span {
  margin-bottom:7px;
  color:var(--muted);
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
}
.order-card-data strong { font-size:12px; line-height:1.4; }
.order-card-data small {
  margin-top:4px;
  overflow:hidden;
  color:var(--muted);
  font-size:9px;
  line-height:1.35;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.order-finance-data strong { color:#fff; }
.order-card-status { display:flex; justify-content:center; }
.order-card-status .status { min-height:30px; padding:0 11px; font-size:10px; font-weight:950; }
.order-card-actions {
  display:flex;
  flex-wrap:nowrap;
  justify-content:end;
  gap:5px;
}
.order-action-icon {
  width:34px;
  height:34px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--muted);
  background:rgba(255,255,255,.06);
}
.order-action-icon:hover { color:#fff; border-color:rgba(255,77,95,.45); background:rgba(255,77,95,.12); }
.order-action-icon img { width:16px; height:16px; filter:brightness(0) invert(1); opacity:.82; }
.order-action-icon:hover img { opacity:1; }
.order-action-icon.archive { color:#ff8a94; background:rgba(215,25,32,.08); border-color:rgba(255,77,95,.2); }
.order-action-icon.archive img {
  filter:brightness(0) saturate(100%) invert(59%) sepia(69%) saturate(1710%) hue-rotate(313deg) brightness(106%);
}
.order-action-icon.archive:hover { background:var(--red); }
.order-action-icon.archive:hover img { filter:brightness(0) invert(1); }
.order-action-icon.delete { color:#ff6b76; background:rgba(215,25,32,.12); border-color:rgba(255,77,95,.34); }
.order-action-icon.delete img {
  filter:brightness(0) saturate(100%) invert(47%) sepia(88%) saturate(1974%) hue-rotate(322deg) brightness(108%);
}
.order-action-icon.delete:hover { background:#d71920; border-color:#ff5664; }
.order-action-icon.delete:hover img { filter:brightness(0) invert(1); }
.proposal-history-actions { min-width:229px; }
.icon-action {
  width:34px;
  height:34px;
  flex:0 0 34px;
  padding:0;
  display:inline-grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:9px;
  color:var(--muted);
  background:rgba(255,255,255,.055);
  vertical-align:middle;
}
.icon-action:hover { color:#fff; border-color:rgba(255,77,95,.45); background:rgba(255,77,95,.12); }
.icon-action img {
  width:16px;
  height:16px;
  display:block;
  object-fit:contain;
  filter:brightness(0) invert(1);
  opacity:.85;
}
.icon-action:hover img { opacity:1; }
.icon-action.archive { border-color:rgba(255,118,130,.24); background:rgba(227,36,50,.08); }
.icon-action.archive img {
  filter:brightness(0) saturate(100%) invert(59%) sepia(69%) saturate(1710%) hue-rotate(313deg) brightness(106%);
}
.icon-action.archive:hover { background:var(--red); }
.icon-action.archive:hover img { filter:brightness(0) invert(1); }
.icon-action.search-action {
  width:48px;
  height:48px;
  border:0;
  border-radius:18px;
  background:linear-gradient(90deg,var(--red),var(--red-2),#ff8a94);
  box-shadow:0 12px 26px rgba(215,25,32,.22);
}
.icon-action.search-action img { width:20px; height:20px; opacity:1; }
.table-icon-actions { display:flex; align-items:center; gap:6px; }
[data-theme="light"] .icon-action:not(.archive) img { filter:none; }
.order-editor-modal {
  width:min(1050px,calc(100% - 44px));
  max-height:calc(100vh - 44px);
  border-radius:30px;
  background:linear-gradient(145deg,rgba(37,29,49,.99),rgba(18,11,29,.99));
  box-shadow:0 38px 90px rgba(0,0,0,.64);
}
.order-editor-modal .modal-head {
  min-height:76px;
  padding:16px 24px;
  background:rgba(37,29,49,.96);
  backdrop-filter:blur(18px);
}
.order-editor-modal .modal-head h2 { font-size:20px; }
.order-editor-modal .modal-body { padding:24px; }
.order-editor-modal .order-form-v11 { gap:18px; }
.order-editor-modal .modal-subtitle {
  margin:-8px 0 0;
  padding:0 2px;
  color:var(--muted);
  font-size:11px;
}
.order-editor-modal .form-section {
  padding:20px;
  border-radius:24px;
  background:rgba(48,38,59,.72);
}
.order-editor-modal .section-title { margin-bottom:18px; }
.order-editor-modal .section-title h3 { font-size:14px; }
.order-editor-modal input,.order-editor-modal select,.order-editor-modal textarea {
  min-height:48px;
  padding-inline:16px;
  border-radius:18px;
  background:var(--surface);
}
.order-editor-modal .team-add {
  grid-template-columns:minmax(0,1fr) 48px;
  gap:10px;
}
.order-editor-modal .team-add select,
.order-editor-modal .team-add .add-team {
  width:100%;
  height:48px;
  min-height:48px;
  border-radius:16px;
}
.order-editor-modal textarea { padding-block:14px; }
.order-editor-modal .team-picker,.order-editor-modal .payout-card,
.order-editor-modal .employee-expense-wrap { border-radius:18px; background:rgba(37,29,49,.74); }
.order-editor-modal .team-chip { border-radius:14px; background:#4b3e58; }
.order-editor-modal .modal-foot {
  padding:16px 24px;
  background:rgba(18,10,32,.97);
  backdrop-filter:blur(18px);
}
.order-editor-modal .modal-foot .btn { min-height:48px; padding-inline:20px; border-radius:18px; }
[data-theme="light"] .orders-system-card {
  background:radial-gradient(circle at 7% 85%,rgba(215,25,32,.07),transparent 28%),linear-gradient(145deg,#fff,#f1ecf3);
}
[data-theme="light"] .order-action-icon img { filter:none; }

@media (max-width:1150px) {
  .orders-toolbar { grid-template-columns:auto minmax(220px,1fr) 160px 160px; }
  .orders-toolbar #orderScope,.orders-search-button,.orders-prepare-button { grid-row:2; }
  .orders-system-card { grid-template-columns:minmax(190px,1.4fr) 115px 125px auto; }
  .orders-system-card .order-hide-tablet { display:none; }
  .order-card-actions { grid-column:1/-1; justify-content:flex-end; padding-top:12px; border-top:1px solid var(--line); }
}
@media (max-width:700px) {
  .orders-page { width:calc(100% - 24px); }
  .orders-business-toggle { min-height:64px; padding:12px 14px; }
  .orders-business-toggle strong { font-size:14px; }
  .orders-business-toggle small { font-size:10px; }
  .calendar-head { align-items:flex-start; flex-direction:column; }
  .calendar-controls {
    width:100%;
    display:grid;
    grid-template-columns:44px minmax(0,1.2fr) minmax(0,1fr) 44px;
    gap:8px;
  }
  .calendar-controls select { width:100%; min-width:0; }
  .calendar-controls .calendar-nav { width:44px; display:grid; place-items:center; }
  .calendar-controls #calendarPrevious { grid-column:1; grid-row:1; }
  .calendar-controls #calendarMonth { grid-column:2; grid-row:1; }
  .calendar-controls #calendarYear { grid-column:3; grid-row:1; }
  .calendar-controls #calendarNext { grid-column:4; grid-row:1; }
  .calendar-controls #calendarToday { grid-column:2 / 4; grid-row:2; width:100%; }
  .calendar-day { min-height:66px; padding:6px; }
  .calendar-order-badge { top:7px; right:5px; max-width:26px; padding:3px 6px; }
  .calendar-order-badge em { display:none; }
  .calendar-day-preview { display:none; }
  .calendar-weekdays span { padding:7px 4px; text-align:center; }
  .calendar-day-panel-head { align-items:stretch; flex-direction:column; }
  .calendar-day-order { grid-template-columns:60px minmax(0,1fr); }
  .calendar-day-order .status { grid-column:2; justify-self:start; }
  .orders-toolbar { grid-template-columns:1fr 1fr; }
  .orders-toolbar .orders-add-button,.orders-toolbar input { grid-column:1/-1; }
  .orders-toolbar #orderScope,.orders-search-button,.orders-prepare-button { grid-row:auto; }
  .orders-prepare-button { grid-column:1/-1; }
  .orders-system-card { grid-template-columns:minmax(0,1fr) auto; padding:17px; border-radius:20px; gap:14px; }
  .orders-system-card .order-card-data { display:none; }
  .order-card-status { align-self:start; }
  .order-card-actions { grid-column:1/-1; justify-content:start; padding-top:12px; border-top:1px solid var(--line); }
  .order-editor-modal { width:100%; min-height:100vh; max-height:100vh; border-radius:0; }
  .order-editor-modal .modal-body { padding:14px; }
  .order-editor-modal .form-section { padding:15px; border-radius:18px; }
  .upcoming-summary-card { min-height:66px; padding:11px 12px; }
  .upcoming-summary-card strong { font-size:19px; }
}

/* Quotations V1.6 */
.home-status-summary { margin-top:-6px; margin-bottom:22px; }
.quotations-page { width:min(1280px,calc(100% - 48px)); direction:ltr; text-align:left; }
html[dir="rtl"] .quotations-page table { direction:ltr; }
html[dir="rtl"] .quotations-page th,
html[dir="rtl"] .quotations-page td { text-align:left; }
html[dir="rtl"] .quotations-page input,
html[dir="rtl"] .quotations-page textarea,
html[dir="rtl"] .quotations-page select { direction:ltr; text-align:left; }
.quotation-form { display:grid; gap:18px; }
.quotation-details-section,.quotation-item-section { border-radius:8px; background:var(--surface); }
.quotation-columns,.quotation-row {
  display:grid;
  grid-template-columns:minmax(190px,1.45fr) 105px minmax(135px,.75fr) 105px minmax(145px,.8fr);
  gap:12px;
  align-items:center;
}
.quotation-columns {
  padding:0 11px 8px;
  color:var(--muted);
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
}
.quotation-items { display:grid; gap:9px; }
.quotation-row {
  padding:10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface-2);
  transition:opacity .18s ease,border-color .18s ease,background .18s ease;
}
.quotation-row.active { border-color:rgba(239,51,64,.28); }
.quotation-row.inactive { opacity:.43; }
.quotation-row.inactive input:not([type="checkbox"]),
.quotation-row.inactive button { pointer-events:none; }
.quotation-line-total {
  min-height:46px;
  padding:0 13px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  border:1px solid var(--line);
  border-radius:8px;
  color:var(--text);
  background:rgba(255,255,255,.035);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.quotation-item-check {
  min-height:44px;
  display:flex;
  align-items:center;
  gap:10px;
  font-size:12px;
  font-weight:900;
}
.quotation-item-main { min-width:0; display:grid; gap:7px; }
.quotation-item-check input { width:18px; height:18px; accent-color:var(--red); }
.quotation-item-check .quotation-item-name { width:100%; min-width:0; }
.quotation-item-note {
  width:100%;
  min-width:0;
  min-height:34px;
  padding:7px 10px;
  font-size:11px;
  color:var(--text);
}
.quotation-item-note[hidden] { display:none !important; }
.quotation-number { position:relative; }
.quotation-number input { padding-right:40px; }
.quotation-number button {
  position:absolute;
  right:5px;
  width:28px;
  height:17px;
  padding:0;
  border:0;
  border-radius:4px;
  color:var(--muted);
  background:var(--surface-3);
  font-size:10px;
  font-weight:900;
}
.quotation-number .up { top:4px; }
.quotation-number .down { bottom:4px; }
.quotation-total {
  padding:17px 19px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border:1px solid rgba(56,199,123,.28);
  border-radius:8px;
  background:rgba(56,199,123,.07);
}
.quotation-total span { color:var(--muted); font-size:11px; font-weight:900; text-transform:uppercase; }
.quotation-total strong { color:var(--green); font-size:25px; }
.quotation-form-actions { display:flex; justify-content:flex-end; gap:8px; }
.quotation-form-actions .btn { min-height:46px; }
.quotation-form-actions .btn img { width:17px; height:17px; }
.quotation-history-panel { width:100%; }
.quotation-history-search {
  padding:14px 16px;
  display:grid;
  grid-template-columns:minmax(220px,1fr) 42px;
  gap:9px;
  border-bottom:1px solid var(--line);
}
.quotation-history-search .icon-action { width:42px; height:42px; }
.quotation-actions { display:flex; align-items:center; gap:6px; min-width:114px; }
.professional-proposals { display:grid; gap:16px; }
.proposal-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.proposal-toolbar h2 { margin:0; }
.proposal-toolbar p { margin:4px 0 0; }
.proposal-editor-shell { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,calc((clamp(530px,68dvh,760px) - 60px) * .7070707)); height:clamp(530px,68dvh,760px); gap:20px; align-items:stretch; }
.proposal-editor { min-width:0; display:flex; flex-direction:column; gap:12px; padding:18px; overflow-y:auto; border:1px solid var(--line); border-radius:14px; background:var(--surface); scrollbar-width:thin; }
.proposal-editor-intro { display:grid; gap:4px; padding-bottom:12px; border-bottom:1px solid var(--line); }.proposal-editor-intro span { color:var(--red-2); font-size:10px; font-weight:950; letter-spacing:.12em; }.proposal-editor-intro strong { font-size:17px; }
.proposal-item-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) 54px 54px 86px 34px; gap:7px; margin:7px 0; }
.proposal-live { width:min(100%,calc((clamp(530px,68dvh,760px) - 60px) * .7070707)); min-width:0; overflow:hidden; container-type:inline-size; }
.proposal-live-label { margin:0 0 8px; color:var(--muted); font-size:11px; font-weight:900; letter-spacing:.08em; }
.proposal-page-nav { display:flex; gap:5px; margin:-2px 0 8px; }.proposal-page-nav button { width:25px; height:25px; padding:0; color:var(--muted); border:1px solid var(--line); border-radius:50%; background:var(--surface-2); font-size:10px; font-weight:900; cursor:pointer; }.proposal-page-nav button.active { color:#fff; border-color:var(--red); background:var(--red); }
.proposal-sheet { position:relative; width:100%; aspect-ratio:210/297; container-type:inline-size; color:#161316; background:#f4f3f1; box-shadow:0 15px 40px rgba(0,0,0,.25); }
.proposal-reference-sheet { display:grid; grid-template-rows:43% 57%; overflow:hidden; }.proposal-reference-hero { position:relative; display:flex; flex-direction:column; justify-content:flex-end; align-items:flex-start; padding:7%; color:#fff; background:linear-gradient(135deg,#17151a82,#3b1b258c 65%,#ef3340a8),url('/assets/proposal-default-cover.jpg'); background-position:center; background-size:cover; }.proposal-reference-hero:after { position:absolute; inset:0; background:repeating-linear-gradient(120deg,transparent 0 14px,#ffffff09 14px 15px); content:""; }.proposal-reference-hero>* { position:relative; z-index:1; }.proposal-reference-hero .proposal-logo { font-size:7cqw; font-weight:950; letter-spacing:.12em; }.proposal-reference-hero span { margin-top:4px; color:#ffd8df; font-size:1.8cqw; font-weight:900; letter-spacing:.14em; }.proposal-reference-body { position:relative; padding:7% 10% 6% 15%; overflow:hidden; }.proposal-reference-rule { position:absolute; top:0; bottom:0; left:7%; width:1.5%; background:#111; }.proposal-reference-title small { color:#ef4037; font-size:2cqw; letter-spacing:.08em; }.proposal-reference-title h1 { margin:3px 0 10%; color:#ef4037; font-size:5.2cqw; line-height:1.02; }.proposal-reference-body h2 { margin:0 0 6px; font-size:8.5cqw; letter-spacing:.04em; line-height:.9; }.proposal-sheet table { width:100%; min-width:0; table-layout:fixed; border-collapse:collapse; font-size:2.5cqw; }
.proposal-sheet th:first-child { width:36%; }
.proposal-sheet th,.proposal-sheet td { position:static; font-size:inherit; overflow-wrap:anywhere; }.proposal-sheet th { padding:5px 3px; border-bottom:1px solid #111; font-size:.83em; text-align:left; }.proposal-sheet td { padding:1.5cqw .8cqw; border-bottom:1px solid #d1cdcb; text-align:left; }.proposal-sheet td small { display:block; color:#6c6467; font-size:.8em; }.proposal-total { display:flex; justify-content:space-between; margin-top:7px; padding-top:7px; border-top:2px solid #111; font-weight:950; }.proposal-total strong { font-size:3cqw; }.proposal-sheet section { margin-top:11px; font-size:1.8cqw; }.proposal-sheet section h3 { margin:0 0 3px; color:#ef4037; }.proposal-sheet p { margin:0; white-space:pre-wrap; }.proposal-contact { margin-top:13px!important; padding-top:7px; border-top:1px solid #aaa; }
.proposal-cover-copy { max-width:82%; font-size:2.25cqw!important; line-height:1.45; }.proposal-partners-sheet,.proposal-closing-sheet { display:grid; grid-template-rows:48% 52%; overflow:hidden; }.proposal-image-page { display:flex; align-items:flex-end; padding:8%; color:#fff; background:linear-gradient(135deg,#17151a,#632332); background-position:center; background-size:cover; font-size:2cqw; font-weight:900; letter-spacing:.14em; }.proposal-page-copy { padding:9% 12%; overflow:hidden; }.proposal-page-copy small { color:#ef4037; font-size:2cqw; font-weight:900; letter-spacing:.1em; }.proposal-page-copy h2 { margin:3% 0 8%; font-size:5.4cqw; line-height:1; }.proposal-page-copy div,.proposal-page-copy p,.proposal-page-copy a { display:block; margin-top:5%; font-size:2.15cqw; line-height:1.5; }.proposal-page-copy a { color:#ef4037; font-weight:900; text-decoration:none; }.proposal-quote-sheet { padding:12% 11%; overflow:hidden; }.proposal-quote-head { display:flex; flex-direction:column; gap:7%; margin-bottom:12%; }.proposal-quote-head span { font-size:8.5cqw; font-weight:950; letter-spacing:.04em; }.proposal-quote-head small { color:#ef4037; font-size:2cqw; }.proposal-quote-sheet table { font-size:2.5cqw; }.proposal-quote-sheet .proposal-total>span { font-size:4cqw; }.proposal-quote-sheet .proposal-total { margin-top:6%; }.proposal-closing-sheet .proposal-page-copy { background:#17151a; color:#fff; }.proposal-closing-sheet .proposal-page-copy small { color:#ff9bac; }
.proposal-partners-sheet { grid-template-rows:64% 36%; }.proposal-partners-sheet .proposal-image-page { position:relative; display:block; padding:11% 13%; background-image:linear-gradient(#111a,#111a),url('/assets/proposal-default-partners.jpg'); }.proposal-partners-sheet .proposal-image-page:before { position:absolute; top:0; bottom:0; left:8%; width:1.5%; background:#111; content:""; }.proposal-partners-sheet .proposal-image-page>span { display:block; margin:23% 0 10%; font-size:5.2cqw; text-align:center; }.proposal-partner-logo-grid { display:flex; flex-wrap:wrap; justify-content:center; gap:5%; min-height:12%; padding:0 9%; font-size:1.8cqw; text-align:center; }.proposal-partner-logo-grid img { width:calc(16% * var(--partner-logo-scale,1)); height:calc(6cqw * var(--partner-logo-scale,1)); object-fit:contain; filter:brightness(0) invert(1); }.proposal-partners-sheet [data-preview-reference] { display:block; margin-top:10%; color:#fff; font-size:2.3cqw; text-align:center; text-decoration:underline; }.proposal-price-note { margin-top:6%; color:#5c555a; font-size:1.7cqw!important; }.proposal-closing-sheet { grid-template-rows:61% 39%; }.proposal-closing-top { position:relative; padding:12% 12% 8% 15%; overflow:hidden; }.proposal-closing-top h2 { margin:0 0 9%; font-size:7cqw; line-height:.9; }.proposal-closing-top section { margin-top:8%; font-size:2cqw; }.proposal-closing-top section h3 { color:#111; font-size:2.5cqw; }.proposal-closing-notes p { margin-top:2%; }.proposal-closing-sheet .proposal-image-page { display:block; padding:9% 12%; background-image:linear-gradient(#1118,#1118),url('/assets/proposal-default-closing.jpg'); }.proposal-closing-sheet .proposal-image-page>span { display:block; font-size:7cqw; line-height:.9; }.proposal-contact-row { display:flex; justify-content:space-between; gap:8%; margin-top:13%; font-size:1.9cqw; letter-spacing:.03em; }.proposal-contact-row p { margin:0; }
@media (max-width:760px) { .proposal-toolbar{align-items:stretch;flex-direction:column}.proposal-toolbar .actions-row{display:flex;gap:8px}.proposal-toolbar .actions-row .btn{flex:1}.proposal-editor-shell{grid-template-columns:1fr;height:auto}.proposal-live{width:100%;order:-1;overflow:visible}.proposal-sheet{width:100%;min-height:0}.proposal-editor{max-height:none;overflow:visible}.proposal-item-row{grid-template-columns:minmax(0,1fr) 52px 52px 76px 32px}.proposal-item-row .pp-note{grid-column:1/-1}.proposal-media-fields select[multiple]{min-height:130px} }
.quotation-print-preview { padding:20px; }
.quotation-paper { padding:16mm 17mm; }
.quotation-paper-header {
  min-height:34mm;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
  gap:24px;
  padding-bottom:8mm;
  border-bottom:2px solid #d71920;
}
.quotation-brand-logo {
  width:250px;
  height:92px;
  object-fit:contain;
  object-position:left center;
}
.quotation-brand-logo.spot { width:220px; height:105px; }
.quotation-paper-title { padding:8mm 0 6mm; }
.quotation-paper-title span { color:#d71920; font-size:8px; font-weight:950; text-transform:uppercase; }
.quotation-paper-title h1 { margin:5px 0 0; color:#171319; font-size:24px; }
/* Printed quotations are English-first documents. Override the application RTL
   table rule so columns keep the same left-to-right reading order as the paper. */
html[dir="rtl"] .quotation-paper-table { direction:ltr; }
html[dir="rtl"] .quotation-paper-table th,
html[dir="rtl"] .quotation-paper-table td { text-align:left; }
.quotation-paper-table td:first-child small { display:block; margin-top:3px; color:#8b838c; font-size:7px; }
.quotation-paper-table .quotation-paper-item-note {
  color:#4d464f;
  font-size:8px;
  line-height:1.4;
  white-space:pre-wrap;
}
.quotation-paper-table .quotation-paper-item-note::before { content:"- "; }
.quotation-paper-table .quotation-paper-item-group { color:#9b949c; font-size:6.5px; text-transform:uppercase; }
.invoice-deliverables-table th:nth-child(1) { width:22%; }
.invoice-deliverables-table th:nth-child(2) { width:30%; }
.invoice-deliverables-table th:nth-child(3) { width:8%; }
.invoice-deliverables-table th:nth-child(4) { width:14%; }
.invoice-deliverables-table th:nth-child(5) { width:26%; }
.invoice-deliverables-table td { overflow-wrap:anywhere; }
.deliverable-row .payout-card-top strong { color:var(--red-2); }
.quotation-paper-total {
  margin-top:8mm;
  padding:13px 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-left:4px solid #d71920;
  color:#241f25;
  background:#f3f1f3;
}
.quotation-paper-total span { color:#746d76; font-size:9px; font-weight:900; text-transform:uppercase; }
.quotation-paper-total strong { color:#171319; font-size:20px; }
.quotation-paper-notes {
  margin-top:3mm;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  break-inside:avoid;
  page-break-inside:avoid;
}
.quotation-paper-notes > div { min-height:20mm; padding:12px; border:1px solid #e1dce2; color:#282229; }
.quotation-paper-notes strong { font-size:9px; text-transform:uppercase; }
.quotation-paper-notes p { margin:7px 0 0; color:#6f6871; font-size:9px; line-height:1.6; white-space:pre-wrap; }
[data-theme="light"] .quotation-row { background:#f5f2f6; }
.database-path-box {
  margin:16px;
  padding:13px 15px;
  display:grid;
  gap:7px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface-2);
}
.database-path-box span { color:var(--muted); font-size:10px; font-weight:900; text-transform:uppercase; }
.database-path-box code { overflow:auto; color:var(--text); font-size:12px; white-space:nowrap; }
.statement-builder { display:grid; gap:16px; }
.statement-result .stats { margin:14px 0; }
.statement-panel { margin:0; }
.invoice-detail-grid {
  margin-bottom:7mm;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.invoice-detail-grid > div {
  padding:10px 12px;
  border:1px solid #e1dce2;
  color:#282229;
}
.invoice-detail-grid span { display:block; color:#8b838c; font-size:7px; font-weight:950; text-transform:uppercase; }
.invoice-detail-grid strong { display:block; margin-top:4px; font-size:10px; line-height:1.45; }
.invoice-totals {
  margin-top:8mm;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}
.invoice-totals > div {
  padding:12px;
  border:1px solid #e1dce2;
  color:#241f25;
  background:#f7f5f7;
}
.invoice-totals span { display:block; color:#746d76; font-size:8px; font-weight:900; text-transform:uppercase; }
.invoice-totals strong { display:block; margin-top:5px; font-size:17px; }
.invoice-totals .remaining { border-left:4px solid #d71920; }
.statement-paper-table { font-size:7px; }
.statement-paper-table th,
.statement-paper-table td { padding:6px 5px; }

@media (max-width:700px) {
  .page,
  .orders-page,
  .quotations-page {
    width:calc(100% - 24px);
    padding-inline:0;
  }
  .quotation-columns { display:none; }
  .quotation-row { grid-template-columns:1fr 1fr; }
  .quotation-item-check { grid-column:1/-1; }
  .quotation-unit-cost,.quotation-line-total { grid-column:1/-1; }
  .quotation-form-actions { flex-direction:column; }
  .quotation-form-actions .btn { width:100%; }
  .quotation-paper-notes { grid-template-columns:1fr; }
}

@media print {
  .preview-shell.quotation-print-preview {
    padding:0!important;
  }
  .quotation-paper {
    width:210mm;
    min-height:297mm;
    margin:0;
    padding:16mm 17mm;
    overflow:visible;
  }
  .quotation-paper-total {
    margin-top:5mm;
    break-after:avoid;
    page-break-after:avoid;
  }
  .quotation-paper-notes {
    margin-top:3mm;
    grid-template-columns:1fr 1fr!important;
    break-before:avoid;
    page-break-before:avoid;
    break-inside:avoid;
    page-break-inside:avoid;
  }
}

/* Keep mobile app navigation above all legacy responsive layers. */
@media screen and (max-width:700px) {
  body { padding-bottom:calc(66px + env(safe-area-inset-bottom)); }
  .topbar {
    min-height:62px;
    padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));
    flex-wrap:nowrap;
    gap:7px;
    background:var(--bg);
    backdrop-filter:none;
  }
  .brand { order:0; min-width:0; flex:0 0 auto; }
  .brand-name { display:none; }
  .user-zone { order:1; margin-left:auto; gap:6px; }
  .main-nav {
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:75;
    min-height:62px;
    padding:7px max(8px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    display:flex;
    flex-basis:auto;
    gap:4px;
    overflow-x:auto;
    border-top:1px solid var(--line);
    background:rgba(13,13,18,.97);
    box-shadow:0 -10px 30px rgba(0,0,0,.22);
    backdrop-filter:blur(18px);
  }
  .nav-btn { min-width:72px; min-height:46px; flex:1 0 auto; padding:0 10px; border-radius:6px; font-size:11px; }
  .page,
  .orders-page,
  .quotations-page { width:100%; padding:20px 12px 34px; }
  .panel,
  .stat,
  .wallet-card,
  .order-card,
  .orders-system-card { border-radius:8px; }
  .message-root { bottom:calc(76px + env(safe-area-inset-bottom)); }
  [data-theme="light"] .main-nav { background:rgba(255,255,255,.97); }
}

/* Mobile-first operational layout. */
@media screen and (max-width:700px) {
  html { scroll-padding-top:76px; scroll-padding-bottom:84px; }
  body { overflow-x:hidden; }
  button,
  input,
  select,
  textarea { touch-action:manipulation; }
  input,
  select,
  textarea { min-width:0; font-size:16px; }
  input[type="checkbox"],
  input[type="radio"] {
    width:20px;
    height:20px;
    min-height:20px;
    padding:0;
    justify-self:end;
    accent-color:var(--red);
  }

  .topbar {
    border-bottom-color:var(--line);
    box-shadow:0 5px 18px rgba(0,0,0,.16);
  }
  .main-nav {
    scroll-padding-inline:calc(50vw - 46px);
    scroll-snap-type:x proximity;
    overscroll-behavior-x:contain;
    scrollbar-width:none;
  }
  .main-nav::-webkit-scrollbar,
  .tabs::-webkit-scrollbar,
  .wallet-grid::-webkit-scrollbar { display:none; }
  .nav-btn {
    scroll-snap-align:center;
    opacity:.78;
    transition:opacity .16s ease,background .16s ease,border-color .16s ease;
  }
  .nav-btn.active { opacity:1; }
  .nav-btn[data-page="control"] { min-width:96px; }
  .tabs {
    margin-inline:-12px;
    padding-inline:12px;
    scroll-padding-inline:12px;
    scrollbar-width:none;
  }
  .tab { min-height:48px; scroll-snap-align:start; }

  .page,
  .orders-page,
  .quotations-page {
    padding:20px 12px calc(104px + env(safe-area-inset-bottom));
  }
  .page-head { gap:10px; }
  .page-head h1 { font-size:25px; line-height:1.15; }
  .page-head p { max-width:38ch; font-size:14px; line-height:1.35; }
  .page-head .actions { gap:8px; }

  .cash-page .page-head .actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cash-page .page-head .actions #cashMovement,
  .cash-page .page-head .actions #accountStatement { grid-column:1/-1; }
  .cash-page .page-head .actions .btn { min-height:46px; padding:9px 8px; font-size:12px; }
  .cash-page .wallet-grid {
    display:flex;
    gap:10px;
    margin-inline:-12px;
    padding:0 12px 8px;
    scroll-padding-inline:12px;
    scroll-snap-type:x mandatory;
    scrollbar-width:none;
  }
  .cash-page .wallet-card {
    width:calc(100vw - 48px);
    min-width:calc(100vw - 48px);
    scroll-snap-align:center;
  }
  .cash-page .wallet-card strong { font-size:24px; }

  .stats { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px; }
  .stat { min-height:104px; padding:14px; }
  .stat span { font-size:10px; line-height:1.35; }
  .stat strong { margin-top:8px; font-size:21px; }

  .panel { overflow:visible; }
  .panel-head { min-height:54px; padding:12px; }
  .panel-head h2 { font-size:15px; }
  .panel-body { padding:12px; }
  .panel-head .actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .panel-head .actions > * { min-width:0; width:100%; }

  .mobile-card-wrap {
    max-height:none;
    padding:10px;
    overflow-x:hidden;
    overflow-y:visible;
    border-radius:0 0 8px 8px;
    background:var(--surface-2);
  }
  .mobile-card-wrap.bounded-data-region {
    max-height:min(560px,62dvh);
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-gutter:auto;
    padding:9px;
    border-bottom:1px solid var(--line);
    background:var(--surface-2);
  }
  .table-wrap.mobile-card-wrap table.mobile-card-table {
    width:100%;
    min-width:0 !important;
    display:block;
  }
  .mobile-card-table thead { display:none; }
  .mobile-card-table tbody { display:grid; gap:9px; }
  .mobile-card-table tbody tr {
    min-width:0;
    display:block;
    overflow:hidden;
    border:1px solid var(--line);
    border-left:3px solid var(--surface-3);
    border-radius:7px;
    background:var(--surface);
  }
  .mobile-card-table tbody tr:hover { background:var(--surface); }
  .mobile-card-table td {
    min-height:42px;
    padding:9px 10px;
    display:grid;
    grid-template-columns:1fr;
    align-items:start;
    gap:5px;
    overflow-wrap:anywhere;
    word-break:break-word;
    border-bottom:1px solid var(--line);
    font-size:12px;
  }
  .mobile-card-table td:last-child { border-bottom:0; }
  .mobile-card-table td::before {
    content:attr(data-label);
    color:var(--muted);
    font-size:9px;
    font-weight:900;
    line-height:1.25;
    text-transform:uppercase;
  }
  .mobile-card-table td > * { min-width:0; max-width:100%; }
  .mobile-card-table td small,
  .mobile-card-table td strong { overflow-wrap:anywhere; word-break:break-word; }
  .mobile-card-table td[colspan] { display:block; padding:18px 12px; text-align:center; }
  .mobile-card-table td[colspan]::before { display:none; }
  .mobile-card-table td .btn { width:100%; }
  .mobile-card-table td .icon-action { justify-self:end; }
  .mobile-card-table .table-icon-actions { flex-wrap:wrap; justify-content:flex-start; }
  .mobile-card-table td:has(.status),
  .mobile-card-table td.money { align-items:center; }
  .permission-grid { min-width:760px; }
  .control-page .table-wrap:has(.permission-grid) {
    max-height:calc(100dvh - 245px);
    border:1px solid var(--line);
  }

  .filters { margin-bottom:12px; grid-template-columns:1fr 1fr; }
  .filters > * { min-width:0; }
  .filters button { width:100%; }
  .recurring-strip { flex-wrap:nowrap; overflow:auto; scrollbar-width:none; }
  .recurring-strip span { flex:0 0 auto; }

  .modal-backdrop { background:rgba(4,4,8,.72); backdrop-filter:blur(5px); }
  .modal { max-height:94dvh; }
  .modal-head h2 { font-size:17px; }
  .close { width:44px; height:44px; padding:0; }
  .modal-foot .btn { min-height:48px; }
  .form-grid,
  .form-grid-2 { gap:12px; }
  .field > span,
  .field > label { font-size:10px; }

  .quotation-row { padding:12px; gap:9px; }
  .quotation-line-total { min-height:44px; }
  .quotation-form-actions { position:sticky; bottom:72px; z-index:8; padding:10px; border:1px solid var(--line); background:var(--surface); }

  .order-editor-modal .form-section,
  .order-editor-modal .team-picker,
  .order-editor-modal .payout-card,
  .order-editor-modal .employee-expense-wrap { border-radius:8px; }
  .order-editor-modal input,
  .order-editor-modal select,
  .order-editor-modal textarea,
  .order-editor-modal .modal-foot .btn { border-radius:8px; }

  [data-theme="light"] .mobile-card-wrap { background:#eef1f4; }
  [data-theme="light"] .mobile-card-table tbody tr { border-left-color:#aeb7c2; background:#fff; }
  [data-theme="light"] .mobile-card-table tbody tr:hover { background:#fff; }
}

@media screen and (max-width:430px) {
  .cash-page .page-head .actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .panel-head .actions { grid-template-columns:1fr; }
  .modal-foot { display:grid; grid-template-columns:1fr 1fr; }
  .modal-foot .btn { width:100%; }
  .modal-foot .btn:only-child { grid-column:1/-1; }
  .mobile-card-table td { grid-template-columns:1fr; }
}

/* Advanced phone interactions. */
.loading-skeleton { padding:12px; display:grid; gap:12px; }
.loading-skeleton span { height:82px; border:1px solid var(--line); border-radius:8px; background:linear-gradient(90deg,var(--surface),var(--surface-2),var(--surface)); background-size:220% 100%; animation:skeleton-loading 1.2s ease-in-out infinite; }
@keyframes skeleton-loading { to { background-position:-220% 0; } }
.order-detail-actions { margin:0 0 18px; display:flex; flex-wrap:wrap; gap:10px; }
.order-detail-actions .btn { text-decoration:none; }
.mobile-order-contact-actions { display:none; }
.favorite-order { display:none; }

@media screen and (max-width:700px) {
  .topbar {
    min-height:calc(62px + env(safe-area-inset-top));
    padding-top:calc(8px + env(safe-area-inset-top));
  }
  body.modal-open {
    position:fixed;
    left:0;
    right:0;
    width:100%;
    height:100%;
    overflow:hidden;
    overscroll-behavior:none;
  }
  body.modal-open .main-nav,
  body.modal-open .mobile-quick-action { visibility:hidden; }
  .modal-backdrop {
    padding:max(env(safe-area-inset-top),1px) env(safe-area-inset-right) 0 env(safe-area-inset-left);
    overflow:hidden;
    overscroll-behavior:none;
  }
  .modal {
    width:100%;
    height:calc(100vh - env(safe-area-inset-top));
    height:calc(100dvh - env(safe-area-inset-top));
    max-height:calc(100vh - env(safe-area-inset-top));
    max-height:calc(100dvh - env(safe-area-inset-top));
    padding-bottom:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    overscroll-behavior:contain;
  }
  .modal.small {
    height:auto;
    max-height:calc(100vh - env(safe-area-inset-top));
    max-height:calc(100dvh - env(safe-area-inset-top));
  }
  .modal-head {
    position:relative;
    top:auto;
    flex:0 0 auto;
    padding:14px max(14px,env(safe-area-inset-right)) 14px max(14px,env(safe-area-inset-left));
  }
  .modal-body {
    min-height:0;
    flex:1 1 auto;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  .modal-foot {
    position:relative;
    bottom:auto;
    z-index:10;
    min-height:calc(72px + env(safe-area-inset-bottom));
    flex:0 0 auto;
    padding:12px max(14px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
  }
  .order-editor-modal {
    position:relative;
    width:100%;
    height:calc(100vh - env(safe-area-inset-top));
    height:calc(100dvh - env(safe-area-inset-top));
    max-height:calc(100vh - env(safe-area-inset-top));
    max-height:calc(100dvh - env(safe-area-inset-top));
  }
  body::before {
    content:"";
    position:fixed;
    top:calc(8px + env(safe-area-inset-top));
    left:50%;
    z-index:140;
    width:32px;
    height:4px;
    border-radius:4px;
    background:var(--muted);
    opacity:0;
    transform:translate(-50%,var(--pull-distance,0px));
    pointer-events:none;
  }
  html.mobile-pulling body::before { opacity:.65; }
  .mobile-secondary-nav { display:none!important; }
  .main-nav { overflow:hidden; }
  .main-nav .nav-btn { min-width:0; flex:1 1 20%; }
  .main-nav .mobile-more-nav { display:block; }
  .main-nav .nav-btn {
    display:grid;
    grid-template-rows:auto auto;
    align-content:center;
    justify-items:center;
    gap:2px;
  }
  .main-nav .nav-icon {
    display:block;
    font-size:17px;
    line-height:1;
    opacity:.92;
  }
  .main-nav .nav-btn span:last-child {
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .mobile-more-grid,
  .mobile-quick-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .mobile-more-grid .btn,
  .mobile-quick-grid .btn { min-height:52px; }

  .mobile-quick-action {
    position:fixed;
    right:16px;
    bottom:calc(76px + env(safe-area-inset-bottom));
    z-index:72;
    width:52px;
    height:52px;
    padding:0;
    border:1px solid #ff6874;
    border-radius:50%;
    color:#fff;
    background:var(--red);
    box-shadow:0 10px 28px rgba(0,0,0,.3);
    font-size:28px;
    font-weight:500;
    line-height:1;
  }

  .network-quality {
    width:8px;
    height:8px;
    flex:0 0 auto;
    border-radius:50%;
    background:#38c878;
    box-shadow:0 0 0 3px rgba(56,200,120,.13);
  }
  .network-quality.slow { background:#d6a126; box-shadow:0 0 0 3px rgba(214,161,38,.14); }
  body:not(:has(.app-shell)) .network-quality { display:none; }

  .orders-toolbar .mobile-filter-toggle { display:block; grid-column:1/-1; }
  .orders-toolbar.mobile-filters-collapsed > :not(.orders-add-button):not(.mobile-filter-toggle):not(.booking-archive-toggle) { display:none; }
  .upcoming-filters.mobile-filters-collapsed { display:none; }
  .mobile-home-filter-toggle { width:100%; margin:0 0 12px; }
  .mobile-voice-search { min-height:44px; padding-inline:10px; font-size:11px; }
  .orders-toolbar .mobile-voice-search { grid-column:auto; }

  .favorite-order { display:grid; color:#d6a126; font-size:22px; line-height:1; }
  .favorite-order.active { color:#f2bf33; border-color:rgba(242,191,51,.55); background:rgba(242,191,51,.12); }
  .orders-system-card { touch-action:pan-y; }
  .orders-system-card.mobile-actions-open .order-card-actions { border-color:var(--red); background:rgba(227,32,47,.07); }

  .mobile-order-contact-actions,
  .order-detail-actions {
    margin:0 0 14px;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  .mobile-order-contact-actions .btn,
  .order-detail-actions .btn { display:flex; align-items:center; justify-content:center; text-decoration:none; }

  .mobile-order-stepper {
    position:sticky;
    top:0;
    z-index:6;
    margin:-14px -14px 14px;
    padding:12px 14px;
    display:grid;
    grid-template-columns:auto 1fr;
    align-items:center;
    gap:4px 10px;
    border-bottom:1px solid var(--line);
    background:var(--surface);
  }
  .mobile-step-count { color:var(--red-2); font-size:10px; font-weight:950; }
  .mobile-step-label { overflow:hidden; font-size:13px; font-weight:900; text-overflow:ellipsis; white-space:nowrap; }
  .mobile-step-track { grid-column:1/-1; display:grid; grid-template-columns:repeat(var(--step-count,6),1fr); gap:4px; }
  .mobile-step-track span { height:3px; border-radius:3px; background:var(--surface-3); }
  .mobile-step-track span.active { background:var(--red); }
  .order-editor-modal .mobile-step-back,
  .order-editor-modal .mobile-step-next { display:block; }
  .order-editor-modal .modal-foot { grid-template-columns:1fr 1fr; }
  .order-editor-modal .modal-body {
    padding-bottom:calc(96px + env(safe-area-inset-bottom));
  }
  .order-editor-modal .modal-foot {
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    width:100%;
  }
  .order-editor-modal .modal-foot .mobile-step-next,
  .order-editor-modal .modal-foot [type="submit"] {
    position:relative;
    z-index:1;
  }
  .order-editor-modal .modal-foot #cancelOrder { display:none; }
  .order-editor-modal .modal-foot [hidden] { display:none!important; }
  .order-editor-modal .mobile-step-back[hidden] + .mobile-step-next { grid-column:1/-1; }

  .mobile-today-mode .home-status-summary,
  .mobile-today-mode .mobile-home-filter-toggle,
  .mobile-today-mode .upcoming-filters { display:none!important; }

  .mobile-update-banner {
    position:fixed;
    left:12px;
    right:12px;
    bottom:calc(76px + env(safe-area-inset-bottom));
    z-index:130;
    min-height:54px;
    padding:8px 8px 8px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    border:1px solid var(--line);
    border-radius:8px;
    color:var(--text);
    background:var(--surface);
    box-shadow:var(--shadow);
    font-size:12px;
    font-weight:850;
  }
  .mobile-update-banner button { min-height:38px; padding:0 12px; border:0; border-radius:6px; color:#fff; background:var(--red); font-weight:900; }

  [data-theme="light"] .mobile-quick-action { border-color:#a61b2b; background:#c92837; }
  [data-theme="light"] .network-quality { background:#087443; }
}

@media screen and (max-width:700px) and (orientation:landscape) {
  .topbar { position:relative; }
  .page,
  .orders-page,
  .quotations-page { padding-top:12px; }
  .modal { max-height:100dvh; }
  .order-editor-modal .modal-body { padding-inline:max(18px,env(safe-area-inset-left)); }
  .stats { grid-template-columns:repeat(4,minmax(0,1fr))!important; }
}

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}

/* Compact theme control beside the product mark. */
.brand .theme-toggle {
  width:38px;
  min-width:38px;
  height:38px;
  min-height:38px;
  flex:0 0 38px;
  padding:0;
  border-radius:8px;
  font-size:20px;
}
.brand .theme-toggle::after { content:none; }
.theme-icon { display:block; line-height:1; transform:translateY(-1px); }
[data-theme="light"] .brand .theme-toggle { color:#27313d; background:#fff; }

/* Final light-theme contrast guard. Keep this after component-specific styling. */
[data-theme="light"] {
  --line:#cbd1d9;
  --muted:#56616e;
  --red:#c92a38;
  --red-2:#b42331;
  --green:#076b3c;
  --blue:#2458a6;
  --orange:#8b4b12;
  --yellow:#754700;
}
[data-theme="light"] .modal,
[data-theme="light"] .modal-body,
[data-theme="light"] .order-editor-modal { color:var(--text); background:#fff; }
[data-theme="light"] .modal-head,
[data-theme="light"] .modal-foot,
[data-theme="light"] .order-editor-modal .modal-head,
[data-theme="light"] .order-editor-modal .modal-foot {
  color:var(--text);
  border-color:var(--line);
  background:#f7f8fa;
}
[data-theme="light"] .order-editor-modal .form-section {
  color:var(--text);
  border-color:#cbd1d9;
  background:#f1f3f6;
}
[data-theme="light"] .order-editor-modal .team-picker,
[data-theme="light"] .order-editor-modal .payout-card,
[data-theme="light"] .order-editor-modal .employee-expense-wrap {
  color:var(--text);
  border-color:#c3cad4;
  background:#fff;
}
[data-theme="light"] .order-editor-modal .field > span,
[data-theme="light"] .order-editor-modal .field > label,
[data-theme="light"] .order-editor-modal .team-label,
[data-theme="light"] .order-editor-modal .section-title span,
[data-theme="light"] .order-editor-modal .modal-subtitle,
[data-theme="light"] .order-editor-modal .external-crew-balance span,
[data-theme="light"] .order-editor-modal .external-crew-balance small {
  color:#4f5965;
}
[data-theme="light"] .order-editor-modal .employee-heading,
[data-theme="light"] .order-editor-modal .employee-field-label {
  color:#a61b2b!important;
}
[data-theme="light"] .order-editor-modal input,
[data-theme="light"] .order-editor-modal select,
[data-theme="light"] .order-editor-modal textarea {
  color:#20242a;
  border-color:#bdc5d0;
  background:#fff;
}
[data-theme="light"] .order-editor-modal input[readonly],
[data-theme="light"] .order-editor-modal input:disabled,
[data-theme="light"] .order-editor-modal select:disabled,
[data-theme="light"] .order-editor-modal textarea:disabled {
  color:#3f4853;
  border-color:#c5ccd5;
  background:#e8ebef;
  opacity:1;
  -webkit-text-fill-color:#3f4853;
}
[data-theme="light"] .order-editor-modal .team-chip {
  color:#29313a;
  border:1px solid #c5ccd5;
  background:#e5e9ee;
}
[data-theme="light"] .order-editor-modal .team-chip button { color:#9e1c2a; }
[data-theme="light"] .payment-balance,
[data-theme="light"] .backup-choice,
[data-theme="light"] .profit-summary > div,
[data-theme="light"] .shared-criteria-grid > div {
  color:var(--text);
  border-color:var(--line);
  background:#f0f2f5;
}
[data-theme="light"] .wallet-edit-opening { background:#fff; }
[data-theme="light"] .wallet-edit-opening img { filter:none; }
[data-theme="light"] .wallet-edit-details { background:#fff; }
[data-theme="light"] .wallet-edit-details img { filter:none; }
[data-theme="light"] .calendar-weekdays span,
[data-theme="light"] .upcoming-summary-card span,
[data-theme="light"] .payment-balance span,
[data-theme="light"] .backup-choice span { color:#4f5965; }
[data-theme="light"] .favorite-order { color:#805b00; }
[data-theme="light"] .favorite-order.active {
  color:#684800;
  border-color:#b88a24;
  background:#fff0bd;
}
[data-theme="light"] .order-card-code { color:var(--light-danger); }
[data-theme="light"] .order-action-icon.archive,
[data-theme="light"] .icon-action.archive,
[data-theme="light"] .archive-order,
[data-theme="light"] .archive-equipment,
[data-theme="light"] .archive-company {
  color:var(--light-danger);
  border-color:var(--light-danger-line);
  background:var(--light-danger-bg);
}

/* iOS Safari sizing normalization. */
@supports (-webkit-touch-callout:none) {
  @media screen and (max-width:700px) {
    html { min-height:-webkit-fill-available; }
    body { min-height:-webkit-fill-available; }
    button,
    input,
    select,
    textarea { max-width:100%; }
    input,
    select,
    textarea { font-size:16px!important; line-height:normal; }
    .form-grid > *,
    .form-grid-2 > *,
    .calendar-controls > *,
    .team-add > *,
    .payout-card > * { min-width:0; }
    .btn,
    .nav-btn,
    .calendar-nav,
    .calendar-today { line-height:1.2; }
    .modal-backdrop,
    .modal,
    .order-editor-modal { max-width:100vw; }
    .modal input[type="date"],
    .modal input[type="month"],
    .modal input[type="time"] {
      inline-size:100%;
      max-inline-size:100%;
      overflow:hidden;
    }
    .modal-foot {
      inline-size:100%;
      max-inline-size:100%;
    }
  }
}

/* Simplified mobile composition. */
.calendar-view-toggle,
.mobile-card-menu,
.mobile-order-group-head,
.mobile-more-options,
.mobile-order-summary { display:none; }

@media screen and (max-width:700px) {
  .topbar {
    min-height:calc(56px + env(safe-area-inset-top));
    padding:calc(7px + env(safe-area-inset-top)) 10px 7px;
    gap:8px;
  }
  .brand { min-width:0; gap:6px; }
  .brand-mark,
  .brand .theme-toggle,
  .avatar { width:34px; min-width:34px; height:34px; min-height:34px; flex-basis:34px; }
  .user-zone { gap:6px; }
  .user-copy,
  #logoutButton,
  .topbar .install-app { display:none!important; }
  .notification-button { width:36px; height:36px; min-height:36px; }

  .page,
  .orders-page,
  .quotations-page {
    padding:14px 10px calc(96px + env(safe-area-inset-bottom));
  }
  .page-head { margin-bottom:14px; }
  .page-head h1 { margin:0; font-size:22px; }
  .page-head p { display:none; }

  .stats {
    margin-inline:-10px;
    padding:0 10px 6px;
    display:flex!important;
    gap:8px;
    overflow-x:auto;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
  }
  .stats::-webkit-scrollbar { display:none; }
  .stat { width:150px; min-width:150px; min-height:82px; padding:12px; scroll-snap-align:start; }
  .stat strong { font-size:19px; }

  .orders-calendar-panel { margin-bottom:12px; }
  .calendar-head { min-height:0; padding:12px; gap:10px; }
  .calendar-head > div:first-child { width:100%; display:flex; align-items:center; justify-content:space-between; }
  .calendar-head h2 { margin:0; font-size:16px; }
  .calendar-month-order-count { min-height:23px; padding-right:7px; font-size:8px; }
  .calendar-month-order-count b { min-width:17px; height:17px; font-size:9px; }
  .calendar-controls { gap:6px; grid-template-columns:40px minmax(0,1.2fr) minmax(0,.9fr) 40px; }
  .calendar-controls .calendar-nav { width:40px; min-height:40px; }
  .calendar-controls #calendarToday { min-height:40px; }
  .calendar-view-toggle {
    width:100%;
    min-height:38px;
    display:block;
    border:0;
    border-top:1px solid var(--line);
    color:var(--muted);
    background:var(--surface-2);
    font-size:11px;
    font-weight:900;
  }
  .mobile-calendar-week .calendar-day.mobile-week-hidden { display:none; }
  .mobile-calendar-week .calendar-grid { grid-template-rows:1fr; }
  .mobile-calendar-week .calendar-day { min-height:58px; }

  .orders-toolbar {
    position:sticky;
    top:calc(56px + env(safe-area-inset-top));
    z-index:24;
    margin:0 -10px 14px;
    padding:8px 10px;
    border-block:1px solid var(--line);
    background:var(--bg);
    background:color-mix(in srgb,var(--bg) 94%,transparent);
    backdrop-filter:blur(16px);
  }
  .orders-toolbar .orders-add-button { display:none!important; }
  .orders-toolbar .mobile-filter-toggle {
    min-height:42px;
    grid-column:1/-1;
    background:var(--surface);
  }
  .orders-toolbar:not(.mobile-filters-collapsed) { grid-template-columns:1fr 1fr; }
  .orders-toolbar:not(.mobile-filters-collapsed) input { grid-column:1/-1; }

  .orders-list { display:grid; gap:18px; }
  .mobile-order-group { display:grid; gap:8px; }
  .mobile-order-group-head {
    min-height:30px;
    padding:0 2px;
    display:flex;
    align-items:center;
    justify-content:space-between;
  }
  .mobile-order-group-head h2 { margin:0; font-size:14px; }
  .mobile-order-group-head span {
    min-width:25px;
    height:25px;
    display:grid;
    place-items:center;
    border-radius:13px;
    color:var(--muted);
    background:var(--surface-2);
    font-size:10px;
    font-weight:900;
  }
  .orders-system-card {
    position:relative;
    grid-template-columns:minmax(0,1fr) minmax(84px,.7fr) 40px;
    gap:9px 12px;
    padding:12px;
    border-radius:8px;
  }
  .order-card-main { grid-column:1/3; min-width:0; }
  .order-card-main h2 { margin:4px 0 5px; font-size:16px; }
  .order-card-code { font-size:9px; }
  .order-type-chip { padding:4px 7px; font-size:9px; }
  .order-card-main .notes-preview { display:none; }
  .orders-system-card .order-card-data { display:none; }
  .orders-system-card .order-date-data,
  .orders-system-card .order-team-data {
    min-width:0;
    display:block;
    padding-top:8px;
    border-top:1px solid var(--line);
  }
  .orders-system-card .order-date-data { grid-column:1; }
  .orders-system-card .order-team-data { grid-column:2; }
  .order-card-data span { font-size:8px; }
  .order-card-data strong { margin-top:3px; font-size:11px; }
  .order-card-data small { display:none; }
  .order-card-status { grid-column:3; grid-row:1; align-self:start; justify-self:end; }
  .order-card-status .status { max-width:74px; padding-inline:7px; overflow:hidden; text-overflow:ellipsis; }
  .mobile-card-menu {
    grid-column:3;
    grid-row:2;
    width:40px;
    height:40px;
    min-height:40px;
    padding:0;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    border-radius:7px;
    color:var(--text);
    background:var(--surface-2);
    font-size:22px;
    line-height:1;
  }
  .order-card-actions {
    grid-column:1/-1;
    display:none;
    padding-top:10px;
    border-top:1px solid var(--line);
  }
  .orders-system-card.mobile-actions-open .order-card-actions { display:flex; }

  .mobile-more-sheet {
    width:100%;
    height:calc(100dvh - env(safe-area-inset-top));
    max-height:calc(100dvh - env(safe-area-inset-top));
    border-radius:0;
  }
  .mobile-more-sheet .modal-body { padding:12px; background:var(--bg); }
  .mobile-more-sections { display:grid; gap:14px; }
  .mobile-more-sections section { overflow:hidden; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
  .mobile-more-sections h3 { margin:0; padding:12px 14px 8px; color:var(--muted); font-size:10px; text-transform:uppercase; }
  .mobile-more-link {
    width:100%;
    min-height:52px;
    padding:0 14px;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    border:0;
    border-top:1px solid var(--line);
    color:var(--text);
    background:transparent;
    font-weight:850;
    text-align:left;
  }
  .mobile-sheet-icon {
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    border-radius:8px;
    color:var(--red-2);
    background:var(--surface-2);
    font-size:16px;
    font-weight:950;
  }
  .mobile-more-link strong,
  .mobile-quick-sheet [data-mobile-action] strong {
    display:block;
    font-size:13px;
    line-height:1.2;
  }
  .mobile-more-link small,
  .mobile-quick-sheet [data-mobile-action] small {
    display:block;
    margin-top:2px;
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    line-height:1.25;
  }
  .mobile-more-link b { color:var(--muted); font-size:20px; }
  .mobile-more-link.active { color:var(--red-2); background:rgba(227,32,47,.07); }
  .mobile-more-link.danger { color:var(--red-2); }

  .order-editor-modal .form-section { padding:12px; }
  .order-editor-modal .section-title { margin-bottom:12px; gap:5px; }
  .order-editor-modal .section-title h3 { font-size:13px; }
  .mobile-more-options { display:block; grid-column:1/-1; min-height:42px; }
  .mobile-order-summary {
    margin:0 0 12px;
    padding:12px;
    display:grid;
    gap:3px;
    border:1px solid var(--line);
    border-left:3px solid var(--red);
    border-radius:7px;
    background:var(--surface);
  }
  .mobile-order-summary span { color:var(--muted); font-size:9px; font-weight:900; text-transform:uppercase; }
  .mobile-order-summary strong { font-size:14px; }
  .mobile-order-summary small { color:var(--muted); font-size:10px; }
}

/* iOS PWA modal hardening: use layout rows, never viewport-positioned actions. */
@media screen and (max-width:700px) {
  .order-editor-modal {
    position:relative;
    height:calc(100vh - env(safe-area-inset-top));
    height:calc(100dvh - env(safe-area-inset-top));
    max-height:calc(100vh - env(safe-area-inset-top));
    max-height:calc(100dvh - env(safe-area-inset-top));
    display:grid;
    grid-template-rows:auto minmax(0,1fr) auto;
    overflow:hidden;
  }
  .order-editor-modal .modal-head {
    position:relative;
    grid-row:1;
  }
  .order-editor-modal .modal-body {
    grid-row:2;
    min-width:0;
    min-height:0;
    padding:0 12px 12px;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .order-editor-modal .modal-foot {
    position:relative;
    inset:auto;
    grid-row:3;
    width:auto;
    min-width:0;
    min-height:calc(72px + env(safe-area-inset-bottom));
    padding:12px max(12px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  }
  .order-editor-modal .order-form-v11,
  .order-editor-modal .form-section,
  .order-editor-modal .form-grid,
  .order-editor-modal .form-grid-2,
  .order-editor-modal .field {
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .order-editor-modal .form-grid,
  .order-editor-modal .form-grid-2 {
    grid-template-columns:minmax(0,1fr)!important;
    overflow:hidden;
  }
  .order-editor-modal .field,
  .order-editor-modal .form-grid > *,
  .order-editor-modal .form-grid-2 > * { grid-column:1/-1!important; overflow:hidden; }
  .order-editor-modal input,
  .order-editor-modal select,
  .order-editor-modal textarea {
    display:block;
    inline-size:100%!important;
    width:100%!important;
    min-inline-size:0!important;
    min-width:0!important;
    max-inline-size:100%!important;
    max-width:100%!important;
  }
  .order-editor-modal input[type="date"],
  .order-editor-modal input[type="time"] {
    -webkit-appearance:none;
    appearance:none;
    text-align:left;
  }
  .mobile-order-stepper {
    top:0;
    margin:0 -12px 12px;
    padding:11px 12px;
  }
  .order-editor-modal .modal-subtitle { margin:0 0 12px; padding-top:12px; }
}

/* Some installed iOS PWAs incorrectly report a zero bottom safe-area. */
@media screen and (max-width:700px) {
  html.ios-standalone { --ios-home-guard:max(44px,env(safe-area-inset-bottom)); }
  html.ios-standalone .order-editor-backdrop { align-items:start; }
  html.ios-standalone .order-editor-modal {
    height:calc(100vh - env(safe-area-inset-top) - var(--ios-home-guard));
    height:calc(100dvh - env(safe-area-inset-top) - var(--ios-home-guard));
    max-height:calc(100vh - env(safe-area-inset-top) - var(--ios-home-guard));
    max-height:calc(100dvh - env(safe-area-inset-top) - var(--ios-home-guard));
  }
  html.ios-standalone .order-editor-modal .modal-foot {
    min-height:72px;
    padding-bottom:12px;
  }
}

/* Guaranteed mobile action area; does not depend on iOS safe-area reporting. */
@media screen and (max-width:700px) {
  .order-editor-backdrop { align-items:start; }
  .order-editor-backdrop .order-editor-modal {
    --order-bottom-guard:max(44px,env(safe-area-inset-bottom));
    min-height:0;
    height:calc(100vh - env(safe-area-inset-top) - var(--order-bottom-guard));
    height:calc(100dvh - env(safe-area-inset-top) - var(--order-bottom-guard));
    max-height:calc(100vh - env(safe-area-inset-top) - var(--order-bottom-guard));
    max-height:calc(100dvh - env(safe-area-inset-top) - var(--order-bottom-guard));
  }
  .order-editor-backdrop .order-editor-modal .modal-foot {
    min-height:72px;
    padding-bottom:12px;
  }

  .mobile-quick-sheet.small {
    width:100%;
    height:auto;
    max-height:min(72dvh,620px);
    padding-bottom:0;
    overflow:hidden;
    border-radius:18px 18px 0 0;
    box-shadow:0 -18px 50px rgba(0,0,0,.34);
  }
  .mobile-quick-sheet .modal-head {
    min-height:64px;
    padding:24px 16px 12px;
  }
  .mobile-quick-sheet .modal-head::before {
    content:"";
    position:absolute;
    top:8px;
    left:50%;
    width:38px;
    height:4px;
    border-radius:4px;
    background:var(--surface-3);
    transform:translateX(-50%);
  }
  .mobile-quick-sheet .modal-body { padding:8px 12px 12px; }
  .mobile-quick-sheet .mobile-quick-grid { grid-template-columns:1fr; gap:7px; }
  .mobile-quick-sheet [data-mobile-action] {
    min-height:54px;
    padding:0 14px;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    text-align:left;
  }
  .mobile-quick-sheet [data-mobile-action]::after {
    content:"›";
    color:var(--muted);
    font-size:20px;
  }
  .mobile-quick-sheet .modal-foot {
    min-height:calc(64px + max(12px,env(safe-area-inset-bottom)));
    padding:8px 12px max(12px,env(safe-area-inset-bottom));
  }
  .mobile-quick-sheet .modal-foot .btn { width:100%; }
  .mobile-filter-sheet.small {
    width:100%;
    height:auto;
    max-height:min(82dvh,680px);
    border-radius:18px 18px 0 0;
    overflow:hidden;
    box-shadow:0 -18px 50px rgba(0,0,0,.34);
  }
  .mobile-filter-sheet .modal-body { padding:12px; }
  .mobile-filter-sheet-form { display:grid; gap:12px; }
  .mobile-filter-sheet .modal-foot {
    min-height:calc(64px + max(12px,env(safe-area-inset-bottom)));
    display:grid;
    grid-template-columns:1fr 1fr;
    padding:8px 12px max(12px,env(safe-area-inset-bottom));
  }
  .mobile-install-guide { display:grid; gap:10px; }
  .mobile-install-guide > div {
    min-height:62px;
    padding:12px;
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    gap:10px;
    border:1px solid var(--line);
    border-radius:8px;
    background:var(--surface);
  }
}

@media screen and (max-width:700px) {
  .brand { gap:7px; }
  .brand .theme-toggle {
    width:38px;
    min-width:38px;
    font-size:20px;
  }
}

/* Light theme polish: crisp depth, warm accents and stronger hierarchy. */
@media screen {
  [data-theme="light"] {
    --bg:#f4f6f8;
    --surface:#ffffff;
    --surface-2:#f7f8fa;
    --surface-3:#e8ecf1;
    --line:#d5dae2;
    --text:#1f252d;
    --muted:#626d79;
    --shadow:0 12px 32px rgba(26,35,48,.09);
  }

  [data-theme="light"] body { background:#f4f6f8; }
  [data-theme="light"] .topbar {
    border-bottom-color:#dfe3e9;
    background:rgba(255,255,255,.94);
    box-shadow:0 8px 26px rgba(35,44,57,.075);
  }
  [data-theme="light"] .brand-mark {
    border-color:#c41f2e;
    background:#cf2634;
    box-shadow:0 6px 16px rgba(185,31,43,.18);
  }
  [data-theme="light"] .theme-toggle,
  [data-theme="light"] .notification-button {
    border-color:#d8dde5;
    background:#f8f9fb;
    box-shadow:0 3px 10px rgba(35,44,57,.06);
  }
  [data-theme="light"] .nav-btn.active {
    color:#a91c28;
    border-color:#efc9ce;
    background:#fff0f2;
    box-shadow:inset 0 -2px #cf2634;
  }

  [data-theme="light"] .page-head h1 { color:#171c22; }
  [data-theme="light"] .page-head p { color:#687481; }
  [data-theme="light"] .tabs {
    border-bottom-color:#d7dce4;
    background:transparent;
  }
  [data-theme="light"] .tab { color:#5c6672; }
  [data-theme="light"] .tab:hover { color:#20262d; background:#eceff3; }
  [data-theme="light"] .tab.active {
    color:#a91c28;
    background:#fff;
    box-shadow:inset 0 -2px #cf2634;
  }

  [data-theme="light"] .panel,
  [data-theme="light"] .quotation-details-section,
  [data-theme="light"] .quotation-item-section,
  [data-theme="light"] .orders-calendar-panel,
  [data-theme="light"] .calendar-panel,
  [data-theme="light"] .insights-leaderboard,
  [data-theme="light"] .evaluation-rule-card,
  [data-theme="light"] .leader-config-card {
    border-color:#d8dde5;
    background:#fff;
    box-shadow:0 10px 28px rgba(35,44,57,.07);
  }
  [data-theme="light"] .panel-head,
  [data-theme="light"] .calendar-head {
    border-bottom-color:#dfe3e9;
    background:#fbfcfd;
  }
  [data-theme="light"] .panel-head h2,
  [data-theme="light"] .section-title h3 { color:#20262d; }

  [data-theme="light"] input,
  [data-theme="light"] select,
  [data-theme="light"] textarea {
    color:#20262d;
    border-color:#cfd5de;
    background:#fff;
    box-shadow:inset 0 1px 2px rgba(35,44,57,.035);
  }
  [data-theme="light"] input:hover,
  [data-theme="light"] select:hover,
  [data-theme="light"] textarea:hover { border-color:#b8c0cb; }
  [data-theme="light"] input:focus,
  [data-theme="light"] select:focus,
  [data-theme="light"] textarea:focus {
    border-color:#4f7fc9;
    box-shadow:0 0 0 3px rgba(50,111,209,.12);
  }
  [data-theme="light"] input:disabled,
  [data-theme="light"] select:disabled,
  [data-theme="light"] textarea:disabled {
    color:#69737f;
    border-color:#d7dce3;
    background:#edf0f4;
    opacity:1;
  }

  [data-theme="light"] .btn:not(.primary),
  [data-theme="light"] .icon-btn,
  [data-theme="light"] .icon-action,
  [data-theme="light"] .order-action-icon {
    border-color:#d1d7e0;
    background:#fff;
    box-shadow:0 3px 10px rgba(35,44,57,.055);
  }
  [data-theme="light"] .btn:not(.primary):hover,
  [data-theme="light"] .icon-btn:hover,
  [data-theme="light"] .icon-action:hover,
  [data-theme="light"] .order-action-icon:hover {
    color:#20262d;
    border-color:#aeb7c3;
    background:#f2f4f7;
  }
  [data-theme="light"] .btn.primary {
    border-color:#c51f2d;
    background:#cf2634;
    box-shadow:0 7px 16px rgba(185,31,43,.18);
  }
  [data-theme="light"] .btn.primary:hover { background:#b91f2b; }

  [data-theme="light"] .form-section,
  [data-theme="light"] .team-picker,
  [data-theme="light"] .payout-card,
  [data-theme="light"] .employee-expense-wrap,
  [data-theme="light"] .prepared-equipment-summary,
  [data-theme="light"] .shared-criteria-grid > div,
  [data-theme="light"] .evaluation-policy > div {
    color:#20262d;
    border-color:#d8dde5;
    background:#f7f8fa;
  }
  [data-theme="light"] .payout-card,
  [data-theme="light"] .team-picker {
    box-shadow:inset 0 1px #fff,0 5px 14px rgba(35,44,57,.045);
  }
  [data-theme="light"] .team-chip {
    color:#343c46;
    border:1px solid #d2d8e0;
    background:#e9edf2;
  }

  [data-theme="light"] .quotation-row {
    color:#20262d;
    border-color:#d7dde5;
    background:#fbfcfd;
    box-shadow:0 3px 10px rgba(35,44,57,.035);
  }
  [data-theme="light"] .quotation-row.active {
    border-color:#e2a7af;
    border-left:3px solid #cf2634;
    background:#fff;
    box-shadow:0 7px 18px rgba(35,44,57,.065);
  }
  [data-theme="light"] .quotation-row.inactive { opacity:.68; }
  [data-theme="light"] .quotation-row.inactive:hover { opacity:.82; }
  [data-theme="light"] .quotation-line-total {
    color:#2b333d;
    border-color:#d9dee6;
    background:#f2f4f7;
  }
  [data-theme="light"] .quotation-number button {
    color:#53606d;
    background:#e8ecf1;
  }
  [data-theme="light"] .quotation-total {
    border-color:#9fd2b7;
    background:#edf8f2;
    box-shadow:0 7px 18px rgba(24,139,85,.07);
  }

  [data-theme="light"] .stat {
    border-color:#d8dde5;
    background:#fff;
    box-shadow:0 7px 20px rgba(35,44,57,.06);
  }
  [data-theme="light"] .stat.green { background:#f2faf6; }
  [data-theme="light"] .stat.blue { background:#f2f6fc; }
  [data-theme="light"] .stat.yellow { background:#fff9eb; }
  [data-theme="light"] .wallet-card {
    border-color:#d8dde5;
    background:#fff;
    box-shadow:0 8px 22px rgba(35,44,57,.065);
  }
  [data-theme="light"] .wallet-card.Bank-Acc { background:#f5f8fd; }
  [data-theme="light"] .wallet-card.Instapay { background:#fff8f1; }
  [data-theme="light"] .wallet-card.Vodafone-Cash { background:#fff5f6; }

  [data-theme="light"] th {
    color:#3e4854;
    border-bottom-color:#cfd5de;
    background:#edf0f4;
    box-shadow:inset 0 -1px #d8dde5;
  }
  [data-theme="light"] td { border-bottom-color:#e3e7ec; }
  [data-theme="light"] tbody tr:nth-child(even) { background:#fbfcfd; }
  [data-theme="light"] tbody tr:hover { background:#f2f5f8; }
  [data-theme="light"] .table-wrap.bounded-data-region {
    border-color:#d8dde5;
    background:#fff;
    box-shadow:inset 0 12px 14px -18px rgba(35,44,57,.28),inset 0 -14px 16px -20px rgba(35,44,57,.35);
  }

  [data-theme="light"] .orders-calendar-panel { box-shadow:0 12px 30px rgba(35,44,57,.08); }
  [data-theme="light"] .calendar-weekdays { background:#edf0f4; }
  [data-theme="light"] .calendar-day { background:#fff; }
  [data-theme="light"] .calendar-day:hover { background:#f5f7fa; }
  [data-theme="light"] .calendar-day.outside { background:#fafbfc; }
  [data-theme="light"] .calendar-day.today { background:#fff2f4; }
  [data-theme="light"] .orders-system-card {
    border-color:#d8dde5;
    background:#fff;
    box-shadow:0 8px 22px rgba(35,44,57,.065);
  }
  [data-theme="light"] .orders-system-card:hover {
    border-color:#c5cbd4;
    box-shadow:0 12px 28px rgba(35,44,57,.1);
  }
  [data-theme="light"] .order-type-chip {
    color:#596572;
    border:1px solid #d8dde5;
    background:#eef1f4;
  }
  [data-theme="light"] .upcoming-event,
  [data-theme="light"] .upcoming-summary-card {
    border-color:#d8dde5;
    background:#fff;
    box-shadow:0 8px 22px rgba(35,44,57,.06);
  }
  [data-theme="light"] .upcoming-filters {
    border-color:#d8dde5;
    background:rgba(255,255,255,.94);
    box-shadow:0 8px 22px rgba(35,44,57,.07);
  }

  [data-theme="light"] .modal {
    border-color:#d4dae2;
    background:#fff;
    box-shadow:0 28px 80px rgba(35,44,57,.24);
  }
  [data-theme="light"] .modal-head,
  [data-theme="light"] .modal-foot {
    border-color:#dde2e8;
    background:#fbfcfd;
  }
  [data-theme="light"] .modal-backdrop { background:rgba(33,40,49,.46); }
  [data-theme="light"] .mobile-quick-sheet .modal-head::before { background:#c9d0da; }
}

@media screen and (max-width:700px) {
  [data-theme="light"] .main-nav {
    border-top-color:#d9dee5;
    background:rgba(255,255,255,.97);
    box-shadow:0 -10px 28px rgba(35,44,57,.11);
  }
  [data-theme="light"] .mobile-card-wrap { background:#f0f3f6; }
  [data-theme="light"] .mobile-card-table tbody tr {
    border-color:#d7dde5;
    border-left-color:#b7c0cb;
    background:#fff;
    box-shadow:0 5px 14px rgba(35,44,57,.055);
  }
  [data-theme="light"] .mobile-card-table td { border-bottom-color:#e5e8ed; }
  [data-theme="light"] .quotation-form-actions {
    border-color:#d8dde5;
    background:rgba(255,255,255,.96);
    box-shadow:0 -8px 22px rgba(35,44,57,.08);
  }
}

.equipment-preparer { color:var(--red-2)!important; font-weight:950; }
[data-theme="light"] .equipment-preparer { color:#b21f2d!important; }
.payment-reversed-row { opacity:.78; }
.payment-reversed-row td { background:rgba(255,80,96,.06); }
[data-theme="light"] .payment-reversed-row td { background:#fff1f2; }
.copyright-panel { text-align:center; }
.copyright-panel p { margin:0; color:var(--muted); font-size:12px; font-weight:750; }
.copyright-panel a { color:var(--text); font-weight:950; text-decoration:none; }
.copyright-panel a:hover { color:var(--red); }

html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea {
  font-family:var(--app-font);
  letter-spacing:0;
}
.language-toggle {
  width:42px;
  min-width:42px;
  height:38px;
  padding:0;
  font-size:10px;
  font-weight:950;
}
html[dir="rtl"] .topbar,
html[dir="rtl"] .brand,
html[dir="rtl"] .user-zone,
html[dir="rtl"] .panel-head,
html[dir="rtl"] .actions,
html[dir="rtl"] .stats,
html[dir="rtl"] .form-grid,
html[dir="rtl"] .equipment-order-picker,
html[dir="rtl"] .equipment-prep-row,
html[dir="rtl"] .payment-balance,
html[dir="rtl"] .order-card,
html[dir="rtl"] .calendar-head {
  direction:rtl;
}
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
  text-align:right;
}
html[dir="rtl"] table {
  direction:rtl;
}
html[dir="rtl"] th,
html[dir="rtl"] td {
  text-align:right;
}
html[dir="rtl"] .main-nav {
  direction:rtl;
}
html[dir="rtl"] .work-badge,
html[dir="rtl"] .notification-count {
  right:auto;
  left:-7px;
}
html[dir="rtl"] .notification-count { left:-6px; }
html[dir="rtl"] .modal-foot,
html[dir="rtl"] .equipment-prep-actions,
html[dir="rtl"] .quotation-form-actions {
  direction:rtl;
}
html[dir="rtl"] .paper,
html[dir="rtl"] .quotation-paper {
  direction:ltr;
}

@media (max-width:700px) {
  .equipment-prep-modal {
    width:100%;
    max-width:100vw;
    overflow-x:hidden;
  }
  .equipment-prep-modal .modal-body,
  .equipment-prep-form,
  .equipment-prep-list,
  .equipment-prep-row,
  .equipment-selection-stack,
  .equipment-selection-line,
  .equipment-counter-grid,
  .equipment-counter-card {
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
  }
  .equipment-prep-form {
    padding:12px;
    overflow-x:hidden;
  }
  .equipment-preset-toolbar {
    grid-template-columns:1fr;
  }
  .equipment-preset-toolbar .btn,
  .equipment-order-picker .btn {
    width:100%;
  }
  .equipment-order-picker,
  .equipment-prep-row,
  .equipment-counter-grid {
    grid-template-columns:1fr;
  }
  .equipment-order-info {
    grid-template-columns:1fr;
  }
  .equipment-selection-line {
    grid-template-columns:1fr 1fr;
  }
  .equipment-selection-line select {
    grid-column:1/-1;
    width:100%;
  }
  .equipment-selection-line .btn {
    width:100%;
    min-width:0;
    min-height:40px;
  }
  .equipment-counter-card {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
  }
  .equipment-counter-card > span {
    min-width:0;
    white-space:normal;
  }
  .equipment-counter {
    justify-content:flex-end;
  }
  .equipment-counter output {
    width:64px;
  }
  .equipment-prep-row .field,
  .equipment-prep-row textarea {
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .equipment-prep-state {
    text-align:left;
  }

  .quotation-form,
  .quotation-item-section,
  .quotation-items,
  .quotation-row,
  .quotation-number,
  .quotation-unit-cost,
  .quotation-line-total {
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
  }
  .quotation-row {
    grid-template-columns:1fr;
    gap:10px;
    overflow:hidden;
  }
  .quotation-item-check,
  .quotation-item-main,
  .quotation-unit-cost,
  .quotation-line-total {
    grid-column:1;
  }
  .quotation-item-check {
    align-items:flex-start;
    line-height:1.35;
  }
  .quotation-item-check input[type="checkbox"] {
    flex:0 0 22px;
    width:22px;
    height:22px;
    min-height:22px;
    margin-top:2px;
  }
  .quotation-number {
    display:grid;
    grid-template-columns:minmax(0,1fr) 44px;
    gap:8px;
  }
  .quotation-number input {
    grid-column:1;
    grid-row:1 / span 2;
    width:100%;
    height:100%;
    padding-right:14px;
  }
  .quotation-number button {
    position:static;
    width:44px;
    height:auto;
    min-height:44px;
    border:1px solid var(--line);
    border-radius:8px;
    font-size:18px;
  }
  .quotation-number .up {
    grid-column:2;
    grid-row:1;
  }
  .quotation-number .down {
    grid-column:2;
    grid-row:2;
  }
  .quotation-number .down + input,
  .quotation-number input + .up + .down {
    margin:0;
  }
  .quotation-line-total {
    justify-content:flex-start;
  }
  .quotation-form-actions {
    bottom:calc(88px + env(safe-area-inset-bottom));
    margin-inline:-2px;
    border-radius:10px;
  }
  .orders-finance-summary {
    width:100%;
    max-width:100%;
    overflow:hidden;
  }
  .orders-finance-summary .panel-head {
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }
  .orders-finance-summary .summary-filter {
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  .orders-finance-summary .summary-filter select {
    min-width:0;
    width:100%;
  }
  .orders-finance-summary .finance-summary-grid {
    width:100%;
    margin:0;
    padding:12px;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));
    gap:10px;
    overflow:visible;
    scroll-snap-type:none;
    direction:inherit;
  }
  .orders-finance-summary .finance-summary-grid .stat {
    width:auto;
    min-width:0;
    min-height:118px;
    padding:14px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    text-align:inherit;
    scroll-snap-align:none;
  }
  .orders-finance-summary .finance-summary-grid .stat span,
  .orders-finance-summary .finance-summary-grid .stat small {
    overflow-wrap:anywhere;
  }
  .orders-finance-summary .finance-summary-grid .stat strong {
    unicode-bidi:isolate;
    direction:ltr;
    font-size:20px;
    line-height:1.15;
  }
  html[dir="rtl"] .orders-finance-summary .finance-summary-grid .stat {
    text-align:right;
  }
  html[dir="rtl"] .orders-finance-summary .finance-summary-grid .stat strong {
    text-align:right;
  }
}

@media (max-width:700px) {
  :root {
    --mobile-browser-bottom:0px;
    --mobile-nav-gap:8px;
    --mobile-nav-height:74px;
  }
  body {
    padding-bottom:calc(var(--mobile-nav-height) + var(--mobile-browser-bottom) + env(safe-area-inset-bottom) + 18px)!important;
  }
  .app-shell {
    padding-bottom:calc(var(--mobile-nav-height) + var(--mobile-browser-bottom) + env(safe-area-inset-bottom) + 18px);
  }
  .main-nav {
    min-height:74px;
    padding:8px max(10px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
    bottom:calc(var(--mobile-browser-bottom) + var(--mobile-nav-gap));
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:7px;
    overflow:visible;
    border-top-color:rgba(255,255,255,.08);
    background:rgba(12,12,18,.96);
  }
  .main-nav .nav-btn {
    min-width:0;
    min-height:56px;
    width:100%;
    padding:6px 3px 5px;
    display:grid;
    grid-template-rows:26px auto;
    place-items:center;
    gap:4px;
    border:1px solid transparent;
    border-radius:10px;
    color:var(--muted);
    background:transparent;
    box-shadow:none;
    font-size:9px;
    line-height:1.1;
    font-weight:900;
    opacity:1;
  }
  .main-nav .nav-btn:hover {
    color:var(--text);
    background:var(--surface-2);
  }
  .main-nav .nav-btn.active {
    color:#fff;
    border-color:rgba(239,51,64,.55);
    background:linear-gradient(180deg,rgba(239,51,64,.2),rgba(239,51,64,.08));
    box-shadow:0 8px 20px rgba(239,51,64,.12), inset 0 -2px var(--red);
  }
  .main-nav .nav-icon {
    width:25px;
    height:25px;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    border-radius:9px;
    color:var(--text);
    background:rgba(255,255,255,.035);
    font-size:13px;
    line-height:1;
    opacity:1;
  }
  .main-nav .nav-btn.active .nav-icon {
    border-color:rgba(255,255,255,.18);
    color:#fff;
    background:var(--red);
    box-shadow:0 8px 18px rgba(239,51,64,.22);
  }
  .main-nav .nav-btn span:last-child {
    width:100%;
    max-width:100%;
    overflow:hidden;
    text-align:center;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .mobile-quick-action {
    bottom:calc(var(--mobile-browser-bottom) + var(--mobile-nav-height) + 22px + env(safe-area-inset-bottom))!important;
  }
  .message-root {
    bottom:calc(var(--mobile-browser-bottom) + var(--mobile-nav-height) + 18px + env(safe-area-inset-bottom))!important;
  }
  [data-theme="light"] .main-nav {
    border-top-color:#d9dee7;
    background:rgba(255,255,255,.97);
    box-shadow:0 -10px 24px rgba(35,44,57,.09);
  }
  [data-theme="light"] .main-nav .nav-btn {
    color:#667083;
  }
  [data-theme="light"] .main-nav .nav-btn:hover {
    color:#1f2631;
    background:#f3f5f8;
  }
  [data-theme="light"] .main-nav .nav-btn.active {
    color:#b21f2d;
    border-color:#f1a4ae;
    background:#fff1f3;
    box-shadow:0 8px 20px rgba(178,31,45,.1), inset 0 -2px #d71920;
  }
  [data-theme="light"] .main-nav .nav-icon {
    color:#1f2631;
    background:#fff;
  }
  [data-theme="light"] .main-nav .nav-btn.active .nav-icon {
    color:#fff;
    background:#d71920;
  }

  .form-grid,
  .form-grid-2,
  .payment-balance,
  .quotation-columns,
  .equipment-order-info {
    grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));
  }
  .field.wide,
  .form-grid .wide,
  .form-grid-2 .wide,
  textarea,
  .equipment-prep-row,
  .quotation-item-section {
    min-width:0;
    max-width:100%;
  }
  .panel-head .actions,
  .page-head .actions,
  .mobile-more-grid,
  .mobile-quick-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,138px),1fr));
    gap:8px;
  }
  .panel-head .actions > *,
  .page-head .actions > *,
  .mobile-more-grid > *,
  .mobile-quick-grid > * {
    min-width:0;
    width:100%;
  }
}

@media (max-width:700px) {
  html,
  body,
  .app-shell,
  #app,
  #modalRoot {
    max-width:100vw;
    overflow-x:hidden;
  }
  .modal,
  .modal * {
    box-sizing:border-box;
  }
  .modal {
    width:100%;
    max-width:100vw;
    inline-size:100%;
    max-inline-size:100vw;
    overflow-x:hidden;
  }
  .modal-head {
    min-width:0;
    gap:12px;
  }
  .modal-head h2 {
    min-width:0;
    overflow-wrap:anywhere;
    font-size:clamp(20px,7vw,28px);
    line-height:1.15;
  }
  .modal-body {
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }
  .modal .form-grid,
  .modal .form-grid-2 {
    width:100%;
    max-width:100%;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
    gap:12px;
  }
  .modal .form-grid > *,
  .modal .form-grid-2 > *,
  .modal .field,
  .modal .wide,
  .modal input,
  .modal select,
  .modal textarea {
    min-width:0;
    max-width:100%;
  }
  .modal input,
  .modal select,
  .modal textarea {
    display:block;
    width:100%;
    inline-size:100%;
    max-inline-size:100%;
    font-size:16px;
  }
  .modal input[type="date"],
  .modal input[type="month"],
  .modal input[type="time"] {
    min-width:0;
    -webkit-appearance:none;
    appearance:none;
  }
  .modal-foot {
    width:100%;
    max-width:100%;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));
    gap:10px;
    overflow:hidden;
  }
  .modal-foot .btn {
    min-width:0;
    width:100%;
    max-width:100%;
    white-space:normal;
  }
  .modal select {
    text-overflow:ellipsis;
  }
  .evaluation-entry {
    width:100%;
    max-width:100%;
    border-radius:10px;
  }
  .evaluation-entry-head {
    align-items:flex-start;
  }
  .evaluation-entry-grid {
    grid-template-columns:1fr;
    padding:8px 12px 12px;
  }
  .evaluation-entry-grid label {
    grid-template-columns:minmax(0,1fr) 74px;
    gap:8px;
  }
  .evaluation-entry-grid input {
    min-height:42px;
    padding-inline:10px;
    text-align:center;
  }
  html[dir="rtl"] .modal .form-grid,
  html[dir="rtl"] .modal .form-grid-2,
  html[dir="rtl"] .evaluation-entry-grid {
    direction:rtl;
  }
  html[dir="rtl"] .modal input[type="month"],
  html[dir="rtl"] .modal input[type="date"],
  html[dir="rtl"] .modal input[type="time"],
  html[dir="rtl"] .modal input[type="number"] {
    direction:ltr;
    text-align:right;
  }
  [data-theme="light"] .modal-head {
    background:#f8fafc;
  }
}

@media (max-width:700px) {
  .page,
  .orders-page,
  .quotations-page,
  .home-page,
  .me-page,
  .cash-page,
  .control-page {
    width:100%;
    max-width:100vw;
    overflow-x:hidden;
    padding-inline:12px;
  }
  .page-head,
  .panel,
  .stats,
  .stat {
    max-width:100%;
    box-sizing:border-box;
  }
  .stats {
    width:100%;
    margin:0 0 18px;
    padding:0;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr))!important;
    gap:10px;
    overflow:visible;
    scroll-snap-type:none;
  }
  .stat {
    width:auto;
    min-width:0;
    min-height:112px;
    padding:14px;
    scroll-snap-align:none;
  }
  .stat span,
  .stat small {
    max-width:100%;
    overflow-wrap:anywhere;
  }
  .stat strong {
    unicode-bidi:isolate;
    direction:ltr;
    line-height:1.15;
  }
  .page-head .actions {
    width:100%;
    max-width:100%;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr));
    gap:9px;
  }
  .page-head .actions > * {
    width:100%;
    min-width:0;
  }
  .panel {
    width:100%;
    overflow:hidden;
  }
  .panel-head h2 {
    max-width:100%;
    overflow-wrap:anywhere;
  }

  .me-page {
    width:100%;
    max-width:100vw;
    overflow-x:hidden;
    padding-inline:12px;
  }
  .me-page .page-head {
    width:100%;
    max-width:100%;
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
  }
  .me-page .page-head h1 {
    font-size:clamp(24px,8vw,32px);
    line-height:1.1;
  }
  .me-page .page-head .actions {
    width:100%;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr));
    gap:9px;
  }
  .me-page .page-head .actions > * {
    width:100%;
    min-width:0;
  }
  .me-page .me-stats {
    width:100%;
    margin:0 0 18px;
    padding:0;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));
    gap:10px;
    overflow:visible;
    scroll-snap-type:none;
  }
  .me-page .me-stats .stat {
    width:auto;
    min-width:0;
    min-height:112px;
    padding:14px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    scroll-snap-align:none;
  }
  .me-page .me-stats .stat span {
    overflow-wrap:anywhere;
    font-size:10px;
    line-height:1.35;
  }
  .me-page .me-stats .stat strong {
    unicode-bidi:isolate;
    direction:ltr;
    font-size:22px;
    line-height:1.15;
  }
  .me-page .panel {
    width:100%;
    max-width:100%;
    overflow:hidden;
  }
  .me-page .panel-head {
    min-height:0;
    padding:16px;
  }
  .me-page .panel-head h2 {
    max-width:100%;
    overflow-wrap:anywhere;
    font-size:clamp(18px,6vw,24px);
    line-height:1.18;
  }
  .me-page .mobile-card-wrap {
    max-height:none;
    overflow:visible;
  }
  .me-page .mobile-card-table {
    min-width:0;
  }
}

@media (max-width:700px) {
  :root { --mobile-page-pad:12px; --mobile-card-gap:10px; }
  .page,
  .orders-page,
  .quotations-page,
  .home-page,
  .me-page,
  .cash-page,
  .control-page {
    inline-size:100%;
    max-inline-size:100vw;
    padding-inline:var(--mobile-page-pad)!important;
    overflow-x:hidden!important;
  }
  .page > *,
  .orders-page > *,
  .quotations-page > *,
  .home-page > *,
  .me-page > *,
  .cash-page > *,
  .control-page > * {
    max-inline-size:100%;
    box-sizing:border-box;
  }
  .stats,
  .finance-summary-grid,
  .me-stats {
    inline-size:100%!important;
    margin-inline:0!important;
    padding-inline:0!important;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,156px),1fr))!important;
    gap:var(--mobile-card-gap)!important;
    overflow:visible!important;
    scroll-snap-type:none!important;
  }
  .stat,
  .finance-summary-grid .stat,
  .me-stats .stat {
    inline-size:auto!important;
    min-inline-size:0!important;
    max-inline-size:100%!important;
    min-height:112px;
    padding:14px!important;
    scroll-snap-align:none!important;
  }
  .stat span,
  .stat small {
    overflow-wrap:anywhere;
  }
  .page-head {
    inline-size:100%;
    max-inline-size:100%;
  }
  .page-head .actions {
    inline-size:100%;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr))!important;
    gap:9px!important;
  }
  .page-head .actions > * {
    min-inline-size:0!important;
    inline-size:100%!important;
  }
}

@media (max-width:700px) {
  :root {
    --mobile-topbar-height:64px;
    --mobile-nav-height:74px;
  }
  body {
    padding-top:var(--mobile-topbar-height)!important;
    padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 18px)!important;
  }
  .topbar {
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:0!important;
    z-index:90!important;
    min-height:var(--mobile-topbar-height)!important;
    padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left))!important;
    transform:none!important;
  }
  .main-nav {
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    z-index:90!important;
    min-height:var(--mobile-nav-height)!important;
    transform:none!important;
  }
  .app-shell {
    padding-top:0!important;
    padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 18px)!important;
  }
  .modal-backdrop {
    top:var(--mobile-topbar-height)!important;
    bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom))!important;
    height:auto!important;
    max-height:none!important;
    padding-top:0!important;
    padding-bottom:0!important;
    align-items:end!important;
  }
  .modal {
    max-height:calc(100dvh - var(--mobile-topbar-height) - var(--mobile-nav-height) - env(safe-area-inset-bottom))!important;
    margin-bottom:0!important;
  }
  .preview-shell.open {
    top:var(--mobile-topbar-height)!important;
    bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom))!important;
    height:auto!important;
  }
  .mobile-quick-sheet,
  .mobile-more-sheet,
  .mobile-filter-sheet {
    max-height:calc(100dvh - var(--mobile-topbar-height) - var(--mobile-nav-height) - env(safe-area-inset-bottom))!important;
  }
  .page,
  .orders-page,
  .quotations-page,
  .home-page,
  .me-page,
  .cash-page,
  .control-page {
    padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 24px)!important;
  }
  .mobile-quick-action {
    bottom:calc(var(--mobile-nav-height) + 14px + env(safe-area-inset-bottom))!important;
  }
  .message-root {
    bottom:calc(var(--mobile-nav-height) + 14px + env(safe-area-inset-bottom))!important;
  }
  body.modal-open .topbar,
  body.modal-open .main-nav {
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto;
  }
  body.modal-open .topbar {
    z-index:220!important;
  }
  body.modal-open .main-nav {
    z-index:220!important;
  }
  body.modal-open .modal-backdrop {
    z-index:100!important;
  }
  body.modal-open .preview-shell.open {
    z-index:100!important;
  }
}
.camera-capacity-dialog{width:min(520px,calc(100vw - 32px));max-height:85dvh;overflow:auto;box-sizing:border-box;border:2px solid #f0bb4c;border-radius:18px;background:#211d25;color:#fff;padding:22px;direction:rtl}
.camera-capacity-dialog::backdrop{background:#000b}
.camera-capacity-dialog h2{font-size:20px;color:#ffd070}.camera-capacity-dialog p{line-height:1.7;overflow-wrap:anywhere}
.camera-capacity-dialog footer{display:flex;gap:12px;position:sticky;bottom:0;background:#211d25;padding:12px 0}.camera-capacity-dialog footer button{flex:1;min-height:48px}
/* V3 account welcome: native dialog keeps focus and works above both shells. */
.v3-welcome{position:fixed;inset:0;margin:auto;width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:36px 24px;border:1px solid #ff5c7866;border-radius:28px;background:radial-gradient(ellipse at top,#53243c,#181820 65%);color:#fff;box-shadow:0 28px 90px #0008;overflow:auto;text-align:center}
.v3-welcome::backdrop{background:#070710c9;backdrop-filter:blur(7px)}
.v3-welcome-content{position:relative;z-index:1}.v3-release{font-size:12px;letter-spacing:3px;color:#ff91a7}.v3-celebration{font-size:64px;margin:24px 0;animation:v3-pop .7s ease-out}.v3-welcome h2{font-size:28px;margin:0 0 16px}.v3-welcome p{line-height:1.8;color:#d4cbd6}.v3-welcome .btn{width:100%;min-height:52px;margin-top:18px;font-size:19px}.v3-welcome small{display:block;margin-top:10px}
.v3-confetti{position:absolute;inset:0;overflow:hidden;pointer-events:none}.v3-confetti i{position:absolute;left:var(--x);top:-20px;width:8px;height:14px;background:hsl(var(--hue) 90% 67%);animation:v3-fall 3s var(--delay) ease-out 2 both}
@keyframes v3-fall{0%{transform:translateY(-20px) rotate(0);opacity:0}10%{opacity:1}100%{transform:translateY(550px) rotate(560deg);opacity:0}}
@keyframes v3-pop{0%{transform:scale(.4) rotate(-20deg);opacity:0}100%{transform:scale(1);opacity:1}}
@media(prefers-reduced-motion:reduce){.v3-confetti{display:none}.v3-celebration{animation:none}}

/* Keep each proposal page's images and copy together in the editor. */
.proposal-editor-tabs { display:flex; min-height:46px; gap:8px; overflow-x:auto; padding-bottom:4px; }
.proposal-editor-tabs button { flex:1 0 auto; padding:10px 14px; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); color:var(--muted); cursor:pointer; font-weight:700; }
.proposal-editor-tabs button.active { background:var(--red); border-color:var(--red); color:#fff; }
.proposal-page-settings { display:grid; gap:18px; min-width:0; }
.proposal-page-settings[hidden] { display:none; }
.proposal-page-settings>h3 { margin:4px 0 0; }
.proposal-page-settings .field { min-width:0; }

.proposal-gears-settings { display:grid; gap:12px; padding:16px; border:1px solid var(--line); border-radius:10px; }
.proposal-gears-toggle { display:flex; align-items:center; justify-content:flex-start; gap:10px; direction:ltr; cursor:pointer; color:var(--text); }
.proposal-gears-toggle input[type="checkbox"] { appearance:auto; flex:0 0 20px; width:20px; height:20px; min-width:20px; min-height:20px; margin:0; padding:0; accent-color:var(--red); }
.proposal-gears-toggle span { display:block; font-size:14px; font-weight:700; line-height:1.6; }

.proposal-editor > * { flex-shrink:0; }

/* Give the quotation editor natural height instead of a nested scroll area. */
.quotations-page .quotation-tabs { margin-top:0; margin-bottom:14px; }
.proposal-editor-shell { height:auto; align-items:start; }
.proposal-editor { overflow:visible; max-height:none; gap:12px; }
.proposal-editor-intro { display:none; }
.proposal-page-settings { gap:12px; }
.proposal-page-settings > h3 { display:none; }
@media (min-width:1100px) {
  .proposal-page-settings[data-settings-page="2"] { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  .proposal-page-settings[data-settings-page="2"] > .field:last-child { grid-column:1/-1; }
}

.proposal-logo-size { grid-column:1/-1; }
.proposal-logo-size input[type="range"] { padding:0; accent-color:var(--red); cursor:pointer; }

.proposal-cover-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.proposal-contact { display:flex; align-items:center; justify-content:space-between; gap:8%; }
.proposal-cover-bank { display:grid; text-align:right; gap:1cqw; font-size:2.3cqw; overflow-wrap:anywhere; }
.proposal-cover-bank span:first-child { margin-bottom:3cqw; }

/* Keep the editor preview structurally identical to the public A4 document. */
.proposal-sheet { container-type:normal; }
.proposal-preview-cover { display:flex; flex-direction:column; justify-content:space-between; padding:12% 12% 8% 15%; overflow:hidden; color:#fff; background-color:#f4f3f1; background-image:linear-gradient(130deg,#111116cc,#3c1720b8 68%,#ef3340cc),url('/assets/proposal-default-cover.jpg'); background-position:center top; background-repeat:no-repeat; background-size:100% 43%; }
.proposal-preview-brand { font-size:7cqw; }
.proposal-preview-kicker { font-size:1.7cqw; font-weight:900; letter-spacing:.16em; }
.proposal-preview-cover-copy { position:relative; max-width:85%; padding-left:0; border-left:0; }
.proposal-preview-cover-copy small,.proposal-preview-cover-copy h1 { color:#ff4038; }
.proposal-preview-cover-copy small { font-size:1.7cqw; }
.proposal-preview-cover-copy h1 { margin:.5cqw 0 2.5cqw; font-size:6cqw; line-height:.95; }
.proposal-preview-cover-copy strong { display:block; font-size:10cqw; letter-spacing:.03em; line-height:.8; }
.proposal-preview-cover-copy span { display:block; margin-top:2.5cqw; font-size:1.7cqw; }
.proposal-preview-cover-copy span { color:#171319; }
.proposal-sheet .proposal-preview-cover-contact { display:flex; align-items:center; justify-content:space-between; gap:8%; margin-top:0; padding:5%; color:#111; background:#f4f3f1; }
.proposal-preview-cover-contact .proposal-cover-bank { flex:1; }
.proposal-preview-partners { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; padding:12% 12% 8% 15%; overflow:hidden; color:#fff; background-image:linear-gradient(#111a,#111a),url('/assets/proposal-default-partners.jpg'); background-position:center; background-size:cover; text-align:left; }
.proposal-preview-partners h2 { margin:0; font-size:7cqw; }
.proposal-preview-partners .proposal-partner-logo-grid { gap:3.2cqw; width:86%; margin:3.5cqw auto; padding:0; }
.proposal-preview-partners .proposal-partner-logo-grid img { width:calc(14cqw * var(--partner-logo-scale,1)); max-width:100%; height:calc(8cqw * var(--partner-logo-scale,1)); }
.proposal-preview-reference { color:#fff; font-size:2cqw; font-weight:900; text-decoration:underline; }
.proposal-quote-sheet { padding:12% 12% 8% 15%; }
.proposal-quote-head { gap:3cqw; margin-bottom:6cqw; }
.proposal-quote-head>span { margin:0; }
.proposal-closing-sheet { grid-template-rows:63% 37%; }
.proposal-preview-closing-footer { display:block; padding:9% 12%; color:#fff; background-image:linear-gradient(#1118,#1118),url('/assets/proposal-default-closing.jpg'); background-position:center; background-size:cover; }
.proposal-preview-closing-footer>strong { display:block; font-size:12cqw; line-height:.9; }

/* Reference cover: photo first, then the title and contact details on white. */
.proposal-preview-cover { display:grid; grid-template-columns:100%; grid-template-rows:56% 44%; padding:0; color:#171319; background:#f4f3f1; }
.proposal-preview-cover-image { position:relative; width:100%; background-image:url('/assets/proposal-default-cover.jpg'); background-position:center; background-size:cover; }
.proposal-preview-cover-body { position:relative; width:100%; min-height:0; background:#f4f3f1; }
.proposal-sheet .proposal-preview-cover-contact { position:absolute; right:13%; bottom:7%; left:8%; margin:0; padding:0; background:transparent; }
.proposal-cover-end-rule { position:absolute; top:62%; right:7%; bottom:0; width:3%; background:#111; }

/* The cover title sits over the water as a quiet transparent outline. */
.proposal-preview-cover-image .proposal-preview-brand {
  position:absolute;
  right:4%;
  bottom:8%;
  left:4%;
  width:auto;
  padding:0;
  color:rgba(255,255,255,.08);
  font-size:16cqw;
  text-align:center;
  opacity:1;
  -webkit-text-stroke:.025em rgba(255,255,255,.82);
  paint-order:stroke fill;
  text-shadow:0 .08em .35em rgba(0,0,0,.18);
}
.proposal-preview-cover-image .proposal-preview-brand:before{content:none;display:none}
