:root {
  --bg: #07111f;
  --sidebar: #081523;
  --panel: #0d1b2a;
  --raised: #102235;
  --border: #20364b;
  --soft-border: #172d41;
  --text: #f3f7fa;
  --muted: #8da3b8;
  --cyan: #24d7e5;
  --cyan-soft: rgba(36, 215, 229, 0.12);
  --lime: #b8f34a;
  --lime-soft: rgba(184, 243, 74, 0.12);
  --coral: #ff6b6b;
  --coral-soft: rgba(255, 107, 107, 0.12);
  --amber: #f5b942;
  --amber-soft: rgba(245, 185, 66, 0.13);
  --sidebar-width: 188px;
}

/* User-selectable visual themes */
:root[data-theme="emerald"] {
  --bg: #06110f;
  --sidebar: #071613;
  --panel: rgba(10, 30, 25, 0.84);
  --raised: rgba(16, 47, 38, 0.86);
  --border: rgba(93, 190, 145, 0.25);
  --soft-border: rgba(93, 190, 145, 0.14);
  --text: #f5fff9;
  --muted: #93b7a8;
  --cyan: #38e59d;
  --violet: #f0b84b;
  --blue: #43c7a0;
  --cyan-soft: rgba(56, 229, 157, 0.12);
  --lime: #c9f36a;
  --coral: #ff7582;
  --amber: #f6c85f;
}

:root[data-theme="sunset"] {
  --bg: #160b13;
  --sidebar: #170c18;
  --panel: rgba(39, 18, 35, 0.84);
  --raised: rgba(59, 27, 49, 0.86);
  --border: rgba(255, 150, 118, 0.25);
  --soft-border: rgba(255, 150, 118, 0.14);
  --text: #fff7f5;
  --muted: #c0a0aa;
  --cyan: #ff9c68;
  --violet: #ff6fae;
  --blue: #ef7e9a;
  --cyan-soft: rgba(255, 156, 104, 0.13);
  --lime: #f5d36b;
  --coral: #ff6685;
  --amber: #ffc25e;
}

:root[data-theme="emerald"] body {
  background:
    radial-gradient(circle at 82% -10%, rgba(240, 184, 75, 0.15), transparent 34rem),
    radial-gradient(circle at 28% 12%, rgba(56, 229, 157, 0.14), transparent 30rem),
    linear-gradient(145deg, #06110f 0%, #081913 48%, #0a1110 100%);
}

:root[data-theme="sunset"] body {
  background:
    radial-gradient(circle at 82% -10%, rgba(255, 111, 174, 0.18), transparent 34rem),
    radial-gradient(circle at 28% 12%, rgba(255, 156, 104, 0.14), transparent 30rem),
    linear-gradient(145deg, #140a12 0%, #1b0c18 48%, #100b17 100%);
}

:root[data-theme="emerald"] .nav-icon,
:root[data-theme="emerald"] .brand-mark,
:root[data-theme="emerald"] .summary-icon,
:root[data-theme="emerald"] .upload-icon {
  border-radius: 7px !important;
}

:root[data-theme="sunset"] .nav-icon,
:root[data-theme="sunset"] .brand-mark,
:root[data-theme="sunset"] .summary-icon,
:root[data-theme="sunset"] .upload-icon {
  border-radius: 50% !important;
}

.theme-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 7, 14, 0.74);
  backdrop-filter: blur(16px);
  animation: theme-fade-in 180ms ease-out both;
}

.theme-modal-backdrop.hidden { display: none; }

.theme-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-width: auto;
  scrollbar-color: var(--cyan) color-mix(in srgb, var(--panel) 88%, #000);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--raised) 92%, #000), color-mix(in srgb, var(--panel) 96%, #000));
  box-shadow: 0 35px 110px rgba(0, 0, 0, 0.48), 0 0 70px color-mix(in srgb, var(--cyan) 10%, transparent);
  animation: theme-modal-in 240ms cubic-bezier(.2,.8,.2,1) both;
}

.theme-modal::-webkit-scrollbar { width: 12px; }
.theme-modal::-webkit-scrollbar-track { background: color-mix(in srgb, var(--panel) 88%, #000); border-radius: 999px; }
.theme-modal::-webkit-scrollbar-thumb { background: linear-gradient(var(--cyan), var(--violet)); border: 3px solid color-mix(in srgb, var(--panel) 88%, #000); border-radius: 999px; }
.theme-modal::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

.theme-modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--soft-border);
}

.theme-eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.theme-modal-heading h2 { margin: 6px 0; font-size: 26px; }
.theme-modal-heading p { margin: 0; color: var(--muted); }

.theme-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--muted);
  background: var(--panel);
  font-size: 24px;
  cursor: pointer;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 22px 0;
}

.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 17px;
  color: var(--text);
  text-align: left;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.theme-option:hover { transform: translateY(-4px); border-color: var(--cyan); }
.theme-option.selected { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan-soft), 0 14px 35px rgba(0,0,0,.2); }

.theme-preview {
  position: relative;
  display: flex;
  align-items: end;
  gap: 7px;
  height: 94px;
  padding: 14px;
  overflow: hidden;
  border-radius: 13px;
}

.theme-preview::before { content: ""; position: absolute; inset: 0; opacity: .9; }
.aurora-preview::before { background: linear-gradient(135deg, #092737, #271f58); }
.emerald-preview::before { background: linear-gradient(135deg, #0b3b2c, #5b4315); }
.sunset-preview::before { background: linear-gradient(135deg, #59221c, #561d48); }
.theme-preview i { position: relative; width: 18%; border-radius: 4px 4px 2px 2px; background: rgba(255,255,255,.32); }
.theme-preview i:nth-child(1) { height: 34%; }
.theme-preview i:nth-child(2) { height: 58%; }
.theme-preview i:nth-child(3) { height: 78%; }
.theme-preview b { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.34); background: rgba(255,255,255,.13); }
.aurora-preview b { border-radius: 10px; }
.emerald-preview b { border-radius: 5px; }
.sunset-preview b { border-radius: 50%; }

.theme-option-copy { display: grid; gap: 4px; }
.theme-option-copy strong { font-size: 15px; }
.theme-option-copy small { color: var(--muted); line-height: 1.45; }
.theme-check { position: absolute; right: 20px; bottom: 20px; display: none; color: var(--cyan); font-weight: 900; }
.theme-option.selected .theme-check { display: block; }

.theme-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--soft-border);
}

.theme-modal-footer > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.theme-modal-footer > span i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.theme-modal-footer .primary-button { min-width: 110px; }

@keyframes theme-fade-in { from { opacity: 0; } }
@keyframes theme-modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

@media (max-width: 720px) {
  .theme-options { grid-template-columns: 1fr; }
  .theme-modal { max-height: calc(100vh - 28px); overflow: auto; padding: 18px; }
  .theme-preview { height: 72px; }
}

/* 2026 interactive redesign */
:root {
  --bg: #050914;
  --sidebar: #080e1c;
  --panel: rgba(13, 23, 42, 0.78);
  --raised: rgba(20, 34, 58, 0.82);
  --border: rgba(112, 150, 190, 0.22);
  --soft-border: rgba(112, 150, 190, 0.13);
  --text: #f7f9ff;
  --muted: #91a6bd;
  --cyan: #27e5f2;
  --violet: #8b7cff;
  --blue: #3c8cff;
  --cyan-soft: rgba(39, 229, 242, 0.12);
  --lime: #a8f45b;
  --coral: #ff6f87;
  --amber: #ffc85a;
  --sidebar-width: 184px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% -10%, rgba(139, 124, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 28% 12%, rgba(39, 229, 242, 0.12), transparent 30rem),
    linear-gradient(145deg, #050914 0%, #07111e 48%, #080b18 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.14;
  pointer-events: none;
  animation: ambient-drift 16s ease-in-out infinite alternate;
}

body::before {
  top: 10%;
  left: 12%;
  background: var(--cyan);
}

body::after {
  right: -8rem;
  bottom: -8rem;
  background: var(--violet);
  animation-delay: -7s;
}

.sidebar {
  margin: 10px 0 10px 10px;
  height: calc(100vh - 20px);
  border: 1px solid var(--soft-border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 19, 34, 0.96), rgba(6, 12, 25, 0.94));
  box-shadow: 18px 0 55px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background: radial-gradient(circle at 30% 0%, rgba(39, 229, 242, 0.18), transparent 72%);
  pointer-events: none;
}

.brand {
  position: relative;
  min-height: 88px;
  padding: 16px;
  border-bottom-color: var(--soft-border);
}

.brand-mark {
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(39, 229, 242, 0.2), rgba(139, 124, 255, 0.2));
  box-shadow: inset 0 0 0 1px rgba(72, 226, 240, 0.3), 0 8px 25px rgba(39, 229, 242, 0.12);
  animation: logo-breathe 4s ease-in-out infinite;
}

.sidebar nav {
  gap: 8px;
  padding: 20px 10px;
}

.sidebar nav button {
  height: 46px;
  border-radius: 12px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.sidebar nav button:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.055);
}

.sidebar nav button.active {
  border-color: rgba(39, 229, 242, 0.2);
  background: linear-gradient(100deg, rgba(39, 229, 242, 0.16), rgba(139, 124, 255, 0.08));
  box-shadow: 0 9px 28px rgba(16, 184, 205, 0.1), inset 0 0 24px rgba(39, 229, 242, 0.04);
}

.sidebar nav button.active::before {
  inset: 10px auto 10px -11px;
  width: 4px;
  box-shadow: 0 0 14px var(--cyan);
  animation: active-glow 2s ease-in-out infinite;
}

.sidebar-foot {
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(19, 36, 60, 0.82), rgba(10, 22, 39, 0.7));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.live-dot {
  animation: live-pulse 1.8s ease-out infinite;
}

.main-content {
  width: calc(100% - var(--sidebar-width) - 10px);
  margin-left: calc(var(--sidebar-width) + 10px);
  padding: 22px 24px 46px;
}

.topbar,
.branches-page-header {
  position: relative;
  padding: 12px 14px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(18, 31, 51, 0.6), rgba(9, 17, 31, 0.28));
  box-shadow: inset 0 0 0 1px rgba(131, 164, 196, 0.1);
  backdrop-filter: blur(18px);
  animation: content-rise 420ms ease-out both;
}

