:root {
  color-scheme: dark;
  --ink: #f1f4fa;
  --muted: #a0adbe;
  --canvas: #090d1a;
  --surface: #121a31;
  --surface-2: #18223e;
  --line: rgba(202, 216, 255, .13);
  --cyan: #43e2f2;
  --cyan-soft: rgba(67, 226, 242, .13);
  --coral: #ff6173;
  --brand-coral: #f15b56;
  --brand-coral-dark: #c43e46;
  --brand-ink: #f1f4fa;
  --brand-muted: #a0adbe;
  --nav-active-bg: rgba(241, 91, 86, .11);
  --nav-active-border: rgba(241, 91, 86, .34);
  --nav-active-icon: #ff948d;
  --violet: #9c7aff;
  --green: #54d39b;
  --amber: #ffca66;
  --shadow: 0 24px 64px rgba(0, 0, 0, .28);
  --scrollbar-size: 10px;
  --scrollbar-radius: 999px;
  --scrollbar-track: rgba(202, 216, 255, .035);
  --scrollbar-track-hover: rgba(67, 226, 242, .075);
  --scrollbar-thumb: rgba(152, 164, 195, .30);
  --scrollbar-thumb-hover: rgba(67, 226, 242, .58);
  --scrollbar-thumb-active: rgba(84, 211, 155, .72);
  --scrollbar-inset: rgba(9, 13, 26, .86);
  --row-hover-bg: rgba(67, 226, 242, .075);
  --row-selected-bg: rgba(67, 226, 242, .145);
  --row-selected-idle-bg: rgba(67, 226, 242, .095);
  --row-selected-line: rgba(84, 211, 155, .82);
  --row-focus-glow: rgba(67, 226, 242, .22);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-theme="violet"] {
  --ink: #f1f4fa;
  --muted: #a0adbe;
  --canvas: #100b1c;
  --surface: #21143a;
  --surface-2: #2c1d4a;
  --line: rgba(228, 207, 255, .16);
  --cyan: #c29aff;
  --cyan-soft: rgba(194, 154, 255, .16);
  --violet: #b17bff;
  --brand-ink: #f1f4fa;
  --brand-muted: #a0adbe;
  --nav-active-bg: rgba(241, 91, 86, .12);
  --nav-active-border: rgba(255, 148, 141, .34);
  --nav-active-icon: #ff948d;
  --shadow: 0 24px 64px rgba(8, 1, 20, .35);
  --scrollbar-track: rgba(228, 207, 255, .04);
  --scrollbar-track-hover: rgba(194, 154, 255, .09);
  --scrollbar-thumb: rgba(207, 184, 245, .30);
  --scrollbar-thumb-hover: rgba(194, 154, 255, .62);
  --scrollbar-thumb-active: rgba(177, 123, 255, .78);
  --scrollbar-inset: rgba(16, 11, 28, .86);
  --row-hover-bg: rgba(194, 154, 255, .085);
  --row-selected-bg: rgba(194, 154, 255, .16);
  --row-selected-idle-bg: rgba(194, 154, 255, .105);
  --row-selected-line: rgba(84, 211, 155, .78);
  --row-focus-glow: rgba(194, 154, 255, .22);
}
html[data-theme="graphite"] {
  --ink: #f1f4fa;
  --muted: #a0adbe;
  --canvas: #0b0f14;
  --surface: #141a22;
  --surface-2: #1d2530;
  --line: rgba(213, 226, 242, .14);
  --cyan: #7dd3fc;
  --cyan-soft: rgba(125, 211, 252, .13);
  --coral: #fb7185;
  --violet: #a78bfa;
  --green: #5ee0a0;
  --amber: #f8c76d;
  --brand-ink: #f1f4fa;
  --brand-muted: #a0adbe;
  --nav-active-bg: rgba(241, 91, 86, .105);
  --nav-active-border: rgba(241, 91, 86, .32);
  --nav-active-icon: #ff948d;
  --shadow: 0 24px 64px rgba(0, 0, 0, .34);
  --scrollbar-track: rgba(213, 226, 242, .04);
  --scrollbar-track-hover: rgba(125, 211, 252, .08);
  --scrollbar-thumb: rgba(167, 178, 198, .30);
  --scrollbar-thumb-hover: rgba(125, 211, 252, .58);
  --scrollbar-thumb-active: rgba(94, 224, 160, .76);
  --scrollbar-inset: rgba(11, 15, 20, .88);
  --row-hover-bg: rgba(125, 211, 252, .075);
  --row-selected-bg: rgba(125, 211, 252, .14);
  --row-selected-idle-bg: rgba(125, 211, 252, .09);
  --row-selected-line: rgba(94, 224, 160, .78);
  --row-focus-glow: rgba(125, 211, 252, .20);
}
html[data-theme="light"] {
  color-scheme: light;
  --ink: #172033;
  --muted: #596779;
  --canvas: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --line: rgba(29, 47, 81, .14);
  --cyan: #117b9b;
  --cyan-soft: rgba(17, 123, 155, .10);
  --coral: #c94657;
  --violet: #6d46bd;
  --green: #138358;
  --amber: #a5660b;
  --brand-ink: #172033;
  --brand-muted: #596779;
  --nav-active-bg: rgba(241, 91, 86, .10);
  --nav-active-border: rgba(183, 56, 62, .28);
  --nav-active-icon: #b7383e;
  --shadow: 0 20px 50px rgba(24, 43, 78, .10);
  --scrollbar-track: rgba(17, 123, 155, .045);
  --scrollbar-track-hover: rgba(17, 123, 155, .095);
  --scrollbar-thumb: rgba(86, 101, 132, .34);
  --scrollbar-thumb-hover: rgba(17, 123, 155, .58);
  --scrollbar-thumb-active: rgba(19, 131, 88, .72);
  --scrollbar-inset: rgba(244, 247, 252, .94);
  --row-hover-bg: rgba(17, 123, 155, .065);
  --row-selected-bg: rgba(17, 123, 155, .13);
  --row-selected-idle-bg: rgba(17, 123, 155, .085);
  --row-selected-line: rgba(19, 131, 88, .72);
  --row-focus-glow: rgba(17, 123, 155, .16);
}
html[data-theme="light"] body { background: var(--canvas); }
html[data-theme="light"] .login-shell { background: radial-gradient(circle at 15% 12%, rgba(17,123,155,.12), transparent 28rem), radial-gradient(circle at 90% 85%, rgba(109,70,189,.12), transparent 30rem), var(--canvas); }
html[data-theme="light"] .login-card, html[data-theme="light"] .app-titlebar, html[data-theme="light"] .sidebar, html[data-theme="light"] .modal, html[data-theme="light"] .modal-head, html[data-theme="light"] .modal-footer { background: rgba(255,255,255,.94); }
html[data-theme="light"] .summary-card, html[data-theme="light"] .panel-card { background: rgba(255,255,255,.9); }
html[data-theme="light"] .field input, html[data-theme="light"] .field select, html[data-theme="light"] .field textarea, html[data-theme="light"] .filter-input, html[data-theme="light"] .global-search input { background: #fff; }
html[data-theme="light"] .capacity-input, html[data-theme="light"] .color-input, html[data-theme="light"] .phone-input, html[data-theme="light"] .money-input { background: #fff; }
html[data-theme="light"] .phone-prefix { background: #f1f5fb; }
html[data-theme="light"] .color-swatch { border-color: rgba(29,47,81,.24); }
html[data-theme="light"] .detail-field { background: #fff; }
html[data-theme="light"] .invoice-card, html[data-theme="light"] .mobile-device { background: #fff; }
html[data-theme="light"] .btn-secondary, html[data-theme="light"] .icon-btn { background: #fff; }
html[data-theme="light"] .bottom-nav { background: rgba(255,255,255,.96); }
html[data-theme="light"] .attachment-manager, html[data-theme="light"] .attachment-section, html[data-theme="light"] .attachment-tile, html[data-theme="light"] .attachment-gallery-item { background: #fff; }
html[data-theme="light"] .attachment-select, html[data-theme="light"] .attachment-preview-button, html[data-theme="light"] .attachment-gallery-preview { background: var(--surface-2); }
html[data-theme="light"] .label-setting-card, html[data-theme="light"] .setting-check, html[data-theme="light"] .label-inline-preview { background: #fff; }
html[data-theme="light"] .announcement-panel { color: #6d4500; background: linear-gradient(135deg, rgba(165,102,11,.10), rgba(17,123,155,.06)); border-color: rgba(165,102,11,.22); }
html[data-theme="light"] .currency-rate-line, html[data-theme="light"] .license-status { color: #10667e; }
html[data-theme="light"] .attachment-availability { color: #9a5f00; }
html[data-theme="light"] .currency-card-result, html[data-theme="light"] .mobile-brand-strip { background: #fff; }
html[data-theme="light"] .stock-context-menu, html[data-theme="light"] .column-menu { background: rgba(255,255,255,.98); }
html[data-theme="light"] .period-toggle, html[data-theme="light"] .finance-tabs, html[data-theme="light"] .finance-chart, html[data-theme="light"] .profit-donut, html[data-theme="light"] .source-pill { background: #fff; }
html[data-theme="light"] .profit-donut { box-shadow: inset 0 0 0 15px #fff; }

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
html { scrollbar-gutter: stable; scrollbar-color: var(--scrollbar-thumb) transparent; scrollbar-width: thin; }
body { background: var(--canvas); color: var(--ink); overflow-x: hidden; }
body, .main, .nav, .modal-body, .table-wrap, .finance-chart-bars, .label-inline-preview, .attachment-large-preview {
  scrollbar-color: var(--scrollbar-thumb) transparent;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body:hover, html.is-scrolling, body.is-scrolling,
.main:hover, .main.is-scrolling,
.nav:hover, .nav.is-scrolling,
.modal-body:hover, .modal-body.is-scrolling,
.table-wrap:hover, .table-wrap.is-scrolling,
.finance-chart-bars:hover, .finance-chart-bars.is-scrolling,
.label-inline-preview:hover, .label-inline-preview.is-scrolling,
.attachment-large-preview:hover, .attachment-large-preview.is-scrolling {
  scrollbar-color: var(--scrollbar-thumb-hover) var(--scrollbar-track-hover);
}
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
*::-webkit-scrollbar-track {
  border-radius: var(--scrollbar-radius);
  background: var(--scrollbar-track);
}
*:hover::-webkit-scrollbar-track,
*.is-scrolling::-webkit-scrollbar-track {
  background: var(--scrollbar-track-hover);
}
*::-webkit-scrollbar-thumb {
  min-width: 42px;
  min-height: 42px;
  border: 3px solid var(--scrollbar-inset);
  border-radius: var(--scrollbar-radius);
  background: linear-gradient(180deg, var(--scrollbar-thumb), var(--scrollbar-thumb)) padding-box;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.045);
  transition: background .18s ease, box-shadow .18s ease;
}
*:hover::-webkit-scrollbar-thumb,
*.is-scrolling::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), var(--scrollbar-thumb-hover)) padding-box;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 0 12px var(--scrollbar-track-hover);
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), var(--scrollbar-thumb-active)) padding-box;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 0 14px var(--scrollbar-track-hover);
}
*::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--scrollbar-thumb-active), var(--scrollbar-thumb-hover)) padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
*::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--cyan); }
i[data-lucide] { width: 18px; height: 18px; stroke-width: 2; flex: 0 0 auto; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 12%, rgba(67,226,242,.16), transparent 28rem), radial-gradient(circle at 90% 85%, rgba(156,122,255,.18), transparent 30rem), #090d1a; }
.login-card { width: min(100%, 430px); overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: rgba(18,26,49,.93); box-shadow: var(--shadow); }
.login-brand { padding: 28px 32px 24px; border-bottom: 1px solid var(--line); background: transparent; }
.login-brand-lockup { display: grid; gap: 10px; color: var(--brand-ink); }
.login-brand-meta { color: var(--brand-muted); font-size: .8125rem; font-weight: 650; letter-spacing: .1125rem; line-height: 1.45; }
.login-brand-main { display: flex; align-items: center; gap: 14px; min-height: 62px; }
.login-brand-mark { display: block; width: 56px; height: 56px; object-fit: contain; object-position: center; flex: 0 0 56px; }
.login-brand-text { min-width: 0; display: grid; gap: 3px; }
.login-brand-text strong { color: var(--brand-ink); font-size: 2rem; font-weight: 650; line-height: 1.08; letter-spacing: -.035em; }
.login-brand-text span { color: var(--brand-muted); font-size: .75rem; font-weight: 600; line-height: 1.35; }
.login-brand p { color: var(--brand-muted); margin: 2px 0 0; font-size: .96rem; line-height: 1.45; }
.login-form { padding: 28px 32px 32px; }
.login-form h1 { font-size: 1.35rem; margin: 0 0 7px; }
.login-form > p { color: var(--muted); margin: 0 0 22px; font-size: .92rem; }

.field { display: grid; gap: 7px; margin: 0 0 15px; }
.field > span, .field-label { color: var(--ink); font-size: .86rem; font-weight: 700; letter-spacing: .01em; }
.field input, .field select, .field textarea, .filter-input { border: 1px solid var(--line); border-radius: 11px; outline: none; width: 100%; min-height: 46px; color: var(--ink); background: rgba(3,8,21,.42); padding: 11px 12px; font-size: .92rem; line-height: 1.35; transition: border-color .18s, box-shadow .18s; }
.field textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(67,226,242,.14); }
.field input[type="checkbox"] { width: 17px; min-height: auto; accent-color: var(--cyan); }
.check-field { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: .86rem; margin: 4px 0 18px; }
.form-error { display: none; padding: 10px 12px; margin: 0 0 15px; color: #ffd6dc; background: rgba(255,97,115,.12); border: 1px solid rgba(255,97,115,.28); border-radius: 10px; font-size: .86rem; }
.form-error.show { display: block; }

.btn { appearance: none; border: 0; min-height: 42px; max-width: 100%; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; font-weight: 750; font-size: .88rem; background: linear-gradient(135deg, var(--cyan), #64bff7); color: #06101a; }
.btn:hover { filter: brightness(1.06); }
.btn-secondary { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink); }
.btn-danger { background: rgba(255,97,115,.14); border-color: rgba(255,97,115,.32); color: #ffd8de; }
.btn-quiet { background: transparent; color: var(--muted); padding: 8px; min-height: 36px; }
.btn-full { width: 100%; }
.login-actions { display: flex; justify-content: flex-end; gap: 14px; margin-top: 16px; }
.link-button { border: 0; padding: 0; color: var(--cyan); background: transparent; font-size: .86rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0,1fr); grid-template-rows: 60px minmax(0, 1fr); background: radial-gradient(circle at 74% -20%, rgba(67,226,242,.07), transparent 38rem), var(--canvas); transition: grid-template-columns .28s ease-out; }
.app-shell.sidebar-collapsed { grid-template-columns: 96px minmax(0,1fr); }
.app-titlebar { grid-column: 1 / -1; grid-row: 1; position: sticky; top: 0; z-index: 18; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 18px; border-bottom: 1px solid var(--line); background: rgba(9,13,26,.92); backdrop-filter: blur(14px); }
.app-title-left { min-width: 0; display: flex; align-items: center; gap: 14px; }
.titlebar-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--brand-ink); }
.titlebar-brand-mark { display: block; width: 30px; height: 30px; object-fit: contain; flex: 0 0 30px; }
.titlebar-brand div { min-width: 0; display: grid; gap: 0; line-height: 1.05; }
.titlebar-brand span { color: var(--brand-muted); font-size: .68rem; font-weight: 650; letter-spacing: .105rem; }
.titlebar-brand b { color: var(--brand-ink); font-size: 1.02rem; font-weight: 650; letter-spacing: -.02em; }
.sidebar { grid-column: 1; grid-row: 2; position: sticky; top: 60px; height: calc(100vh - 60px); display: flex; flex-direction: column; padding: 0 12px 20px; background: rgba(11,16,32,.84); border-right: 1px solid var(--line); overflow: hidden; transition: padding .28s ease-out, background .2s ease; }
.sidebar-brand { height: 126px; min-height: 126px; display: grid; grid-template-rows: 42px 72px; align-content: start; gap: 8px; padding: 12px 0 14px; margin: 0; border-bottom: 1px solid var(--line); background: transparent; }
.sidebar-brand-top { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; }
.brand-meta { color: var(--brand-muted); font-size: .8125rem; font-weight: 650; letter-spacing: .1125rem; line-height: 1.45; white-space: nowrap; transition: opacity .16s ease-out .06s, transform .18s ease-out .06s, visibility .16s; }
.sidebar-toggle { flex: 0 0 32px; width: 32px; height: 32px; color: var(--brand-ink); background: transparent; }
.sidebar-toggle:hover { color: var(--nav-active-icon); background: rgba(241,91,86,.10); }
.sidebar-toggle:focus-visible { outline: 2px solid var(--nav-active-icon); outline-offset: 2px; }
.sidebar-brand-main { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: transparent; }
.brand-mark { display: block; width: 56px; height: 56px; object-fit: contain; object-position: center; flex: 0 0 56px; }
.brand-text { min-width: 0; display: grid; gap: 2px; color: var(--brand-ink); transition: opacity .16s ease-out .06s, transform .18s ease-out .06s, visibility .16s; }
.brand-text strong { display: block; color: var(--brand-ink); font-size: 2rem; font-weight: 650; line-height: 1.08; letter-spacing: -.035em; }
.brand-text span { display: block; color: var(--brand-muted); font-size: .75rem; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.sidebar-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
.sidebar-collapsed .sidebar-brand { grid-template-rows: 42px 60px; gap: 8px; }
.sidebar-collapsed .sidebar-brand-top { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar-brand-main { justify-content: center; padding: 0; gap: 0; }
.sidebar-collapsed .brand-meta, .sidebar-collapsed .brand-text { opacity: 0; visibility: hidden; transform: translateX(-6px); pointer-events: none; width: 0; overflow: hidden; }
.sidebar-collapsed .brand-mark { width: 56px; height: 56px; flex-basis: 56px; }
.sidebar-collapsed .nav-button { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .nav-button span { width: 0; opacity: 0; transform: translateX(-6px); }
.sidebar-collapsed .user-email, .sidebar-collapsed .sidebar-footer .btn { display: none; }
.sidebar-collapsed .sidebar-footer { display: grid; place-items: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .sidebar-footer::after { content: ""; width: 28px; height: 2px; background: var(--line); }
.nav { display: grid; gap: 4px; overflow-y: auto; padding-top: 12px; }
.nav-button { border: 1px solid transparent; min-height: 43px; padding: 0 12px; border-radius: 10px; display: flex; align-items: center; gap: 11px; color: var(--muted); font-weight: 650; font-size: .88rem; background: transparent; text-align: left; transition: background .18s ease, border-color .18s ease, color .18s ease, padding .28s ease-out; }
.nav-button span { min-width: 0; overflow: hidden; white-space: nowrap; transition: width .2s ease-out, opacity .16s ease-out, transform .18s ease-out; }
.nav-button:hover { background: rgba(241,91,86,.065); border-color: rgba(241,91,86,.16); color: var(--brand-ink); }
.nav-button.active { background: var(--nav-active-bg); border-color: var(--nav-active-border); color: var(--brand-ink); box-shadow: inset 2px 0 0 var(--brand-coral); }
.nav-button.active i { color: var(--nav-active-icon); }
.nav-button:focus-visible { outline: 2px solid var(--nav-active-icon); outline-offset: 2px; }
.sidebar-footer { margin-top: auto; padding: 15px 8px 0; border-top: 1px solid var(--line); }
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .78rem; margin: 0 0 8px; }

.main { grid-column: 2; grid-row: 2; min-width: 0; padding: 26px 30px 36px; }
.main > section, .main > .summary-grid, .main > .finance-toolbar { animation: page-in .18s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.mobile-brand-strip { display: none; }
.topbar { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 23px; }
.title-block { min-width: 160px; }
.header-actions { display: flex; align-items: center; gap: 8px; min-width: min(640px, 49vw); justify-content: flex-end; }
.global-search { position: relative; flex: 1 1 260px; }
.global-search input { min-height: 40px; width: 100%; padding: 9px 12px 9px 35px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: rgba(3,8,21,.34); }
.global-search i { position: absolute; left: 10px; top: 11px; color: var(--muted); width: 17px; height: 17px; }
.global-results { position: absolute; z-index: 15; top: calc(100% + 7px); left: 0; right: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.global-result { display: block; width: 100%; padding: 10px 12px; border: 0; text-align: left; color: var(--ink); background: transparent; }
.global-result:hover { background: var(--cyan-soft); }
.global-result span { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; }
.eyebrow { color: var(--cyan); font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.topbar h1 { margin: 5px 0 0; font-size: clamp(1.35rem, 2vw, 1.85rem); letter-spacing: 0; }
.announcement-panel { min-width: 0; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid rgba(255,202,102,.25); border-radius: 10px; color: #ffe2a5; background: linear-gradient(135deg, rgba(255,202,102,.12), rgba(67,226,242,.06)); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.announcement-panel i { width: 16px; height: 16px; color: var(--amber); }
.announcement-panel span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; font-weight: 730; }
.currency-panel { border: 0; min-height: 24px; max-width: 100%; padding: 0; border-radius: 0; display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; color: var(--green); background: transparent; font-size: .76rem; font-weight: 850; line-height: 1.2; white-space: nowrap; text-shadow: 0 0 16px rgba(84,211,155,.22); }
.currency-panel:hover { color: #80efbd; background: transparent; }
.currency-panel.empty { color: var(--muted); text-shadow: none; }
.currency-panel i { width: 16px; height: 16px; stroke-width: 2.4; }
.currency-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.currency-panel.empty .currency-live-dot { background: var(--amber); box-shadow: 0 0 10px rgba(255,202,102,.45); }
.sync-chip { display: flex; align-items: center; gap: 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 8px 11px; font-size: .78rem; white-space: nowrap; }
.sync-dot { width: 7px; height: 7px; border-radius: 100%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.sync-chip.paused .sync-dot { background: var(--amber); box-shadow: 0 0 12px var(--amber); }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.summary-card, .panel-card { border: 1px solid var(--line); background: rgba(18,26,49,.76); box-shadow: 0 12px 32px rgba(0,0,0,.11); border-radius: 16px; }
.summary-card { min-height: 116px; padding: 17px; position: relative; overflow: hidden; }
.summary-card::after { content: ""; position: absolute; width: 82px; aspect-ratio: 1; border-radius: 50%; right: -38px; top: -42px; background: var(--card-glow, rgba(67,226,242,.12)); }
.summary-card .card-label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.summary-card .card-value { display: block; margin-top: 10px; font-size: 1.32rem; font-weight: 790; letter-spacing: 0; }
.summary-card .card-note { color: var(--muted); font-size: .75rem; margin-top: 4px; }
.dashboard-lower { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(280px,.8fr); gap: 14px; margin-top: 14px; }
.finance-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.finance-actions, .period-toggle, .finance-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.finance-search { flex: 1 1 260px; }
.finance-search input { width: 100%; }
.period-toggle, .finance-tabs { padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: rgba(18,26,49,.64); }
.period-toggle button, .finance-tabs button { min-height: 33px; border: 0; border-radius: 9px; padding: 7px 10px; color: var(--muted); background: transparent; font-size: .82rem; font-weight: 800; }
.period-toggle button:hover, .finance-tabs button:hover { color: var(--ink); background: rgba(67,226,242,.08); }
.period-toggle button.active, .finance-tabs button.active { color: #06101a; background: linear-gradient(135deg, var(--green), var(--cyan)); }
.finance-summary-card .card-value { font-size: clamp(1.08rem, 1.5vw, 1.42rem); }
.finance-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .9fr); gap: 14px; margin-top: 14px; }
.finance-grid.single { grid-template-columns: minmax(0, 1fr); }
.chart-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .75rem; font-weight: 760; white-space: nowrap; }
.chart-legend i { width: 10px; height: 10px; border-radius: 99px; background: var(--green); }
.chart-legend i:last-child { background: var(--coral); }
.finance-chart { min-height: 250px; display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(3,8,21,.26); }
.finance-axis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; color: var(--muted); font-size: .75rem; }
.finance-chart-bars { min-width: 0; display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.finance-chart-slot { min-width: 42px; display: grid; grid-template-rows: 1fr auto; gap: 8px; align-items: end; }
.finance-bar-pair { height: 185px; display: flex; align-items: end; justify-content: center; gap: 4px; padding: 0 3px; border-bottom: 1px solid rgba(202,216,255,.15); }
.finance-bar { width: 12px; min-height: 0; border-radius: 8px 8px 2px 2px; transform-origin: bottom; animation: finance-rise .38s ease-out both; }
.finance-bar.income { background: linear-gradient(180deg, var(--cyan), var(--green)); box-shadow: 0 0 18px rgba(84,211,155,.18); }
.finance-bar.expense { background: linear-gradient(180deg, #ff8a98, var(--coral)); box-shadow: 0 0 18px rgba(255,97,115,.16); }
.finance-chart-slot small { overflow: hidden; color: var(--muted); text-align: center; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.finance-net { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.finance-net span { color: var(--muted); font-size: .78rem; }
.finance-net b { font-size: 1rem; }
.profit-card { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 14px; align-items: center; }
.profit-donut { width: 142px; aspect-ratio: 1; display: grid; place-items: center; align-content: center; border-radius: 50%; background: conic-gradient(var(--green) var(--donut, 0%), rgba(202,216,255,.12) 0); box-shadow: inset 0 0 0 15px rgba(18,26,49,.94); text-align: center; }
.profit-donut span { color: var(--muted); font-size: .75rem; font-weight: 800; }
.profit-donut b { color: var(--ink); font-size: 1.15rem; }
.profit-lines { display: grid; gap: 7px; }
.profit-lines div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(202,216,255,.08); }
.profit-lines div:last-child { border-bottom: 0; }
.profit-lines span { color: var(--muted); font-size: .78rem; }
.profit-lines b { color: var(--ink); font-size: .86rem; white-space: nowrap; }
.finance-table-panel { margin-top: 14px; }
.finance-table { margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); }
.finance-table table { min-width: 760px; }
.finance-table tr[data-account-open] { cursor: pointer; }
.finance-table tr[data-account-open]:focus-visible { outline: 0; }
.source-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border: 1px solid rgba(202,216,255,.14); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.035); font-size: .75rem; font-weight: 800; }
.source-pill.manual { color: var(--green); border-color: rgba(84,211,155,.28); background: rgba(84,211,155,.08); }
.finance-empty { min-height: 250px; display: grid; place-items: center; }
.finance-privacy-panel .finance-empty { min-height: 360px; gap: 10px; align-content: center; }
.finance-privacy-panel .finance-empty i { width: 38px; height: 38px; color: var(--cyan); }
.finance-privacy-panel .finance-empty b { color: var(--ink); font-size: 1.05rem; }
.finance-privacy-panel .finance-empty span { max-width: 540px; color: var(--muted); }
.dashboard-visibility-groups { display: grid; gap: 12px; }
.dashboard-visibility-group { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255,255,255,.025); }
.dashboard-visibility-group b { display: block; margin-bottom: 9px; color: var(--ink); font-size: .86rem; }
.dashboard-visibility-group .check-grid { margin: 0; }
@keyframes finance-rise { from { transform: scaleY(.18); opacity: .45; } to { transform: scaleY(1); opacity: 1; } }
.panel-card { padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1rem; }
.panel-head small { color: var(--muted); }
.movement-list { display: grid; gap: 8px; }
.movement-row { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 11px; }
.movement-row:last-child { border-bottom: 0; }
.movement-title { font-weight: 720; font-size: .88rem; }
.movement-meta { color: var(--muted); font-size: .76rem; margin-top: 3px; }
.amount-income { color: var(--green); font-weight: 750; white-space: nowrap; }
.amount-expense { color: #ff96a3; font-weight: 750; white-space: nowrap; }
.empty { padding: 25px 12px; text-align: center; color: var(--muted); font-size: .88rem; }

.page-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 15px; }
.search-wrap { position: relative; flex: 1 1 230px; }
.search-wrap i { position: absolute; left: 12px; top: 12px; color: var(--muted); width: 17px; height: 17px; }
.search-wrap input { padding-left: 38px; }
.filter-input { width: auto; min-width: 140px; }
.table-wrap { overflow-x: auto; padding: 0; }
table { border-collapse: collapse; width: 100%; min-width: 680px; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { border-bottom: 1px solid rgba(202,216,255,.08); padding: 13px; font-size: .86rem; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
[data-table-row] {
  cursor: pointer;
  outline: 0;
  transition: background .16s ease, box-shadow .16s ease, color .16s ease, border-color .16s ease;
}
[data-table-row]:hover {
  color: var(--ink);
  background: var(--row-hover-bg);
}
[data-table-row].selected,
[data-table-row][aria-selected="true"] {
  color: var(--ink);
  background: var(--row-selected-bg);
  box-shadow: inset 3px 0 0 var(--row-selected-line);
}
.table-wrap:not(:focus-within) [data-table-row].selected,
.table-wrap:not(:focus-within) [data-table-row][aria-selected="true"],
.mobile-list:not(:focus-within) [data-table-row].selected,
.mobile-list:not(:focus-within) [data-table-row][aria-selected="true"] {
  background: var(--row-selected-idle-bg);
}
[data-table-row]:focus-visible {
  outline: 0;
  box-shadow: inset 3px 0 0 var(--row-selected-line), 0 0 0 2px var(--row-focus-glow);
}
tr[data-table-row]:hover td,
tr[data-table-row].selected td,
tr[data-table-row][aria-selected="true"] td,
[data-table-row]:hover .device-main span,
[data-table-row].selected .device-main span,
[data-table-row][aria-selected="true"] .device-main span,
[data-table-row]:hover .stock-imei-cell span,
[data-table-row].selected .stock-imei-cell span,
[data-table-row][aria-selected="true"] .stock-imei-cell span {
  color: var(--ink);
}
[data-stock-field] { cursor: cell; }
td[data-stock-field]:hover, [data-stock-field]:not(td):hover { color: var(--ink); background: transparent; outline: 0; text-decoration: underline; text-decoration-color: rgba(67,226,242,.45); text-underline-offset: 3px; }
[data-stock-field]:focus, [data-stock-field]:focus-visible { outline: 0; box-shadow: none; }
.device-main { display: grid; gap: 3px; }
.device-main b { font-size: .9rem; }
.device-main span { color: var(--muted); font-size: .75rem; }
.stock-inline-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.stock-inline-meta span { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 6px; border: 1px solid rgba(202,216,255,.10); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.028); font-size: .68rem; font-weight: 750; }
.stock-imei-cell { display: grid; gap: 3px; }
.stock-imei-cell span, .stock-imei-cell small { color: var(--muted); font-size: .75rem; }
.stock-imei-cell small { color: var(--cyan); font-weight: 800; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; border-radius: 99px; padding: 3px 8px; font-size: .7rem; font-weight: 800; border: 1px solid transparent; }
.badge.stock { color: #bff8dd; background: rgba(84,211,155,.1); border-color: rgba(84,211,155,.24); }
.badge.sold { color: #ffd4da; background: rgba(255,97,115,.1); border-color: rgba(255,97,115,.24); }
.badge.purchase { color: #b8eff6; background: rgba(67,226,242,.1); border-color: rgba(67,226,242,.24); }
.badge.warning { color: #ffe2a5; background: rgba(255,202,102,.1); border-color: rgba(255,202,102,.25); }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.stock-row-actions { min-width: max-content; }
.stock-summary { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-height: 37px; margin: -4px 0 14px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: linear-gradient(135deg, rgba(84,211,155,.10), rgba(67,226,242,.045)); box-shadow: 0 5px 16px rgba(2,7,19,.08); font-size: .78rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.stock-summary-primary, .stock-summary-filtered { display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.stock-summary-primary { color: var(--ink); }
.stock-summary-primary i { width: 16px; height: 16px; color: var(--green); }
.stock-summary b { color: var(--green); font-size: .9rem; font-weight: 860; }
.stock-summary-filtered { padding-left: 10px; border-left: 1px solid var(--line); }
.stock-summary-filtered b { color: var(--cyan); }
.stock-selected-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, rgba(67,226,242,.055), rgba(156,122,255,.045)); }
.stock-selected-toolbar > span { min-width: 0; color: var(--muted); font-size: .82rem; font-weight: 760; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stock-selected-toolbar .detail-actions { flex: 0 0 auto; }
.column-popover { position: relative; }
.column-menu { position: absolute; z-index: 25; top: calc(100% + 8px); right: 0; width: min(285px, calc(100vw - 28px)); padding: 12px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(17,26,49,.98); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.column-menu-title { color: var(--ink); font-size: .84rem; font-weight: 820; }
.column-menu small { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.column-check { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 8px 9px; border: 1px solid rgba(202,216,255,.1); border-radius: 10px; color: var(--ink); background: rgba(255,255,255,.025); font-size: .8rem; font-weight: 740; }
.column-check input { accent-color: var(--green); }
.icon-btn { border: 1px solid var(--line); background: rgba(255,255,255,.035); width: 34px; height: 34px; padding: 0; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--ink); border-color: rgba(67,226,242,.5); }
.icon-btn.danger:hover { color: #ffb3bd; border-color: rgba(255,97,115,.6); }
.stock-context-menu { position: fixed; z-index: 55; min-width: 238px; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: rgba(17,26,49,.98); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.stock-context-menu button { width: 100%; min-height: 35px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 9px; padding: 8px 9px; color: var(--ink); background: transparent; text-align: left; font-size: .8rem; }
.stock-context-menu button:hover { background: rgba(67,226,242,.10); color: var(--cyan); }
.stock-context-menu button:disabled { color: var(--muted); cursor: not-allowed; opacity: .48; }
.stock-context-menu button i { width: 16px; height: 16px; }
.stock-context-menu hr { height: 1px; margin: 5px 4px; border: 0; background: var(--line); }

.mobile-list { display: none; gap: 9px; }
.mobile-device { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: rgba(255,255,255,.02); }
.mobile-device[data-table-row]:hover { border-color: var(--row-focus-glow); background: var(--row-hover-bg); }
.mobile-device[data-table-row].selected,
.mobile-device[data-table-row][aria-selected="true"] {
  border-color: var(--row-selected-line);
  background: var(--row-selected-bg);
  box-shadow: inset 3px 0 0 var(--row-selected-line), 0 10px 28px rgba(0,0,0,.10);
}
.mobile-device summary { list-style: none; display: flex; align-items: center; gap: 11px; padding: 13px; cursor: pointer; }
.mobile-device summary::-webkit-details-marker { display: none; }
.mobile-device .status-stripe { width: 4px; align-self: stretch; border-radius: 4px; background: var(--green); }
.mobile-device.sold .status-stripe { background: var(--coral); }
.mobile-device-info { flex: 1; min-width: 0; }
.mobile-device-info b, .mobile-device-info span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mobile-device-info b { font-size: .89rem; }
.mobile-device-info span { color: var(--muted); font-size: .75rem; margin-top: 2px; }
.mobile-device-price { font-size: .82rem; font-weight: 760; white-space: nowrap; }
.mobile-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.mobile-details div { min-width: 0; padding: 10px 12px; background: var(--surface); }
.mobile-details span { display: block; color: var(--muted); font-size: .68rem; margin-bottom: 3px; }
.mobile-details b { overflow-wrap: anywhere; font-size: .78rem; }
.mobile-actions { display: flex; gap: 7px; padding: 10px; border-top: 1px solid var(--line); }
.mobile-actions .btn { flex: 1; min-height: 37px; font-size: .78rem; }

.modal-backdrop { position: fixed; z-index: 30; inset: 0; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); display: grid; place-items: center; background: rgba(3,6,15,.74); backdrop-filter: blur(6px); }
.modal { max-height: min(91vh, 880px); overflow: hidden; width: min(100%, 760px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: #111a31; box-shadow: var(--shadow); }
.modal.wide { width: min(100%, 1040px); }
.modal-head { position: sticky; top: 0; z-index: 2; flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--line); background: #111a31; }
.modal-head h2 { font-size: 1.05rem; margin: 0; }
.modal-body { min-height: 0; overflow: auto; padding: 19px; }
.modal-footer { position: sticky; bottom: 0; z-index: 2; flex: 0 0 auto; display: flex; gap: 9px; justify-content: flex-end; padding: 14px 19px; border-top: 1px solid var(--line); background: #111a31; }
.modal-footer .btn:first-child { margin-right: auto; }
.stock-field-modal { width: min(100%, 480px); }
.stock-field-modal .form-grid { grid-template-columns: 1fr; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; margin: 9px 0 13px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--cyan); font-size: .78rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.check-grid { display: flex; flex-wrap: wrap; gap: 12px 17px; margin-bottom: 16px; }
.inline-check { display: inline-flex; gap: 7px; align-items: center; color: var(--ink); font-size: .84rem; }
.inline-check input { accent-color: var(--cyan); }
.imei-row { display: grid; grid-template-columns: minmax(0, 1fr) 50px auto auto; gap: 7px; align-items: end; }
.imei-primary { min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: .035em; }
.imei-check-control { position: relative; display: block; min-width: 50px; }
.imei-check-control small { position: absolute; z-index: 1; top: 3px; left: 7px; color: var(--muted); font-size: .58rem; font-weight: 850; line-height: 1; pointer-events: none; }
.imei-check-digit { width: 50px; min-width: 50px; padding: 14px 6px 4px !important; color: var(--cyan) !important; text-align: center; font-size: 1rem; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: .04em; background: var(--cyan-soft) !important; cursor: default; }
.imei-check-digit:focus { border-color: var(--line); box-shadow: none; }
.imei-format-help { display: block; min-height: 16px; margin-top: 4px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.capacity-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; min-height: 46px; border: 1px solid var(--line); border-radius: 11px; background: rgba(3,8,21,.42); transition: border-color .18s, box-shadow .18s; }
.capacity-input:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(67,226,242,.14); }
.capacity-input input, .capacity-input select { min-height: 44px; border: 0; border-radius: 0; box-shadow: none !important; background: transparent !important; line-height: 1.35; }
.capacity-input input { padding: 11px 12px; }
.capacity-input select, .capacity-unit { min-width: 70px; border-left: 1px solid var(--line); }
.capacity-unit { display: inline-grid; place-items: center; padding: 0 12px; color: var(--cyan); font-size: .8rem; font-weight: 850; background: rgba(67,226,242,.08); }
.capacity-input select { width: 76px; padding: 0 10px; color: var(--ink); font-weight: 800; }
.money-field { max-width: 360px; }
.money-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; min-height: 46px; border: 1px solid var(--line); border-radius: 11px; background: rgba(3,8,21,.42); transition: border-color .18s, box-shadow .18s; }
.money-input:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(67,226,242,.14); }
.money-input input, .money-input select { min-height: 44px; border: 0; border-radius: 0; box-shadow: none !important; background: transparent !important; line-height: 1.35; }
.money-input input { padding: 11px 12px; text-align: right; font-variant-numeric: tabular-nums; }
.money-input select { width: 82px; padding: 0 8px; color: var(--ink); font-weight: 850; border-left: 1px solid var(--line); }
.money-try-preview { display: block; min-height: 17px; margin-top: 5px; color: var(--green); font-size: .74rem; font-weight: 760; }
.money-try-preview.warning { color: var(--amber); }
.color-input, .phone-input { display: grid; align-items: stretch; overflow: hidden; min-height: 46px; border: 1px solid var(--line); border-radius: 11px; background: rgba(3,8,21,.42); transition: border-color .18s, box-shadow .18s; }
.color-input { grid-template-columns: minmax(0, 1fr) auto; }
.phone-input { grid-template-columns: auto minmax(0, 1fr); }
.color-input:focus-within, .phone-input:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(67,226,242,.14); }
.color-input input, .phone-input input { min-height: 44px; border: 0; border-radius: 0; box-shadow: none !important; background: transparent !important; line-height: 1.35; }
.color-input input, .phone-input input { padding: 11px 12px; }
.color-swatch { align-self: center; justify-self: center; width: 22px; height: 22px; margin: 0 12px; border-radius: 999px; background: var(--swatch-color, transparent); border: 1px solid rgba(255,255,255,.45); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 0 0 4px rgba(255,255,255,.035); }
.color-swatch.empty { background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); border-style: dashed; box-shadow: none; }
.phone-prefix { display: inline-grid; place-items: center; min-width: 42px; color: var(--muted); background: rgba(255,255,255,.035); border-right: 1px solid var(--line); font-weight: 850; }
.imei-status { min-width: 82px; padding: 10px 7px; color: var(--muted); font-size: .71rem; text-align: center; border: 1px solid var(--line); border-radius: 9px; }
.imei-status.valid { color: var(--green); border-color: rgba(84,211,155,.35); }
.imei-status.invalid { color: #ff9daa; border-color: rgba(255,97,115,.4); }
.camera-panel { margin-bottom: 14px; padding: 13px; border: 1px dashed rgba(67,226,242,.42); border-radius: 12px; background: rgba(67,226,242,.06); }
.camera-panel video { width: 100%; max-height: 260px; margin-top: 10px; background: #000; border-radius: 8px; object-fit: cover; }
.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.detail-field { min-width: 0; padding: 12px; background: rgba(11,16,32,.82); }
.detail-field span { display: block; color: var(--muted); font-size: .7rem; margin-bottom: 5px; }
.detail-field b { overflow-wrap: anywhere; font-size: .83rem; }
.detail-field.wide { grid-column: span 2; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.detail-actions .btn { flex: 0 1 auto; }
.invoice-card { margin-top: 15px; border: 1px solid var(--line); padding: 14px; border-radius: 12px; background: rgba(255,255,255,.025); }
.invoice-card h3 { margin: 0 0 4px; font-size: .92rem; }
.invoice-card p { margin: 0; color: var(--muted); font-size: .78rem; }
.invoice-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.license-status { padding: 12px; margin-top: 13px; border-radius: 10px; background: rgba(67,226,242,.07); border: 1px solid rgba(67,226,242,.16); color: #bdeff4; font-size: .82rem; }
.license-status code { color: var(--cyan); font-size: .78rem; overflow-wrap: anywhere; }
.settings-dashboard .panel-card { min-width: 0; }
.device-session-card { grid-column: 1 / -1; }
.device-session-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; }
.device-session-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.qr-device-modal { width: min(100%, 620px); }
.qr-open-card { display: grid; gap: 14px; }
.qr-open-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px; border: 1px solid rgba(84,211,155,.22); border-radius: 16px; background: radial-gradient(circle at 8% 0%, rgba(84,211,155,.18), transparent 19rem), rgba(255,255,255,.035); }
.qr-open-hero h3 { margin: 4px 0 4px; color: var(--ink); font-size: clamp(1.05rem, 4vw, 1.35rem); line-height: 1.15; overflow-wrap: anywhere; }
.qr-open-hero p { margin: 0; color: var(--muted); font-size: .86rem; }
.qr-eyebrow { color: var(--green); font-size: .72rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.qr-code-line { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3,8,21,.30); color: var(--ink); font-size: .82rem; font-weight: 780; }
.qr-code-line span { min-width: 0; overflow-wrap: anywhere; }
.qr-code-line i { flex: 0 0 auto; width: 18px; height: 18px; color: var(--cyan); }
.qr-code-line.muted { color: var(--muted); }
.qr-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.qr-main-btn { min-height: 46px; flex: 1 1 190px; }
.qr-device-modal .modal-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qr-open-warning { justify-items: center; text-align: center; padding: 8px 0 2px; }
.qr-open-warning h3 { margin: 0; color: var(--ink); font-size: 1.02rem; line-height: 1.35; }
.qr-open-warning p { margin: 0; max-width: 440px; color: var(--muted); font-size: .86rem; }
.qr-warning-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; color: var(--amber); background: rgba(255,202,102,.11); border: 1px solid rgba(255,202,102,.25); }
.qr-warning-icon i { width: 27px; height: 27px; }
.btn-small { min-height: 34px; padding: 7px 9px; border-radius: 9px; font-size: .76rem; }
.currency-screen { display: grid; gap: 14px; }
.currency-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border: 1px solid rgba(84,211,155,.22); border-radius: 18px; background: radial-gradient(circle at 10% 10%, rgba(84,211,155,.16), transparent 22rem), linear-gradient(135deg, rgba(67,226,242,.08), rgba(156,122,255,.06)); box-shadow: 0 12px 32px rgba(0,0,0,.11); }
.currency-hero h2 { margin: 6px 0 6px; font-size: clamp(1.3rem, 2.1vw, 1.95rem); }
.currency-hero p { margin: 0; color: var(--muted); }
.currency-hero-rate { min-width: min(100%, 360px); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid rgba(84,211,155,.25); border-radius: 13px; background: rgba(84,211,155,.08); }
.currency-hero-rate span { color: var(--green); font-size: .84rem; font-weight: 830; }
.currency-hero-rate.empty { border-color: rgba(255,202,102,.26); background: rgba(255,202,102,.08); }
.currency-hero-rate.empty span { color: var(--amber); }
.currency-converter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.currency-converter-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(18,26,49,.76); box-shadow: 0 12px 32px rgba(0,0,0,.10); }
.currency-card-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; margin: 2px 0 10px; padding: 12px 13px; border: 1px solid rgba(84,211,155,.20); border-radius: 12px; background: rgba(3,8,21,.30); }
.currency-card-result span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.currency-card-result b { color: var(--green); font-size: 1.2rem; letter-spacing: 0; white-space: nowrap; }
.currency-converter-card small { color: var(--muted); font-size: .76rem; }
.currency-empty { display: grid; gap: 7px; place-items: center; }
.currency-empty i { color: var(--amber); }
.currency-empty b { color: var(--ink); }
.currency-empty span { color: var(--muted); }
.attachment-manager { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); }
.attachment-manager-head, .attachment-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.attachment-manager-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 1rem; }
.attachment-manager-head h3 i { color: var(--cyan); }
.attachment-manager-head p { max-width: 610px; margin: 6px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.45; }
.attachment-count, .attachment-pill { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 26px; padding: 4px 8px; border: 1px solid rgba(67,226,242,.22); border-radius: 99px; color: var(--cyan); background: rgba(67,226,242,.08); font-size: .73rem; font-weight: 800; white-space: nowrap; }
.attachment-count i, .attachment-pill i { width: 14px; height: 14px; }
.attachment-section { margin-top: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3,8,21,.22); }
.attachment-section-head h4 { margin: 0; color: var(--ink); font-size: .88rem; }
.attachment-section-head small { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; }
.attachment-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.attachment-select { max-width: 190px; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: rgba(3,8,21,.42); font-size: .77rem; }
.attachment-draft-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 11px; }
.attachment-empty { grid-column: 1 / -1; padding: 11px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: .76rem; text-align: center; }
.attachment-tile { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.attachment-preview-button { width: 58px; height: 48px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: rgba(3,8,21,.28); }
.attachment-preview-button:hover { border-color: var(--cyan); }
.attachment-thumb { width: 100%; height: 100%; display: grid; place-items: center; color: var(--cyan); }
.attachment-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-tile-copy { min-width: 0; display: grid; gap: 3px; }
.attachment-tile-copy b { overflow-wrap: anywhere; color: var(--ink); font-size: .8rem; line-height: 1.3; }
.attachment-tile-copy span { overflow-wrap: anywhere; color: var(--muted); font-size: .75rem; line-height: 1.3; }
.attachment-availability { display: block; margin-top: 2px; color: #f9c977; font-size: .72rem; line-height: 1.32; overflow-wrap: anywhere; }
.attachment-tile-actions { display: flex; gap: 4px; }
.attachment-tile-actions .icon-btn { width: 30px; height: 30px; }
.attachment-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.attachment-gallery-item { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.attachment-gallery-item b, .attachment-gallery-item span { overflow-wrap: anywhere; min-width: 0; line-height: 1.3; }
.attachment-gallery-item b { font-size: .8rem; }
.attachment-gallery-item > span { color: var(--muted); font-size: .75rem; }
.attachment-gallery-preview { aspect-ratio: 1.45; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: rgba(3,8,21,.28); }
.attachment-gallery-preview:hover { border-color: var(--cyan); }
.attachment-gallery-preview:disabled { cursor: not-allowed; opacity: .55; border-style: dashed; }
.link-button:disabled { cursor: not-allowed; opacity: .55; }
.attachment-gallery-thumb { display: grid; width: 100%; height: 100%; place-items: center; color: var(--cyan); }
.attachment-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-preview-layer { position: fixed; z-index: 45; inset: 0; display: grid; place-items: center; padding: 14px; background: rgba(3,6,15,.82); backdrop-filter: blur(8px); }
.attachment-preview-layer .modal { width: min(100%, 1040px); }
.attachment-large-preview { min-height: min(62vh, 630px); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #060a13; }
.attachment-large-preview img { display: block; max-width: 100%; max-height: min(62vh, 630px); object-fit: contain; }
.attachment-large-preview iframe { width: 100%; height: min(62vh, 630px); border: 0; background: #fff; }
.attachment-loading { min-height: 180px; display: grid; place-content: center; gap: 10px; color: var(--muted); text-align: center; }
.attachment-loading i { margin: auto; animation: attachment-spin 1s linear infinite; }
@keyframes attachment-spin { to { transform: rotate(360deg); } }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.report-section { margin-top: 14px; }
.compact-table table { min-width: 840px; }
.export-menu { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.export-menu select { min-height: 39px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; color: var(--ink); background: rgba(255,255,255,.04); }
.live-finance-summary { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.live-finance-summary > div { min-width: 0; padding: 12px; border: 1px solid rgba(202,216,255,.11); border-radius: 12px; background: rgba(255,255,255,.03); }
.live-finance-summary > div.wide { grid-column: 1 / -1; }
.live-finance-summary span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .72rem; font-weight: 750; }
.live-finance-summary b { color: var(--ink); font-size: .93rem; }
.gross-margin-card { display: grid; align-content: start; justify-items: center; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.7fr) auto; align-items: center; gap: 10px; font-size: .81rem; }
.bar-track { overflow: hidden; height: 8px; border-radius: 99px; background: rgba(127, 151, 203, .16); }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.bar-row.animated { animation: page-in .24s ease both; animation-delay: var(--rank-delay, 0ms); }
.bar-row.animated .bar-track span { transform-origin: left center; animation: rank-fill .42s ease both; animation-delay: var(--rank-delay, 0ms); }
@keyframes rank-fill { from { transform: scaleX(.08); opacity: .55; } to { transform: scaleX(1); opacity: 1; } }
.service-empty { display: grid; gap: 10px; padding: 25px; text-align: center; color: var(--muted); }
.service-empty i { width: 30px; height: 30px; margin: auto; color: var(--violet); }
.label-workbench { display: grid; grid-template-columns: minmax(280px, .88fr) minmax(320px, 1.12fr); gap: 14px; align-items: start; }
.label-ticket-modal { width: min(100%, 560px); }
.label-ticket-flow { display: grid; gap: 13px; }
.label-ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 14px; border: 1px solid rgba(67,226,242,.18); border-radius: 14px; background: linear-gradient(135deg, rgba(67,226,242,.09), rgba(156,122,255,.08)); }
.label-ticket-head div { min-width: 0; }
.label-ticket-head span, .label-ticket-head small { display: block; color: var(--muted); font-size: .74rem; }
.label-ticket-head b { display: block; margin: 3px 0; color: var(--ink); font-size: .98rem; overflow-wrap: anywhere; }
.label-ticket-head i { width: 28px; height: 28px; color: var(--green); }
.label-mode-title { color: var(--ink); font-size: .82rem; font-weight: 820; }
.label-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.label-mode-card { min-width: 0; display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.label-mode-card:hover { transform: translateY(-1px); border-color: rgba(67,226,242,.28); }
.label-mode-card:has(input:checked) { border-color: rgba(84,211,155,.45); background: rgba(84,211,155,.08); }
.label-mode-card input { margin-top: 2px; accent-color: var(--green); }
.label-mode-card b, .label-mode-card small { display: block; }
.label-mode-card b { color: var(--ink); font-size: .83rem; }
.label-mode-card small { margin-top: 3px; color: var(--muted); font-size: .7rem; overflow-wrap: anywhere; }
.label-inline-preview { display: grid; place-items: center; overflow: auto; padding: 12px; border: 1px dashed rgba(202,216,255,.18); border-radius: 13px; background: rgba(3,8,21,.24); }
.label-ticket-hint { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.label-preview { width: var(--label-width, 58mm); max-width: 100%; color: #10131c; background: white; border: 1px dashed #2b3242; border-radius: 7px; font-family: Inter, Arial, sans-serif; box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.label-paper { width: var(--label-width, 58mm); height: var(--label-height, 40mm); max-width: 100%; display: grid; gap: 1mm; padding: 2.4mm 3mm; overflow: hidden; color: #111; background: #fff; text-align: var(--label-align, center); }
.label-type-qr .label-paper { grid-template-rows: minmax(0, auto) var(--label-code-size, 20mm) auto auto; align-content: start; }
.label-type-barcode .label-paper { grid-template-rows: minmax(0, auto) minmax(11mm, 1fr) auto auto; align-content: start; }
.label-copy { min-width: 0; display: grid; gap: .45mm; align-content: start; font-size: var(--label-font-size, 8pt); line-height: 1.13; font-weight: 520; }
.label-copy b { font-weight: var(--label-font-weight, 700); }
.label-text-line { display: block; overflow-wrap: anywhere; word-break: normal; }
.label-visual { justify-self: center; background: #fff; }
.label-qr-box { width: var(--label-code-size, 20mm); height: var(--label-code-size, 20mm); display: grid; place-items: center; padding: 0; border: 0; border-radius: 0; background: #fff; color: #000; box-shadow: none; text-align: center; }
.label-qr-box img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.label-qr-box i { margin: auto; }
.label-qr-box small { display: block; margin-top: 2px; font-size: 5.5pt; }
.label-barcode-box { align-self: end; width: 100%; height: min(15mm, calc(var(--label-code-size, 20mm) * .72)); display: grid; place-items: stretch; padding: .6mm 0; border-top: .2mm solid #dfe3ec; border-bottom: .2mm solid #dfe3ec; }
.label-code128-svg { display: block; width: 100%; height: 100%; }
.label-open-code, .label-barcode-text, .label-mode-note { margin: 0; color: #4a5160; font-size: max(5.5pt, calc(var(--label-font-size, 8pt) - 2pt)); line-height: 1.12; text-align: center; overflow-wrap: anywhere; }
.label-barcode-text { font-weight: 760; letter-spacing: .04em; color: #151924; }
.label-mode-note { color: #5a6272; }
.label-settings-panel { min-width: 0; }
.label-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.label-setting-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.label-setting-card.full { grid-column: 1 / -1; }
.label-setting-card h3 { margin: 0 0 12px; color: var(--ink); font-size: .92rem; }
.label-setting-card .form-grid { gap: 0 10px; }
.setting-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.setting-check { min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 37px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(3,8,21,.18); font-size: .82rem; font-weight: 720; }
.setting-check input { accent-color: var(--green); }
.setting-check span { min-width: 0; overflow-wrap: anywhere; }
.official-status { grid-column: 1 / -1; min-height: 18px; margin-top: -8px; font-size: .78rem; color: var(--muted); }
.official-status.ok { color: var(--green); }
.official-status.danger { color: #ff8090; }
.official-status.critical { color: #ff8090; font-weight: 800; animation: status-blink 1.1s ease-in-out infinite; }
.official-status.warning { color: var(--amber); }
.official-status.loading { color: var(--cyan); }
.imei-query-btn { position: relative; }
.imei-query-btn .imei-query-spinner { display: none; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: imei-spin .68s linear infinite; }
.imei-query-btn.is-loading i { display: none; }
.imei-query-btn.is-loading .imei-query-spinner { display: block; }
.imei-query-btn:disabled { cursor: wait; opacity: .72; }
.imei-captcha-layer { position: fixed; z-index: 65; inset: 0; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: rgba(3,6,15,.76); backdrop-filter: blur(8px); }
.imei-captcha-dialog { width: min(100%, 410px); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.imei-captcha-head, .imei-captcha-footer { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.imei-captcha-head h2 { flex: 1; margin: 0; color: var(--ink); font-size: 1rem; }
.imei-captcha-head .icon-btn { flex: 0 0 auto; }
.imei-captcha-dialog form { display: grid; gap: 12px; padding: 16px; }
.imei-captcha-dialog form > p { margin: 0; color: var(--muted); font-size: .84rem; }
.imei-captcha-image { display: block; width: 100%; min-height: 72px; max-height: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.imei-captcha-error { min-height: 18px; color: #ff8090 !important; font-size: .78rem !important; }
.imei-captcha-footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.imei-captcha-footer .btn { min-height: 39px; }
.imei-captcha-footer .btn.is-loading i { animation: imei-spin .68s linear infinite; }
@keyframes imei-spin { to { transform: rotate(360deg); } }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 43px; }
.password-toggle { position: absolute; right: 5px; top: 4px; width: 34px; height: 34px; }
@keyframes status-blink { 50% { opacity: .3; } }

html[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--line); }
html[dir="rtl"] .global-search i { left: auto; right: 10px; }
html[dir="rtl"] .global-search input { padding-left: 12px; padding-right: 35px; }
html[dir="rtl"] .nav-button { text-align: right; }

.bottom-nav { display: none; }
.pause-banner { position: fixed; z-index: 21; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(calc(100% - 26px), 540px); padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid rgba(255,202,102,.38); border-radius: 12px; color: #ffe1a4; background: #282033; box-shadow: var(--shadow); font-size: .82rem; }
.pause-banner .btn { flex: 0 0 auto; min-height: 36px; padding: 7px 10px; }
.toast { position: fixed; z-index: 50; right: 18px; bottom: 18px; max-width: min(90vw, 390px); padding: 12px 14px; color: #eaf4ff; background: #17223c; border: 1px solid rgba(67,226,242,.25); border-radius: 11px; box-shadow: var(--shadow); font-size: .84rem; animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(255,97,115,.45); color: #ffe0e5; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1040px) {
  .topbar { grid-template-columns: minmax(160px, 1fr) auto; }
  .announcement-panel { grid-column: 1 / -1; order: 3; }
  .header-actions { min-width: min(100%, 520px); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-lower { grid-template-columns: 1fr; }
  .device-session-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .finance-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --scrollbar-size: 8px; }
  body { padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; }
  .app-titlebar { min-height: calc(54px + env(safe-area-inset-top)); padding: max(8px, env(safe-area-inset-top)) 12px 8px; }
  .app-title-left { width: 100%; gap: 10px; justify-content: space-between; }
  .titlebar-brand { flex: 0 0 auto; }
  .titlebar-brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .titlebar-brand b { font-size: .98rem; }
  .titlebar-brand span { font-size: .64rem; }
  .app-title-left .currency-panel { flex: 0 1 auto; min-width: 0; overflow: hidden; font-size: .7rem; }
  .app-title-left .currency-panel span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar { display: none; }
  .main { padding: max(18px, env(safe-area-inset-top)) 14px 22px; }
  .mobile-brand-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; margin: -4px 0 12px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 14px; background: rgba(18,26,49,.72); }
  .mobile-brand-strip img { display: block; width: 34px; height: 34px; object-fit: contain; object-position: left center; }
  .mobile-brand-strip .currency-panel { flex: 0 1 auto; min-width: 0; font-size: .7rem; overflow: hidden; }
  .mobile-brand-strip .currency-panel span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { grid-template-columns: 1fr auto; margin-bottom: 17px; align-items: center; gap: 10px; }
  .announcement-panel { grid-column: 1 / -1; order: 3; height: 36px; }
  .header-actions { min-width: 0; flex: 0 0 auto; }
  .header-actions .global-search, .header-actions .sync-chip { display: none; }
  .header-actions .btn span { display: none; }
  .currency-panel { min-height: 24px; font-size: .72rem; }
  .topbar h1 { font-size: 1.34rem; }
  .topbar .eyebrow { font-size: .65rem; }
  .sync-chip { padding: 7px; font-size: 0; }
  .sync-chip .sync-dot { width: 8px; height: 8px; }
  .summary-grid { gap: 9px; }
  .summary-card { min-height: 96px; padding: 13px; }
  .summary-card .card-value { margin-top: 8px; font-size: 1.11rem; }
  .summary-card .card-note { display: none; }
  .finance-toolbar { align-items: stretch; }
  .finance-actions, .finance-search, .period-toggle { width: 100%; }
  .finance-actions .btn { flex: 1; }
  .period-toggle button { flex: 1 1 86px; }
  .finance-chart { grid-template-columns: 1fr; min-height: 220px; }
  .finance-axis { display: none; }
  .finance-bar-pair { height: 150px; }
  .profit-card { grid-template-columns: 1fr; justify-items: center; }
  .profit-lines { width: 100%; }
  .finance-table table { min-width: 650px; }
  .desktop-table { display: none; }
  .mobile-list { display: grid; }
  .panel-card { padding: 13px; border-radius: 13px; }
  .page-tools { gap: 7px; }
  .page-tools .btn { flex: 1 1 140px; margin-left: 0; }
  .stock-summary { margin: -1px 0 13px; }
  .stock-summary-filtered { display: none; }
  .stock-summary-primary > span:last-child { display: none; }
  .stock-selected-toolbar { display: grid; gap: 9px; }
  .stock-selected-toolbar .detail-actions { width: 100%; }
  .stock-selected-toolbar .btn { flex: 1 1 130px; }
  .column-popover, .export-menu { flex: 1 1 180px; }
  .column-popover .btn, .export-menu .btn, .export-menu select { width: 100%; }
  .column-menu { left: 0; right: auto; }
  .live-finance-summary { grid-template-columns: 1fr; }
  .filter-input { min-width: 0; flex: 1 1 130px; }
  .bottom-nav { position: fixed; z-index: 20; display: flex; align-items: stretch; justify-content: space-around; gap: 1px; left: 0; right: 0; bottom: 0; min-height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(11,16,32,.96); backdrop-filter: blur(12px); }
  .bottom-nav button { flex: 1; border: 0; display: grid; place-content: center; justify-items: center; gap: 3px; min-height: 59px; color: var(--muted); background: transparent; font-size: .64rem; font-weight: 720; }
  .bottom-nav button.active { color: var(--nav-active-icon); }
  .bottom-nav i { width: 20px; height: 20px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: min(92vh, 840px); border-radius: 18px 18px 0 0; }
  .modal-body { padding: 15px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .money-field { max-width: none; }
  .currency-hero { display: grid; padding: 16px; }
  .currency-hero-rate { min-width: 0; display: grid; align-items: stretch; }
  .currency-converter-grid { grid-template-columns: 1fr; gap: 10px; }
  .form-section { grid-column: auto; }
  .modal-footer { padding: 12px 15px; }
  .modal-footer .btn { flex: 1; }
  .modal-footer .btn:first-child { margin-right: 0; }
  .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .device-session-grid { grid-template-columns: 1fr; }
  .detail-field.wide { grid-column: span 2; }
  .qr-open-hero { display: grid; }
  .qr-detail-grid { grid-template-columns: 1fr; }
  .qr-main-btn { flex-basis: 100%; }
  .login-shell { padding: 0; place-items: stretch; }
  .login-card { width: 100%; min-height: 100vh; border: 0; border-radius: 0; }
  .login-brand { padding: max(34px, env(safe-area-inset-top)) 27px 24px; }
  .login-brand-main { min-height: 58px; }
  .login-brand-mark { width: 52px; height: 52px; flex-basis: 52px; }
  .login-brand-text strong { font-size: 1.86rem; }
  .login-form { padding: 25px 27px; }
  .pause-banner { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .report-grid { grid-template-columns: 1fr; }
  .attachment-manager { padding: 12px; }
  .attachment-manager-head, .attachment-section-head { display: grid; }
  .attachment-count { justify-self: start; }
  .attachment-controls { justify-content: flex-start; }
  .attachment-select { flex: 1 1 150px; max-width: none; }
  .attachment-draft-list, .attachment-gallery { grid-template-columns: 1fr; }
  .label-workbench { grid-template-columns: 1fr; }
  .label-settings-grid, .label-mode-grid, .setting-check-grid { grid-template-columns: 1fr; }
  .label-page-actions .btn, .detail-actions .btn { flex: 1 1 150px; }
  .attachment-preview-layer { padding: 0; align-items: end; }
  .attachment-preview-layer .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .imei-captcha-layer { place-items: end center; padding: 0; }
  .imei-captcha-dialog { width: 100%; border-radius: 18px 18px 0 0; }
  .imei-captcha-footer .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, .finance-bar, .main > section, .main > .summary-grid, .main > .finance-toolbar { animation: none !important; transition: none !important; }
  html, body, .main, .nav, .modal-body, .table-wrap, .finance-chart-bars, .label-inline-preview, .attachment-large-preview { scroll-behavior: auto !important; }
}
@media print {
  body { background: white; color: black; }
  .app-titlebar, .sidebar, .topbar, .page-tools, .bottom-nav, .row-actions, .btn, .pause-banner { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .panel-card, .summary-card { color: black; box-shadow: none; border-color: #aaa; background: white; }
  .desktop-table { display: block !important; }
  table { min-width: 0; }
  th, td { color: black; }
  body.print-label .app-shell { display: none !important; }
  body.print-label #modal-root { display: block !important; }
  body.print-label .modal-backdrop { position: static; display: block; padding: 0; background: white; backdrop-filter: none; }
  body.print-label .modal { width: auto; max-height: none; overflow: visible; border: 0; box-shadow: none; background: white; }
  body.print-label .modal-head, body.print-label .modal-footer, body.print-label .label-ticket-head, body.print-label .label-mode-grid, body.print-label .label-ticket-hint { display: none !important; }
  body.print-label .modal-body { padding: 0; }
  body.print-label .label-inline-preview { display: block; padding: 0; border: 0; background: white; overflow: visible; }
  body.print-label .label-preview { width: var(--label-width, 58mm); max-width: none; margin: 0; border: 0; box-shadow: none; page-break-inside: avoid; }
  body.print-label .label-paper { width: var(--label-width, 58mm); height: var(--label-height, 40mm); max-width: none; }
}