.topbar {
  z-index: 60;
  overflow: visible;
}

.topbar::after,
.branches-page-header::after {
  content: "";
  position: absolute;
  inset: auto 8% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(39, 229, 242, 0.55), rgba(139, 124, 255, 0.45), transparent);
}

.title-block h1,
.branches-page-header h1 {
  background: linear-gradient(100deg, #ffffff 12%, #cbeeff 55%, #c8c0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.045em;
}

.title-block {
  min-width: 360px;
  flex: 1 1 520px;
}

.device-identifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.device-identifier {
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid rgba(39, 229, 242, 0.28);
  border-radius: 12px;
  background: linear-gradient(105deg, rgba(39, 229, 242, 0.11), rgba(5, 18, 32, 0.64));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), 0 8px 22px rgba(0, 0, 0, 0.13);
}

.device-identifier.network {
  border-color: rgba(139, 124, 255, 0.34);
  background: linear-gradient(105deg, rgba(139, 124, 255, 0.13), rgba(5, 18, 32, 0.64));
}

.device-identifier-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(39, 229, 242, 0.15);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.device-identifier.network .device-identifier-icon {
  background: rgba(139, 124, 255, 0.17);
  color: #c3bcff;
}

.device-identifier-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.device-identifier-copy small {
  color: #8fa9bd;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.device-identifier-copy strong {
  overflow-wrap: anywhere;
  color: #f5fcff;
  font-family: Consolas, "SFMono-Regular", "Courier New", monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.055em;
  line-height: 1.2;
  text-shadow: 0 0 16px rgba(39, 229, 242, 0.16);
}

.device-identifier.network .device-identifier-copy strong {
  text-shadow: 0 0 16px rgba(139, 124, 255, 0.2);
}

@media (max-width: 620px) {
  .title-block {
    min-width: 0;
  }

  .device-identifier {
    min-width: 0;
    flex: 1 1 100%;
  }
}

.header-controls {
  gap: 9px;
}

.branch-select > div,
.filter-select,
.search-box {
  border-color: rgba(112, 150, 190, 0.25);
  background: rgba(5, 14, 27, 0.68);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.branch-select > div:hover,
.filter-select:hover,
.search-box:focus-within {
  border-color: rgba(39, 229, 242, 0.55);
  box-shadow: 0 0 0 3px rgba(39, 229, 242, 0.07);
  transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.danger-button {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.primary-button {
  border: 0;
  background: linear-gradient(105deg, #26dae7, #39a6f3 55%, #8676ff);
  color: #03101b;
  box-shadow: 0 10px 30px rgba(39, 207, 226, 0.2);
}

.primary-button::after,
.secondary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, 0.28), transparent 70%);
  transform: translateX(-130%);
  transition: transform 520ms ease;
}

.primary-button:hover::after,
.secondary-button:hover::after {
  transform: translateX(130%);
}

.primary-button:hover,
.secondary-button:hover:not(:disabled),
.danger-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 13px 34px rgba(24, 187, 211, 0.17);
}

.panel {
  border-color: var(--soft-border);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(17, 31, 52, 0.78), rgba(8, 18, 33, 0.82));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px);
  animation: content-rise 470ms ease-out both;
}

.summary-grid {
  gap: 11px;
  perspective: 900px;
}

.no-comparison-state {
  min-height: 230px;
  margin: 18px 0;
  padding: 34px;
  border: 1px solid rgba(56, 217, 232, 0.28);
  border-radius: 20px;
  background: radial-gradient(circle at 12% 20%, rgba(39, 209, 224, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(13, 34, 52, 0.98), rgba(15, 27, 54, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: left;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
}
.no-comparison-state.hidden { display: none; }
.no-comparison-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(39, 209, 224, 0.45);
  border-radius: 20px;
  background: rgba(39, 209, 224, 0.12);
  color: var(--cyan);
  font-size: 30px;
}
.no-comparison-state h2 { margin: 4px 0 8px; font-size: 26px; }
.no-comparison-state p { margin: 0; color: var(--muted); }
.no-comparison-state > div:nth-child(2) { flex: 1; }
.no-comparison-state > div:nth-child(2) > span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
body.no-comparison-selected .summary-grid,
body.no-comparison-selected .upload-panel,
body.no-comparison-selected .unassigned-panel,
body.no-comparison-selected .table-panel {
  display: none !important;
}

.comparison-delete-button {
  min-height: 42px;
  white-space: nowrap;
}

.comparison-library {
  margin: 16px 0;
  padding: 20px;
  border: 1px solid rgba(56, 217, 232, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 0%, rgba(39, 209, 224, 0.1), transparent 28%),
    linear-gradient(145deg, rgba(11, 29, 46, 0.97), rgba(13, 24, 47, 0.97));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

.comparison-library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.comparison-library-heading > div > span {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.comparison-library-heading h2 {
  margin: 4px 0 3px;
  font-size: 21px;
}

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

.comparison-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 11px;
}

.comparison-overview-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #263e55;
  border-radius: 12px;
  background: rgba(6, 20, 34, 0.75);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.comparison-overview-card:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 215, 229, 0.45);
  background: rgba(10, 29, 46, 0.92);
}

.comparison-overview-card.active {
  border-color: var(--cyan);
  box-shadow: inset 3px 0 var(--cyan), 0 10px 25px rgba(0, 0, 0, 0.16);
}

.comparison-overview-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(36, 215, 229, 0.35);
  border-radius: 11px;
  background: rgba(36, 215, 229, 0.11);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.comparison-overview-card[data-type="network"] .comparison-overview-icon {
  border-color: rgba(126, 108, 255, 0.42);
  background: rgba(126, 108, 255, 0.13);
  color: #afa4ff;
}

.comparison-overview-card[data-type="both"] .comparison-overview-icon {
  border-color: rgba(137, 224, 63, 0.42);
  background: rgba(137, 224, 63, 0.12);
  color: var(--lime);
}

.comparison-overview-copy { min-width: 0; }
.comparison-overview-copy h3 { margin: 0 0 5px; font-size: 14px; }
.comparison-overview-copy span {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(36, 215, 229, 0.1);
  color: #a9dfe7;
  font-size: 9px;
  font-weight: 700;
}

.comparison-overview-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.comparison-overview-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #36516a;
  border-radius: 7px;
  background: #0a1a2a;
  color: #d9e8f0;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.comparison-overview-actions button:hover {
  border-color: var(--cyan);
  color: #fff;
}

.comparison-overview-actions .comparison-card-delete {
  border-color: rgba(255, 92, 110, 0.4);
  color: #ff8996;
}

.comparison-library-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 130px;
  border: 1px dashed #31506a;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.comparison-library-empty > span { color: var(--cyan); font-size: 24px; }
.comparison-library-empty strong { color: #e4f1f6; }
.comparison-library-empty small { font-size: 10px; }

@media (max-width: 760px) {
  .comparison-library-heading { align-items: flex-start; flex-direction: column; }
  .comparison-overview-card { grid-template-columns: 42px minmax(0, 1fr); }
  .comparison-overview-actions { grid-column: 1 / -1; }
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 105px;
  border-color: var(--soft-border);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(18, 34, 57, 0.88), rgba(8, 18, 32, 0.86));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), inset 0 1px rgba(255, 255, 255, 0.03);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  animation: card-pop 460ms cubic-bezier(.2,.8,.2,1) both;
}

.summary-card:nth-child(2) { animation-delay: 45ms; }
.summary-card:nth-child(3) { animation-delay: 90ms; }
.summary-card:nth-child(4) { animation-delay: 135ms; }
.summary-card:nth-child(5) { animation-delay: 180ms; }
.summary-card:nth-child(6) { animation-delay: 225ms; }

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: currentColor;
  box-shadow: 0 0 18px currentColor;
}

.summary-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -42px;
  top: -52px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.045;
}

.summary-card:hover {
  transform: translateY(-5px) rotateX(2deg);
  border-color: rgba(117, 188, 221, 0.35);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.25), 0 0 28px rgba(39, 229, 242, 0.05);
}

.summary-icon {
  border-radius: 12px;
  animation: icon-float 3.5s ease-in-out infinite;
}

.summary-card strong {
  letter-spacing: -0.03em;
}

.upload-panel,
.table-panel,
.unassigned-panel,
.branches-panel {
  margin-top: 14px;
}

.upload-grid {
  gap: 11px;
}

.upload-card {
  position: relative;
  overflow: hidden;
  min-height: 176px;
  border: 1px dashed rgba(91, 155, 190, 0.34);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(8, 22, 38, 0.7), rgba(12, 27, 45, 0.46));
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.upload-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(39, 229, 242, 0.06), transparent 70%);
  transform: translateX(-100%);
}

.upload-card:hover {
  transform: translateY(-4px);
  border-color: rgba(39, 229, 242, 0.68);
  background: linear-gradient(145deg, rgba(12, 34, 53, 0.82), rgba(12, 27, 45, 0.55));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
}

.upload-card:hover::after {
  animation: upload-scan 1.1s ease;
}

.upload-card.ready {
  border-style: solid;
  border-color: rgba(168, 244, 91, 0.48);
  background: linear-gradient(145deg, rgba(26, 56, 43, 0.45), rgba(9, 26, 36, 0.7));
  animation: ready-arrive 420ms ease-out;
}

.file-icon {
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(168, 244, 91, 0.22), rgba(39, 229, 242, 0.13));
  box-shadow: inset 0 0 0 1px rgba(168, 244, 91, 0.32);
}

.table-panel {
  overflow: hidden;
}

.table-scroll {
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  background: rgba(4, 12, 23, 0.45);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #11253a, #0d1d30);
  color: #a9d9ef;
  box-shadow: inset 0 -1px rgba(65, 141, 177, 0.24);
}

tbody tr {
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

tbody tr:not(:has(.empty-state)):hover {
  position: relative;
  z-index: 1;
  transform: translateX(3px);
  background: linear-gradient(90deg, rgba(39, 229, 242, 0.07), rgba(139, 124, 255, 0.045));
  box-shadow: inset 3px 0 var(--cyan);
}

.statement-input,
.note-input,
.device-id-input,
.modal-card input,
.modal-card select,
.drawer-note textarea {
  border-color: rgba(95, 145, 181, 0.3);
  border-radius: 9px;
  background: rgba(4, 14, 27, 0.72);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.statement-input:focus,
.note-input:focus,
.device-id-input:focus,
.modal-card input:focus,
.drawer-note textarea:focus {
  transform: translateY(-1px);
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(39, 229, 242, 0.09), 0 8px 22px rgba(0, 0, 0, 0.14);
}

.statement-input,
.drawer-statement-input {
  font-variant-numeric: tabular-nums;
}

.statement-input::placeholder,
.drawer-statement-input::placeholder {
  color: #587087;
  font-size: 10px;
  font-weight: 500;
}

.statement-input.calculation-error,
.drawer-statement-input.calculation-error {
  border-color: var(--coral) !important;
  background: rgba(255, 111, 135, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(255, 111, 135, 0.1) !important;
  animation: calculation-shake 220ms ease both;
}

.status {
  border-radius: 999px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.branch-record {
  position: relative;
  overflow: hidden;
  border-color: var(--soft-border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(13, 29, 48, 0.78), rgba(7, 18, 31, 0.72));
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.branch-record::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--cyan), var(--violet));
  opacity: 0.75;
}

.branch-record:hover {
  transform: translateY(-3px);
  border-color: rgba(39, 229, 242, 0.28);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.branches-page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.branches-page-actions > button {
  min-height: 44px;
}

.import-branches-button {
  border-color: rgba(139, 124, 255, 0.38);
  background: linear-gradient(110deg, rgba(139, 124, 255, 0.13), rgba(39, 229, 242, 0.08));
}

.branch-import-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(168, 244, 91, 0.25);
  border-radius: 12px;
  background: linear-gradient(105deg, rgba(168, 244, 91, 0.09), rgba(39, 229, 242, 0.045));
  animation: notice-slide 300ms ease both;
}

.branch-import-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(168, 244, 91, 0.14);
  color: var(--lime);
  font-weight: 900;
  box-shadow: 0 0 20px rgba(168, 244, 91, 0.1);
}

.branch-import-summary strong,
.branch-import-summary small {
  display: block;
}

.branch-import-summary strong {
  font-size: 12px;
}

.branch-import-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.branch-import-file {
  max-width: 260px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(5, 14, 27, 0.56);
  color: #bcebf1;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-record.inactive {
  border-color: rgba(255, 111, 135, 0.18);
  background: linear-gradient(135deg, rgba(31, 25, 40, 0.62), rgba(12, 18, 29, 0.68));
}

.branch-record.inactive::before {
  background: linear-gradient(var(--coral), #725677);
  opacity: 0.62;
}

.branch-record.inactive .branch-record-icon {
  border-color: rgba(255, 111, 135, 0.22);
  background: rgba(255, 111, 135, 0.08);
  color: #ff91a3;
}

.branch-availability {
  width: max-content;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 7px 3px 4px;
  border: 1px solid rgba(168, 244, 91, 0.18);
  border-radius: 999px;
  background: rgba(168, 244, 91, 0.07);
  cursor: pointer;
}

.branch-record.inactive .branch-availability {
  border-color: rgba(255, 111, 135, 0.2);
  background: rgba(255, 111, 135, 0.07);
}

.branch-active-toggle {
  position: relative;
  width: 25px;
  height: 14px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: rgba(255, 111, 135, 0.42);
  cursor: pointer;
  transition: background 160ms ease;
}

.branch-active-toggle::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease;
}

.branch-active-toggle:checked {
  background: rgba(168, 244, 91, 0.65);
}

.branch-active-toggle:checked::before {
  transform: translateX(11px);
}

.branch-status-text {
  color: var(--lime) !important;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.branch-record.inactive .branch-status-text {
  color: #ff91a3 !important;
}

.device-editor,
.new-device-option {
  border-color: var(--soft-border);
  border-radius: 11px;
  background: rgba(4, 15, 28, 0.5);
}

.notice {
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  animation: notice-slide 330ms cubic-bezier(.2,.8,.2,1) both;
}

.modal-backdrop,
.drawer-backdrop {
  background: rgba(1, 7, 15, 0.74);
  backdrop-filter: blur(13px) saturate(120%);
}

.modal-card {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-color: rgba(85, 150, 190, 0.28);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 124, 255, 0.12), transparent 18rem),
    linear-gradient(145deg, rgba(15, 31, 51, 0.98), rgba(7, 17, 31, 0.98));
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.04);
  animation: modal-enter 360ms cubic-bezier(.18,.9,.25,1.08) both;
}

.modal-icon {
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(39, 229, 242, 0.18), rgba(139, 124, 255, 0.16));
  animation: icon-float 3.5s ease-in-out infinite;
}

.close-button,
.drawer-heading button {
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.close-button:hover,
.drawer-heading button:hover {
  transform: rotate(90deg);
  color: var(--cyan);
}

.field-label {
  display: block;
  margin: 16px 0 9px;
  color: #c5d4e3;
  font-size: 12px;
  font-weight: 700;
}

.month-field {
  position: relative;
  margin-top: 14px;
}

.month-field-label {
  margin: 0 0 8px;
}

.month-picker {
  position: relative;
  z-index: 16;
}

.month-picker-trigger {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(95, 145, 181, 0.38);
  border-radius: 13px;
  outline: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 124, 255, 0.1), transparent 45%),
    rgba(4, 14, 27, 0.76);
  color: var(--text);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.month-picker-trigger:hover,
.month-picker-trigger:focus-visible,
.month-picker-trigger.open {
  transform: translateY(-1px);
  border-color: var(--cyan);
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 124, 255, 0.16), transparent 48%),
    rgba(5, 22, 36, 0.96);
  box-shadow: 0 0 0 3px rgba(39, 229, 242, 0.08), 0 14px 34px rgba(0, 0, 0, 0.2);
}

.month-trigger-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(39, 229, 242, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(39, 229, 242, 0.16), rgba(139, 124, 255, 0.12));
  color: var(--cyan);
  font-size: 18px;
}

.month-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.month-trigger-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.month-trigger-copy strong {
  color: #f2fbff;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.month-trigger-arrow {
  margin-left: auto;
  color: #8ba5ba;
  font-size: 20px;
  transition: transform 180ms ease, color 180ms ease;
}

.month-picker-trigger.open .month-trigger-arrow {
  transform: rotate(180deg);
  color: var(--cyan);
}

.month-picker-popover {
  position: absolute;
  inset: calc(100% + 9px) 0 auto;
  z-index: 30;
  padding: 14px;
  border: 1px solid rgba(75, 164, 199, 0.36);
  border-radius: 16px;
  background:
    radial-gradient(circle at 80% 0%, rgba(139, 124, 255, 0.14), transparent 50%),
    linear-gradient(150deg, rgba(12, 29, 47, 0.99), rgba(5, 16, 29, 0.99));
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.52), inset 0 1px rgba(255, 255, 255, 0.05);
  animation: month-picker-enter 220ms cubic-bezier(.18,.9,.25,1.08) both;
}

.month-picker-heading {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid rgba(95, 145, 181, 0.18);
  text-align: center;
}

.month-picker-heading div {
  display: grid;
  gap: 2px;
}

.month-picker-heading small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.month-picker-heading strong {
  color: #f5fbff;
  font-size: 17px;
}

.month-year-button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(95, 145, 181, 0.28);
  border-radius: 10px;
  background: rgba(5, 17, 30, 0.72);
  color: #a8bed0;
  font-size: 23px;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.month-year-button:hover,
.month-year-button:focus-visible {
  transform: scale(1.06);
  border-color: var(--cyan);
  outline: 0;
  background: rgba(39, 229, 242, 0.1);
  color: var(--cyan);
}

.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 12px 0;
}

.month-option {
  position: relative;
  min-height: 50px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 3px;
  border: 1px solid rgba(95, 145, 181, 0.2);
  border-radius: 11px;
  outline: 0;
  background: rgba(5, 17, 30, 0.64);
  color: #d6e5ef;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.month-option span {
  font-size: 12px;
  font-weight: 800;
}

.month-option small {
  color: #6f8ba1;
  font-size: 8px;
  font-weight: 700;
}

.month-option:hover,
.month-option:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(39, 229, 242, 0.56);
  background: rgba(39, 229, 242, 0.08);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.month-option.current::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a8f047;
  box-shadow: 0 0 9px rgba(168, 240, 71, 0.65);
}

.month-option.selected {
  border-color: var(--cyan);
  background: linear-gradient(135deg, rgba(39, 229, 242, 0.24), rgba(139, 124, 255, 0.22));
  color: #fff;
  box-shadow: 0 0 0 2px rgba(39, 229, 242, 0.08), 0 9px 22px rgba(26, 173, 200, 0.16);
}

.month-option.selected small {
  color: #bcecf4;
}

.month-today-button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(168, 240, 71, 0.22);
  border-radius: 10px;
  background: rgba(168, 240, 71, 0.06);
  color: #c9e4d2;
  font-size: 11px;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.month-today-button span {
  color: #a8f047;
  font-size: 8px;
}

.month-today-button:hover,
.month-today-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(168, 240, 71, 0.5);
  outline: 0;
  background: rgba(168, 240, 71, 0.11);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

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

.comparison-type-card {
  position: relative;
  min-height: 108px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--soft-border);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(7, 20, 35, 0.82), rgba(13, 27, 45, 0.65));
  color: var(--text);
  text-align: left;
  transition: transform 190ms ease, border-color 190ms ease, box-shadow 190ms ease, background 190ms ease;
}

.comparison-type-card:hover {
  transform: translateY(-4px);
  border-color: rgba(39, 229, 242, 0.46);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.comparison-type-card.active {
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(39, 229, 242, 0.14), rgba(139, 124, 255, 0.1));
  box-shadow: 0 0 0 3px rgba(39, 229, 242, 0.07), 0 14px 34px rgba(26, 173, 200, 0.12);
  transform: translateY(-3px);
}

.comparison-type-card strong,
.comparison-type-card small {
  display: block;
}

.comparison-type-card strong {
  font-size: 14px;
}

.comparison-type-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.type-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(39, 229, 242, 0.13);
  color: var(--cyan);
  font-weight: 900;
}

.type-card-icon.network {
  background: rgba(139, 124, 255, 0.15);
  color: #b9b0ff;
}

.type-card-icon.both {
  background: linear-gradient(135deg, rgba(39, 229, 242, 0.16), rgba(139, 124, 255, 0.18));
  color: #d6f9ff;
  font-size: 11px;
}

.type-check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cyan);
  color: #03101b;
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 180ms ease, transform 180ms ease;
}

.comparison-type-card.active .type-check {
  opacity: 1;
  transform: scale(1);
}

.comparison-device-setup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 200, 90, 0.24);
  border-radius: 13px;
  background: rgba(255, 200, 90, 0.055);
  animation: setup-reveal 260ms ease-out both;
}

.setup-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
}

.setup-heading > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 200, 90, 0.13);
}

.setup-heading strong,
.setup-heading small {
  display: block;
}

.setup-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.detail-drawer {
  border-left-color: rgba(39, 229, 242, 0.22);
  background: linear-gradient(160deg, rgba(12, 28, 47, 0.98), rgba(5, 14, 27, 0.98));
  box-shadow: -25px 0 70px rgba(0, 0, 0, 0.4);
  animation: drawer-enter 300ms cubic-bezier(.2,.8,.2,1) both;
}

/* Custom branch switcher */
.branch-switcher {
  position: relative;
  z-index: 1;
  width: 238px;
  flex: 0 0 238px;
}

.branch-switcher.open {
  z-index: 1300;
}

.branch-switcher-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.branch-switcher-button {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(93, 142, 186, 0.34);
  border-radius: 13px;
  background:
    linear-gradient(115deg, rgba(39, 229, 242, 0.07), transparent 48%),
    rgba(5, 14, 27, 0.78);
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04), 0 8px 25px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.branch-switcher-button:hover,
.branch-switcher.open .branch-switcher-button {
  border-color: rgba(39, 229, 242, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(39, 229, 242, 0.08), 0 12px 32px rgba(0, 0, 0, 0.2);
}

.branch-switcher-avatar,
.branch-option-avatar {
  display: grid;
  place-items: center;
  border: 1px solid rgba(39, 229, 242, 0.28);
  border-radius: 10px;
  background: linear-gradient(140deg, rgba(39, 229, 242, 0.18), rgba(139, 124, 255, 0.12));
  color: #bffaff;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.branch-switcher-avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
  box-shadow: 0 5px 18px rgba(39, 229, 242, 0.1);
}

.branch-switcher-current {
  min-width: 0;
}

.branch-switcher-current strong,
.branch-switcher-current small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-switcher-current strong {
  font-size: 13px;
}

.branch-switcher-current small {
  margin-top: 2px;
  color: #76dfe8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.branch-switcher-caret {
  color: var(--muted);
  font-size: 17px;
  text-align: center;
  transition: transform 200ms ease, color 200ms ease;
}

.branch-switcher.open .branch-switcher-caret {
  color: var(--cyan);
  transform: rotate(180deg);
}

.branch-switcher-menu {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 9px);
  right: 0;
  width: 340px;
  max-height: min(480px, calc(100vh - 110px));
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(91, 148, 192, 0.3);
  border-radius: 17px;
  background:
    radial-gradient(circle at 90% 0%, rgba(139, 124, 255, 0.15), transparent 15rem),
    #07111f;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(26px);
  transform-origin: 82% 0;
  animation: branch-menu-enter 200ms cubic-bezier(.2,.8,.2,1) both;
}

.branch-switcher-menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 3px 10px;
}

.branch-switcher-menu-heading span {
  font-size: 13px;
  font-weight: 800;
}

.branch-switcher-menu-heading small {
  color: var(--muted);
  font-size: 10px;
}

.branch-switcher-search {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 9px;
  border: 1px solid rgba(110, 154, 195, 0.22);
  border-radius: 10px;
  background: rgba(3, 10, 20, 0.62);
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.branch-switcher-search:focus-within {
  border-color: rgba(39, 229, 242, 0.6);
  box-shadow: 0 0 0 3px rgba(39, 229, 242, 0.07);
}

.branch-switcher-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.branch-switcher-search input::placeholder {
  color: #60748a;
}

.branch-switcher-options {
  max-height: 275px;
  display: grid;
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(39, 229, 242, 0.35) transparent;
}

.branch-switcher-option {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  animation: branch-option-enter 220ms ease both;
  animation-delay: calc(var(--branch-index) * 24ms);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.branch-switcher-option:hover {
  border-color: rgba(39, 229, 242, 0.18);
  background: rgba(39, 229, 242, 0.065);
  transform: translateX(3px);
}

.branch-switcher-option.active {
  border-color: rgba(39, 229, 242, 0.32);
  background: linear-gradient(105deg, rgba(39, 229, 242, 0.13), rgba(139, 124, 255, 0.08));
}

.branch-option-avatar {
  width: 38px;
  height: 38px;
  font-size: 11px;
}

.branch-switcher-option.active .branch-option-avatar {
  box-shadow: 0 0 20px rgba(39, 229, 242, 0.14);
}

.branch-option-copy {
  min-width: 0;
}

.branch-option-copy > strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-option-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.branch-provider-tag {
  max-width: 100%;
  overflow: hidden;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(39, 229, 242, 0.1);
  color: #83edf4;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.branch-provider-tag.network {
  background: rgba(139, 124, 255, 0.13);
  color: #bdb5ff;
}

.branch-option-check {
  color: #587086;
  font-size: 13px;
  text-align: center;
}

.branch-switcher-option.active .branch-option-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cyan);
  color: #03131b;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(39, 229, 242, 0.3);
}

.branch-switcher-empty {
  padding: 20px 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.branch-switcher-manage {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr 18px;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(139, 124, 255, 0.18);
  border-radius: 11px;
  background: rgba(139, 124, 255, 0.07);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.branch-switcher-manage:hover {
  border-color: rgba(139, 124, 255, 0.42);
  background: rgba(139, 124, 255, 0.12);
}

.branch-switcher-manage strong,
.branch-switcher-manage small {
  display: block;
}

.branch-switcher-manage strong {
  font-size: 10px;
}

.branch-switcher-manage small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Shared dropdown component */
.unified-select {
  position: relative;
  overflow: visible;
}

.unified-select.open {
  z-index: 1500;
  border-color: rgba(39, 229, 242, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(39, 229, 242, 0.08), 0 12px 32px rgba(0, 0, 0, 0.2);
}

.unified-select-native,
.unified-select-legacy-caret {
  display: none !important;
}

.unified-select-button {
  min-width: 0;
  height: 100%;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.unified-select-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.unified-select-value {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unified-select-caret {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 16px;
  transition: transform 180ms ease, color 180ms ease;
}

.unified-select.open .unified-select-caret {
  color: var(--cyan);
  transform: rotate(180deg);
}

.unified-select-menu {
  position: absolute;
  z-index: 1600;
  top: calc(100% + 8px);
  right: -1px;
  width: max-content;
  min-width: calc(100% + 2px);
  max-width: 300px;
  max-height: 280px;
  display: grid;
  gap: 4px;
  padding: 7px;
  overflow-y: auto;
  border: 1px solid rgba(91, 148, 192, 0.34);
  border-radius: 12px;
  background: #07111f;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.05);
  transform-origin: 85% 0;
  animation: branch-menu-enter 180ms cubic-bezier(.2,.8,.2,1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(39, 229, 242, 0.34) transparent;
}

.unified-select-option {
  width: 100%;
  min-width: 155px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #d8e4ef;
  font: inherit;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  animation: branch-option-enter 190ms ease both;
  animation-delay: calc(var(--option-index) * 20ms);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.unified-select-option:hover {
  border-color: rgba(39, 229, 242, 0.18);
  background: rgba(39, 229, 242, 0.075);
  transform: translateX(2px);
}

.unified-select-option.active {
  border-color: rgba(39, 229, 242, 0.3);
  background: linear-gradient(105deg, rgba(39, 229, 242, 0.13), rgba(139, 124, 255, 0.08));
  color: #fff;
}

.unified-select-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  font-size: 10px;
}

.unified-select-option.active .unified-select-check {
  background: var(--cyan);
  color: #03131b;
  font-weight: 900;
  box-shadow: 0 0 14px rgba(39, 229, 242, 0.25);
}

.filter-select.unified-select {
  padding-right: 10px;
}

.filter-select.unified-select .unified-select-menu {
  right: auto;
  left: -1px;
  min-width: 220px;
}

@keyframes ambient-drift {
  from { transform: translate3d(-2%, -2%, 0) scale(0.95); }
  to { transform: translate3d(10%, 7%, 0) scale(1.12); }
}

@keyframes logo-breathe {
  0%, 100% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(72, 226, 240, 0.3), 0 8px 25px rgba(39, 229, 242, 0.1); }
  50% { transform: scale(1.045); box-shadow: inset 0 0 0 1px rgba(139, 124, 255, 0.45), 0 10px 32px rgba(39, 229, 242, 0.2); }
}

@keyframes active-glow {
  50% { opacity: 0.6; box-shadow: 0 0 22px var(--cyan); }
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(168, 244, 91, 0.55); }
  75%, 100% { box-shadow: 0 0 0 8px rgba(168, 244, 91, 0); }
}

@keyframes content-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-pop {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes upload-scan {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes ready-arrive {
  0% { transform: scale(0.98); }
  55% { transform: scale(1.012); }
  100% { transform: scale(1); }
}

@keyframes notice-slide {
  from { opacity: 0; transform: translateY(-10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(24px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drawer-enter {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

@keyframes branch-menu-enter {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes branch-option-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes calculation-shake {
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

@keyframes month-picker-enter {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 860px) {
  .sidebar {
    margin: 0;
    height: 100vh;
    border-radius: 0 18px 18px 0;
  }

  .main-content {
    width: 100%;
    margin-left: 0;
  }

  .comparison-type-grid {
    grid-template-columns: 1fr;
  }

  .comparison-type-card {
    min-height: 76px;
  }
}

@media (max-width: 620px) {
  .main-content {
    padding: 10px 9px 28px;
  }

  .topbar,
  .branches-page-header {
    padding: 12px;
  }

  .comparison-device-setup {
    grid-template-columns: 1fr;
  }

  .branch-switcher {
    width: 100%;
    flex: 1 1 100%;
  }

  .branch-switcher-menu {
    right: auto;
    left: 0;
    width: min(340px, calc(100vw - 18px));
  }

  .branches-page-actions {
    width: 100%;
    margin-left: 0;
  }

  .branches-page-actions > button {
    flex: 1;
  }

  .branch-import-summary {
    grid-template-columns: 38px 1fr;
  }

  .branch-import-file {
    grid-column: 1 / -1;
    max-width: none;
  }
}

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

@layer legacy {
* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 2%, rgba(36, 215, 229, 0.055), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hidden {
  display: none !important;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--soft-border);
  background: rgba(8, 21, 35, 0.98);
}

.brand {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--soft-border);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #2b445c;
  border-radius: 9px;
  background: rgba(36, 215, 229, 0.06);
  color: var(--cyan);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.brand strong {
  font-size: 14px;
}

.sidebar nav {
  display: grid;
  gap: 5px;
  padding: 16px 8px;
}

.sidebar nav button {
  position: relative;
  height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #a8b6c5;
  text-align: left;
  transition: 150ms ease-out;
  font-size: 14px;
}

.sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.sidebar nav button.active {
  border-color: rgba(36, 215, 229, 0.12);
  background: linear-gradient(90deg, rgba(36, 215, 229, 0.12), transparent);
  color: var(--cyan);
}

.sidebar nav button.active::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px -11px;
  width: 3px;
  border-radius: 3px;
  background: var(--cyan);
}

.nav-icon {
  width: 20px;
  color: currentColor;
  font-size: 16px;
  text-align: center;
}

.sidebar-foot {
  margin: 8px 10px 14px;
  padding: 11px;
  border: 1px solid var(--soft-border);
  border-radius: 9px;
  background: rgba(16, 34, 53, 0.58);
  color: #b7c4d0;
  font-size: 11px;
}

.sidebar-user {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  margin: auto 10px 0;
  padding: 10px;
  border: 1px solid var(--soft-border);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(19, 36, 60, 0.9), rgba(10, 22, 39, 0.78));
}

.sidebar-user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--cyan) 42%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--cyan) 16%, transparent);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

.sidebar-user-details {
  display: grid;
  align-content: center;
  min-width: 0;
}

.sidebar-user-details strong,
.sidebar-user-details small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-details strong { color: var(--text); font-size: 11px; }
.sidebar-user-details small { color: var(--muted); font-size: 9px; }

.sidebar-logout {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 32px;
  border: 1px solid rgba(251, 113, 133, 0.32);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.14);
  color: #fb7185;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.sidebar-logout:hover { border-color: rgba(251, 113, 133, 0.72); background: rgba(127, 29, 29, 0.3); transform: translateY(-1px); }
.sidebar-logout:disabled { cursor: wait; opacity: .65; transform: none; }

.sidebar-foot small {
  display: block;
  margin: 4px 0 0 17px;
  color: var(--muted);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(184, 243, 74, 0.5);
}

.main-content {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 20px 22px 40px;
}

body.branches-view .main-content > :not(#branchesPage) {
  display: none !important;
}

.branches-page {
  min-height: calc(100vh - 60px);
}

.branches-page-header {
  min-height: 72px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.branches-page-header h1 {
  margin: 0;
  font-size: clamp(25px, 2.2vw, 34px);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.branches-page-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.branches-page-header > .primary-button {
  min-height: 44px;
  margin-left: auto;
}

.branches-panel {
  padding: 18px;
}

.branches-heading {
  padding: 0 0 15px;
  border-bottom: 1px solid var(--soft-border);
}

.branches-heading > strong {
  margin-left: auto;
  color: var(--cyan);
  font-size: 13px;
}

.branches-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.branch-record {
  display: grid;
  grid-template-columns:
    minmax(180px, 0.75fr)
    minmax(420px, 1.5fr)
    auto;
  align-items: end;
  gap: 18px;
  padding: 15px;
  border: 1px solid var(--soft-border);
  border-radius: 9px;
  background: rgba(6, 19, 31, 0.48);
}

.branch-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.branch-record-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(36, 215, 229, 0.28);
  border-radius: 9px;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.branch-identity span,
.branch-identity strong,
.branch-identity small {
  display: block;
}

.branch-identity span,
.branch-identity small {
  color: var(--muted);
  font-size: 11px;
}

.branch-identity strong {
  margin: 3px 0;
  font-size: 16px;
}

.device-id-input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
  background: #081522;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.device-id-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(36, 215, 229, 0.08);
}

.branch-devices {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 10px;
}

.device-editor,
.new-device-option {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
}

.device-editor > span,
.new-device-option > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c8d5df;
  font-weight: 700;
}

.device-editor input[type="checkbox"],
.new-device-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--cyan);
}

.device-id-input:disabled,
.new-device-option > input:disabled {
  opacity: 0.5;
}

.new-device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.modal-card .new-device-option {
  margin-top: 0;
}

.modal-card .new-device-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  padding: 0;
}

.branch-record-actions {
  display: flex;
  gap: 7px;
}

.compact-button {
  min-height: 40px;
  white-space: nowrap;
}

.danger-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 7px;
  background: rgba(255, 107, 107, 0.08);
  color: #ff8d8d;
  font-weight: 600;
}

.danger-button:not(:disabled):hover {
  background: rgba(255, 107, 107, 0.15);
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(25px, 2.2vw, 34px);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  max-width: 780px;
}

.branch-select > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.branch-select > div {
  min-width: 210px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(13, 27, 42, 0.75);
}

.comparison-select > div {
  min-width: 190px;
}

.header-controls > .secondary-button {
  min-height: 44px;
}

.branch-select select {
  flex: 1;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.branch-select option,
.filter-select option {
  background: var(--panel);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--raised);
  color: var(--text);
}

.notice {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(184, 243, 74, 0.26);
  border-radius: 8px;
  background: var(--lime-soft);
  color: #dcff9c;
  font-size: 13px;
}

.notice.error {
  border-color: rgba(255, 107, 107, 0.28);
  background: var(--coral-soft);
  color: #ffb0b0;
}

.notice button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: currentColor;
  font-size: 20px;
}

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

.summary-card {
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 60%),
    rgba(13, 27, 42, 0.83);
}

.summary-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid;
  border-radius: 50%;
  font-size: 21px;
}

.summary-card.cyan .summary-icon {
  border-color: rgba(36, 215, 229, 0.33);
  background: var(--cyan-soft);
  color: var(--cyan);
}

.summary-card.lime .summary-icon {
  border-color: rgba(184, 243, 74, 0.3);
  background: var(--lime-soft);
  color: var(--lime);
}

.summary-card.coral .summary-icon {
  border-color: rgba(255, 107, 107, 0.32);
  background: var(--coral-soft);
  color: var(--coral);
}

.summary-card.amber .summary-icon {
  border-color: rgba(245, 185, 66, 0.35);
  background: var(--amber-soft);
  color: var(--amber);
}

.summary-card span,
.summary-card small {
  display: block;
  color: var(--muted);
}

.summary-card span {
  margin-bottom: 4px;
  font-size: 12px;
}

.summary-card strong {
  display: block;
  overflow: hidden;
  font-size: clamp(18px, 1.45vw, 24px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
}

.summary-card.coral strong {
  color: var(--coral);
}

.summary-card.amber strong {
  color: var(--amber);
}

@media (max-width: 1500px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.summary-card small {
  margin-top: 3px;
  font-size: 11px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(13, 27, 42, 0.8);
}

.upload-panel {
  margin-bottom: 14px;
  padding: 17px 18px 16px;
}

.unassigned-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-color: rgba(255, 185, 80, 0.38);
  background: rgba(83, 52, 12, 0.24);
}

.unassigned-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}

.unassigned-heading h2 {
  margin: 0;
  color: #ffc56d;
  font-size: 17px;
}

.unassigned-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.unassigned-heading > strong {
  margin-left: auto;
  color: #ffc56d;
  white-space: nowrap;
}

.unassigned-list {
  display: grid;
  gap: 7px;
}

.unassigned-item {
  display: grid;
  grid-template-columns: 110px minmax(220px, 1fr) 120px minmax(230px, 300px) 130px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 185, 80, 0.2);
  border-radius: 7px;
  background: rgba(5, 16, 27, 0.42);
}

.unassigned-item span {
  color: var(--muted);
  font-size: 12px;
}

.unassigned-item strong:last-child {
  color: #ffc56d;
  text-align: right;
}

.batch-session-select,
.batch-link-button,
.assignment-item button {
  min-height: 34px;
  border: 1px solid rgba(255, 185, 80, 0.35);
  border-radius: 6px;
  background: #0b1a28;
  color: var(--text);
  font-size: 12px;
}

.batch-session-select {
  width: 100%;
  padding: 0 9px;
}

.batch-link-button,
.assignment-item button {
  padding: 0 11px;
  color: #ffc56d;
  font-weight: 700;
}

.batch-link-button:disabled {
  opacity: 0.4;
}

.assignment-section {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 185, 80, 0.2);
}

.assignment-section h3 {
  margin: 0 0 8px;
  color: #ffc56d;
  font-size: 13px;
}

.assignment-list {
  display: grid;
  gap: 7px;
}

.assignment-item {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 130px 115px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(36, 215, 229, 0.18);
  border-radius: 7px;
  background: rgba(5, 16, 27, 0.42);
}

.assignment-item strong {
  text-align: right;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-heading > button {
  margin-left: auto;
}

.primary-button,
.secondary-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 7px;
  font-weight: 600;
  transition: 150ms ease-out;
}

.primary-button {
  border: 1px solid #36dfeb;
  background: linear-gradient(180deg, #28dce9, #19c8d6);
  color: #04101a;
}

.primary-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 26px rgba(36, 215, 229, 0.2);
}

.secondary-button {
  border: 1px solid #345069;
  background: #0b1927;
  color: #cbd6df;
}

.secondary-button:hover {
  border-color: #4b6e8b;
  background: #102437;
  color: var(--text);
}

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

.upload-card {
  min-height: 168px;
  padding: 13px;
  border: 1px dashed #2e4a63;
  border-radius: 9px;
  background: rgba(7, 17, 31, 0.35);
  transition: 150ms ease-out;
}

.upload-card:hover,
.upload-card.dragging {
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.upload-card.ready {
  border-style: solid;
  border-color: rgba(184, 243, 74, 0.3);
  background: linear-gradient(145deg, rgba(184, 243, 74, 0.045), rgba(7, 17, 31, 0.4));
}

.upload-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 243, 74, 0.28);
  border-radius: 7px;
  background: var(--lime-soft);
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
}

.upload-card h3 {
  margin: 0;
  font-size: 13px;
}

.upload-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.file-state {
  min-height: 59px;
  margin: 10px 0 7px;
}

.file-state span,
.file-state strong,
.file-state small {
  display: block;
}

.file-status {
  color: #71889d;
  font-size: 10px;
}

.ready .file-status {
  color: var(--lime);
}

.file-name {
  margin-top: 6px;
  overflow: hidden;
  color: #d9e4eb;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-rows {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.upload-card .secondary-button {
  width: 100%;
  min-height: 32px;
  font-size: 11px;
}
.upload-card-actions { display:flex; gap:8px; margin-top:auto; }
.upload-card-actions .secondary-button { flex:1; margin-top:0; }
.upload-card-actions .download-report { color:var(--accent); border-color:color-mix(in srgb, var(--accent) 55%, var(--border)); }

.table-panel {
  padding: 17px 10px 0;
}

.table-heading {
  padding: 0 7px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 7px 13px;
}

.search-box,
.filter-select {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #091725;
  color: var(--muted);
}

.search-box {
  width: min(320px, 34vw);
  padding: 0 11px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.filter-select {
  min-width: 175px;
  padding: 0 10px;
}

.filter-select select {
  flex: 1;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #c8d3dc;
  font-size: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid #33495c;
  border-radius: 7px;
  background: #091725;
  color: #9fb0bd;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: 150ms ease-out;
}

.attachment-filter-button > span {
  color: var(--cyan);
  font-size: 14px;
}

.attachment-filter-button strong {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #14283a;
  color: #dce8ef;
  font-size: 9px;
}

.attachment-filter-button:hover,
.attachment-filter-button:focus-visible {
  border-color: rgba(36, 215, 229, 0.6);
  outline: 0;
  color: #e7f8fb;
}

.attachment-filter-button.active {
  border-color: rgba(255, 188, 67, 0.62);
  background: rgba(255, 188, 67, 0.1);
  color: #ffd27d;
  box-shadow: inset 0 0 0 1px rgba(255, 188, 67, 0.08);
}

.attachment-filter-button.active > span {
  color: #ffbc43;
}

.attachment-filter-button.active strong {
  background: rgba(255, 188, 67, 0.18);
  color: #ffd27d;
}

.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 1px solid #3d5267;
  border-radius: 999px;
  background: #101e2d;
}

.toggle span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #9aabba;
  transition: 150ms ease-out;
}

.toggle.on {
  border-color: rgba(36, 215, 229, 0.55);
  background: rgba(36, 215, 229, 0.17);
}

.toggle.on span {
  left: 19px;
  background: var(--cyan);
}

.difference-filter {
  position: relative;
  margin-left: auto;
}

.difference-filter-button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.difference-filter-button:hover,
.difference-filter-button.active {
  border-color: color-mix(in srgb, var(--cyan) 55%, var(--border));
  color: var(--text);
  background: var(--cyan-soft);
}

.difference-filter-icon {
  color: var(--cyan);
  font-size: 16px;
  font-weight: 800;
}

.difference-filter-button strong {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--bg);
  background: var(--cyan);
  font-size: 10px;
}

.difference-filter-caret {
  margin-left: 2px;
  font-size: 11px;
}

.difference-filter-menu {
  position: absolute;
  z-index: 180;
  top: calc(100% + 8px);
  right: 0;
  width: 285px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--raised) 96%, #000);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.difference-filter-menu.hidden {
  display: none;
}

.difference-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px 9px;
}

.difference-filter-heading strong {
  font-size: 12px;
}

.difference-filter-heading button {
  border: 0;
  color: var(--cyan);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.difference-filter-menu > label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 9px;
  border-radius: 9px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.difference-filter-menu > label:hover {
  background: var(--cyan-soft);
}

.difference-filter-menu input {
  width: 17px;
  height: 17px;
  accent-color: var(--cyan);
}

.difference-filter-menu > small {
  display: block;
  padding: 8px 9px 3px;
  border-top: 1px solid var(--soft-border);
  color: var(--muted);
  line-height: 1.45;
}

.table-panel {
  overflow: visible;
}

.table-scroll {
  overflow: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

table {
  width: max(100%, 1530px);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

th,
td {
  min-width: 120px;
  height: 46px;
  padding: 8px 11px;
  border-right: 1px solid var(--soft-border);
  border-bottom: 1px solid var(--soft-border);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #0b1d2d;
  color: #a8bbca;
  font-size: 11px;
  font-weight: 600;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 190px;
  min-width: 190px;
  background: #0d1d2c;
}

th:first-child {
  z-index: 4;
  background: #0b1d2d;
}

th:nth-child(2),
td:nth-child(2) {
  width: 98px;
  min-width: 98px;
}

th:nth-child(5),
td:nth-child(5),
th:nth-child(7),
td:nth-child(7),
th:nth-child(11),
td:nth-child(11) {
  width: 86px;
  min-width: 86px;
  padding-inline: 7px;
}

th:nth-child(5),
th:nth-child(7),
th:nth-child(11) {
  line-height: 1.15;
  white-space: normal;
}

tbody tr:hover td {
  background-color: rgba(36, 215, 229, 0.025);
}

.session-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #d8e4ec;
  font-weight: 600;
}

.session-link:hover {
  color: var(--cyan);
}

.session-cell-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.session-cell-layout .session-link {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-files-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 72px;
  height: 27px;
  padding: 0 7px;
  border: 1px solid #31485c;
  border-radius: 7px;
  background: #081725;
  color: #91a7b8;
  font: inherit;
  cursor: pointer;
  transition: 150ms ease-out;
}

.session-files-button em {
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.session-files-button span {
  color: var(--cyan);
  font-size: 14px;
  line-height: 1;
}

.session-files-button strong {
  min-width: 9px;
  font-size: 10px;
  font-weight: 700;
}

.session-files-button:hover,
.session-files-button:focus-visible {
  border-color: rgba(36, 215, 229, 0.72);
  outline: 0;
  background: rgba(36, 215, 229, 0.1);
  color: #eafcff;
  transform: translateY(-1px);
}

.session-files-button.has-files {
  border-color: rgba(137, 224, 63, 0.42);
  background: rgba(137, 224, 63, 0.09);
  color: #dfffc5;
}

.session-files-button.has-files span {
  color: var(--lime);
}

.amount,
.negative {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.negative {
  color: var(--coral);
}

.positive {
  color: #4ade80;
}

.statement-input,
.note-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #35506a;
  border-radius: 5px;
  outline: 0;
  background: #081522;
  color: var(--text);
  font-size: 12px;
}

.statement-input {
  min-width: 120px;
  text-align: right;
}

.note-input {
  min-width: 145px;
}

.statement-input:focus,
.note-input:focus,
.modal-card input:focus,
.modal-card select:focus,
.drawer-note textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(36, 215, 229, 0.13);
}

.status {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.status-matched {
  border-color: rgba(184, 243, 74, 0.32);
  background: var(--lime-soft);
  color: var(--lime);
}

.status-difference {
  border-color: rgba(255, 107, 107, 0.36);
  background: var(--coral-soft);
  color: #ff8c8c;
}

.status-missing-statement,
.status-missing-data {
  border-color: rgba(245, 185, 66, 0.35);
  background: var(--amber-soft);
  color: var(--amber);
}

.status-in-progress {
  border-color: rgba(36, 215, 229, 0.3);
  background: var(--cyan-soft);
  color: var(--cyan);
}

.empty-state {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #71879a;
}

.empty-icon {
  font-size: 28px;
}

.empty-state strong {
  margin: 10px 0 4px;
  color: #b2c0cb;
  font-size: 13px;
}

.empty-state > span:last-child {
  font-size: 11px;
}

.table-footer {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: var(--muted);
  font-size: 10px;
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 8, 15, 0.72);
  backdrop-filter: blur(5px);
}

.modal-backdrop {
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  padding: 27px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0c1b2a;
}

.close-button {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #0a1825;
  color: var(--muted);
  font-size: 20px;
}

.modal-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(36, 215, 229, 0.3);
  border-radius: 9px;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.modal-card h2 {
  margin: 17px 0 6px;
}

.modal-card p {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 12px;
}

.modal-card label {
  display: grid;
  gap: 7px;
  color: #b9c7d1;
  font-size: 11px;
}

.modal-card label + label {
  margin-top: 13px;
}

.modal-card input,
.modal-card select,
.drawer-note textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
  background: #081522;
  color: var(--text);
}

.modal-card input,
.modal-card select {
  height: 42px;
  padding: 0 11px;
}

.modal-card select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7990a5 50%),
    linear-gradient(135deg, #7990a5 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 18px,
    calc(100% - 12px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.modal-card select option {
  background: var(--panel);
}

.modal-action {
  width: 100%;
  margin-top: 16px;
}

.drawer-backdrop {
  display: flex;
  justify-content: flex-end;
}

.detail-drawer {
  width: min(440px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 22px;
  border-left: 1px solid var(--border);
  background: #091725;
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from {
    transform: translateX(28px);
    opacity: 0.6;
  }
}

.drawer-heading {
  display: flex;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--soft-border);
}

.drawer-heading span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.drawer-heading h2 {
  margin: 5px 0 0;
  font-size: 21px;
}

.drawer-heading button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--raised);
  color: var(--muted);
  font-size: 20px;
}

.date-window {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 15px;
  border: 1px solid rgba(36, 215, 229, 0.2);
  border-radius: 9px;
  background: var(--cyan-soft);
}

.date-icon {
  color: var(--cyan);
  font-size: 22px;
}

.date-window span,
.date-window strong,
.date-window small {
  display: block;
}

.date-window span {
  color: #8db6c0;
  font-size: 10px;
}

.date-window strong {
  margin-top: 4px;
  font-size: 12px;
}

.date-window small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.detail-item {
  padding: 13px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: var(--panel);
}

.detail-item span,
.detail-item small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.detail-item strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 15px;
}

.drawer-statement-input {
  width: 100%;
  height: 36px;
  margin: 7px 0 4px;
  padding: 0 9px;
  border: 1px solid rgba(36, 215, 229, 0.42);
  border-radius: 6px;
  outline: 0;
  background: #071522;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.drawer-statement-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(36, 215, 229, 0.13);
}

.source-counts {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--soft-border);
  border-radius: 9px;
  background: var(--panel);
}

.source-counts h3 {
  margin: 0 0 9px;
  font-size: 13px;
}

.source-counts div {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-top: 1px solid var(--soft-border);
  color: var(--muted);
  font-size: 11px;
}

.source-counts strong {
  color: var(--text);
}

.drawer-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  align-items: start;
  gap: 14px;
  margin-top: 18px;
}

.drawer-main-grid .detail-grid {
  margin-top: 0;
}

.session-files {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--soft-border);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(36, 215, 229, 0.055), transparent 46%),
    var(--panel);
}

.attachment-preview-backdrop {
  position: fixed;
  inset: 0 440px 0 0;
  z-index: 90;
  display: block;
  padding: 14px;
  background: rgba(1, 8, 15, 0.94);
  backdrop-filter: blur(3px);
}

.attachment-preview-backdrop.hidden { display: none; }

.attachment-preview {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(36, 215, 229, 0.35);
  border-radius: 16px;
  background: #071522;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.attachment-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 7px 12px;
  overflow-x: auto;
  border-bottom: 1px solid #233b50;
  background: #081827;
}

.attachment-editor-toolbar button {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #294861;
  border-radius: 7px;
  background: #0b2133;
  color: #d8e8ef;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.attachment-editor-toolbar button:hover,
.attachment-editor-toolbar button.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(36, 215, 229, 0.11);
}

.attachment-editor-toolbar .primary-tool {
  border-color: rgba(36, 215, 229, 0.55);
  background: linear-gradient(135deg, #1fc8d8, #7771f5);
  color: #031018;
}

.attachment-editor-toolbar strong {
  min-width: 48px;
  color: #9eb5c3;
  font-size: 10px;
  text-align: center;
}

.highlight-settings,
.highlight-colors,
.highlight-custom,
.highlight-opacity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.attachment-editor-toolbar .highlight-swatch {
  width: 21px;
  min-width: 21px;
  height: 21px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  background: var(--swatch);
}

.attachment-editor-toolbar .highlight-swatch:hover,
.attachment-editor-toolbar .highlight-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--cyan);
  background: var(--swatch);
}

.highlight-custom,
.highlight-opacity {
  color: #9eb5c3;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.highlight-custom input[type="color"] {
  width: 29px;
  height: 25px;
  padding: 2px;
  border: 1px solid #35566e;
  border-radius: 6px;
  background: #0b2133;
  cursor: pointer;
}

.highlight-opacity input[type="range"] {
  width: 72px;
  accent-color: var(--cyan);
}

.highlight-opacity output {
  min-width: 29px;
  color: #d8e8ef;
  font-size: 10px;
}

.toolbar-divider { width: 1px; height: 24px; flex: 0 0 1px; background: #294055; }
.toolbar-spacer { flex: 1 0 12px; }
.attachment-editor-toolbar.pdf-mode .image-tool { display: none; }

.attachment-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid #233b50;
  background: #0b1d2e;
}

.attachment-preview-heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.attachment-preview-heading span {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.attachment-preview-heading strong {
  overflow: hidden;
  color: #eef8fb;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-heading button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid #31506a;
  border-radius: 9px;
  background: #0a1a29;
  color: #dcebf2;
  font-size: 21px;
  cursor: pointer;
}

.attachment-preview-content {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  background: #020b13;
}

.attachment-preview-content iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.attachment-preview-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.attachment-preview-content canvas {
  display: block;
  max-width: none;
  height: auto;
  margin: auto;
  background: #fff;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
  touch-action: none;
}

.attachment-preview-content.highlight-mode canvas {
  cursor: crosshair;
}

@media (max-width: 800px) {
  .attachment-preview-backdrop {
    inset: 0;
    z-index: 1400;
    padding: 8px;
  }

  .attachment-preview {
    border-radius: 10px;
  }
}

.session-files-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.session-files-heading > div {
  display: grid;
  gap: 3px;
}

.session-files-heading span {
  color: #b9c9d5;
  font-size: 12px;
  font-weight: 700;
}

.session-files-heading strong {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 600;
}

.session-add-files {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 102px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(115deg, var(--cyan), #7b6cff);
  color: #03131e;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: 150ms ease-out;
}

.session-add-files:hover,
.session-add-files:focus-visible {
  outline: 0;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.session-add-files:disabled,
.session-add-files.busy {
  cursor: wait;
  filter: saturate(0.5);
  opacity: 0.65;
}

.session-file-dropzone {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 88px;
  margin-top: 12px;
  padding: 13px;
  border: 1px dashed #31516a;
  border-radius: 9px;
  outline: 0;
  background: rgba(4, 17, 29, 0.58);
  text-align: center;
  cursor: pointer;
  transition: 150ms ease-out;
}

.session-file-dropzone:hover,
.session-file-dropzone:focus-visible,
.session-file-dropzone.dragging {
  border-color: var(--cyan);
  background: rgba(36, 215, 229, 0.09);
  box-shadow: inset 0 0 0 1px rgba(36, 215, 229, 0.1);
}

.session-file-drop-icon {
  color: var(--cyan);
  font-size: 21px;
  line-height: 1;
}

.session-file-dropzone strong {
  color: #dcebf3;
  font-size: 11px;
}

.session-file-dropzone small {
  color: var(--muted);
  font-size: 9px;
}

.session-files-list {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.session-file-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: #081725;
  transition: 140ms ease-out;
  cursor: pointer;
}

.session-file-item:hover {
  border-color: rgba(36, 215, 229, 0.3);
  background: #0a1b2a;
}

.session-file-item:focus-visible {
  border-color: var(--cyan);
  outline: 2px solid rgba(36, 215, 229, 0.2);
}

@media (max-width: 760px) {
  .drawer-main-grid { grid-template-columns: 1fr; }
}

.session-file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  border: 1px solid rgba(36, 215, 229, 0.25);
  border-radius: 7px;
  background: rgba(36, 215, 229, 0.09);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
}

.session-file-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.session-file-copy strong,
.session-file-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-file-copy strong {
  color: #dce8f0;
  font-size: 11px;
}

.session-file-copy small {
  color: var(--muted);
  font-size: 9px;
}

.session-file-actions {
  display: flex;
  gap: 5px;
}

.session-file-action {
  display: grid;
  place-items: center;
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  border: 1px solid #31485c;
  border-radius: 6px;
  background: #0c1d2d;
  color: #bdd0dc;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.session-file-action:hover,
.session-file-action:focus-visible {
  border-color: var(--cyan);
  outline: 0;
  color: #fff;
}

.session-file-action.delete:hover,
.session-file-action.delete:focus-visible {
  border-color: rgba(255, 94, 118, 0.7);
  background: rgba(255, 94, 118, 0.1);
  color: var(--coral);
}

.session-files-empty,
.session-files-loading {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 74px;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.session-files-empty > span {
  color: #557087;
  font-size: 19px;
}

.session-files-empty strong {
  color: #c2d2dc;
  font-size: 10px;
}

.session-files-empty small,
.session-files-loading {
  font-size: 9px;
}

.drawer-note {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #b8c6d1;
  font-size: 11px;
}

.drawer-note textarea {
  resize: vertical;
  padding: 10px;
}

@media (max-width: 1180px) {
  .summary-grid,
  .upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .branch-record {
    grid-template-columns: minmax(180px, 0.65fr) minmax(380px, 1.35fr);
  }

  .branch-record-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-102%);
    transition: 180ms ease-out;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    width: 100%;
    margin-left: 0;
    padding: 18px 15px 30px;
  }

  .menu-button {
    display: block;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .branches-page-header {
    align-items: center;
  }

  .header-controls {
    width: 100%;
    max-width: none;
    margin-left: 62px;
  }
}

@media (max-width: 620px) {
  .main-content {
    padding-inline: 10px;
  }

  .header-controls {
    margin-left: 0;
  }

  .branches-page-header {
    flex-wrap: wrap;
  }

  .branches-page-header > .primary-button {
    width: 100%;
    margin-left: 0;
  }

  .branch-record {
    grid-template-columns: 1fr;
  }

  .branch-devices,
  .new-device-grid {
    grid-template-columns: 1fr;
  }

  .branch-record-actions {
    grid-column: auto;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .branch-record-actions button {
    flex: 1 1 130px;
  }

  .branch-select {
    flex: 1;
  }

  .header-controls {
    justify-content: stretch;
  }

  .header-controls > .secondary-button {
    flex: 1 1 150px;
  }

  .branch-select > div {
    min-width: 0;
  }

  .summary-grid,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading > button {
    margin-left: 0;
  }

  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box,
  .filter-select {
    width: 100%;
  }

  .attachment-filter-button {
    width: 100%;
    margin-left: 0;
  }

  .toggle-row {
    margin-left: 0;
  }
}
}
.report-tabs {
  display: flex;
  gap: 10px;
  margin: 14px 0;
  padding: 6px;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(8, 23, 39, 0.72);
}

.report-tab {
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  min-width: 220px;
  padding: 10px 14px;
  color: var(--muted);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.report-tab > span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--accent);
  font-size: 20px;
}

.report-tab strong { color: var(--text); font-size: 13px; }
.report-tab small { font-size: 10px; }
.report-tab.active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 10%, transparent);
}

.cash-deposits-panel { margin-top: 0; }
.bank-upload-grid { margin: 16px 0 18px; }
.bank-upload-card { min-height: 150px; }
.bank-upload-card .file-icon { font-size: 10px; }
.deposit-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--muted);
}
.deposit-summary strong { color: var(--accent); }
.cash-deposit-table { min-width: 1180px; }
.cash-deposit-table th:nth-child(n+3):nth-child(-n+9),
.cash-deposit-table td:nth-child(n+3):nth-child(-n+9) { text-align: right; }
.status-badge.deposit-deposited { color: #9bf232; border-color: rgba(155,242,50,.45); background: rgba(155,242,50,.12); }
.status-badge.deposit-partial-deposit { color: #ffbd45; border-color: rgba(255,189,69,.45); background: rgba(255,189,69,.12); }
.status-badge.deposit-over-deposited { color: #46e0c1; border-color: rgba(70,224,193,.45); background: rgba(70,224,193,.12); }
.status-badge.deposit-not-deposited { color: #ff6b7d; border-color: rgba(255,107,125,.45); background: rgba(255,107,125,.12); }

@media (max-width: 760px) {
  .report-tabs { width: 100%; }
  .report-tab { min-width: 0; flex: 1; }
  .deposit-summary { align-items: flex-start; }
}
.odoo-sync-nav { margin-top: 8px; color: var(--accent) !important; border-color: color-mix(in srgb, var(--accent) 35%, transparent) !important; }
.odoo-sync-nav.syncing .nav-icon { animation: odoo-spin .8s linear infinite; }
@keyframes odoo-spin { to { transform: rotate(360deg); } }
.odoo-settings-card { margin-top: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(8,23,39,.58); }
.odoo-settings-card h3 { margin: 5px 0; }
.odoo-settings-card p, .odoo-settings-card small { color: var(--muted); }
.odoo-settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:14px 0; }
.odoo-settings-grid label { display:grid; gap:6px; color:var(--muted); font-size:11px; }
.odoo-settings-grid input { width:100%; padding:11px; border:1px solid var(--border); border-radius:10px; background:var(--input-bg); color:var(--text); }
.odoo-settings-note { display:flex; gap:9px; padding:10px; border-radius:10px; color:var(--muted); background:rgba(28,211,225,.07); font-size:11px; }
.odoo-settings-actions { display:flex; justify-content:flex-end; gap:10px; margin:14px 0 8px; }
.odoo-settings-card #odooSettingsStatus { display:block; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:rgba(8,23,39,.58); }
.odoo-settings-card #odooSettingsStatus[data-state="pending"] { color:var(--muted); }
.odoo-settings-card #odooSettingsStatus[data-state="success"] { color:#9ef46c; border-color:rgba(158,244,108,.42); background:rgba(95,190,46,.1); }
.odoo-settings-card #odooSettingsStatus[data-state="error"] { color:#ff8b98; border-color:rgba(255,83,102,.45); background:rgba(255,83,102,.1); }
@media (max-width:760px){.odoo-settings-grid{grid-template-columns:1fr}}
/* Hosted authentication */
.auth-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 20%,rgba(34,211,238,.18),transparent 32%),radial-gradient(circle at 80% 80%,rgba(139,92,246,.18),transparent 34%),#06131f;color:#eef8ff;font-family:Inter,Segoe UI,sans-serif}
.auth-card{width:min(440px,100%);padding:34px;border:1px solid rgba(103,232,249,.24);border-radius:24px;background:rgba(9,27,43,.94);box-shadow:0 28px 80px rgba(0,0,0,.45)}
.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:30px}.auth-brand>span{display:grid;place-items:center;width:54px;height:54px;border-radius:16px;background:linear-gradient(135deg,#22d3ee,#7c3aed);font-weight:900}.auth-brand div{display:grid}.auth-brand strong{font-size:18px}.auth-brand small{color:#8faabd}
.auth-eyebrow{color:#22d3ee;font-size:11px;font-weight:900;letter-spacing:.15em}.auth-card h1{margin:9px 0 8px;font-size:30px}.auth-card>p{margin:0 0 24px;color:#9bb3c5;line-height:1.6}
.auth-card form{display:grid;gap:15px}.auth-card label{display:grid;gap:7px;color:#b8cad7;font-size:13px;font-weight:700}.auth-card input{height:48px;padding:0 14px;border:1px solid #29465c;border-radius:11px;background:#071827;color:#fff;outline:0}.auth-card input:focus{border-color:#22d3ee;box-shadow:0 0 0 3px rgba(34,211,238,.12)}
.auth-submit{height:50px;border:0;border-radius:12px;background:linear-gradient(90deg,#22d3ee,#8b5cf6);font-weight:900;font-size:15px;cursor:pointer}.auth-submit:disabled{opacity:.65}.auth-error{display:none;padding:10px 12px;border:1px solid rgba(251,113,133,.4);border-radius:9px;color:#fb7185;background:rgba(127,29,29,.18);font-size:13px}.auth-error.visible{display:block}.auth-security{display:block;margin-top:20px;color:#7592a7;text-align:center}
.system-user-list{display:grid;gap:8px;margin-top:14px}.system-user-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:rgba(5,18,30,.35)}.system-user-row>div:first-child{display:grid;gap:3px;min-width:0}.system-user-row strong,.system-user-row small{overflow-wrap:anywhere}.system-user-row small{color:var(--muted)}.system-user-actions{display:flex!important;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto}.system-user-actions button{min-width:76px}
@media (max-width:620px){.system-user-row{align-items:flex-start;flex-direction:column}.system-user-actions{width:100%;justify-content:stretch}.system-user-actions button{flex:1}}
