
:root { color-scheme: light dark; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: #0b1020; color: #e5e7eb; }
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 18px;
  background: #111827;
  border-bottom: 1px solid #1f2937;
}
.app-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-topbar-right { display: flex; align-items: center; gap: 12px; }
.app-title { font-size: 14px; font-weight: 600; color: #dbeafe; letter-spacing: .01em; }
.app-topbar-user { font-size: 13px; }
.shell-body { display: grid; grid-template-columns: 260px 1fr; flex: 1; min-height: 0; }
.sidebar { border-right: 1px solid #1f2937; padding: 16px; background: #111827; position: sticky; top: 0; max-height: calc(100vh - 58px); overflow: auto; }
.content-shell { padding: 16px 20px 28px; min-width: 0; }
.content { padding: 0; max-width: 1480px; }
.section-rail { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.section-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #243244; background: #0b1220; color: #cbd5e1; text-decoration: none; border-radius: 999px; padding: 7px 11px; font-size: 12px; }
.section-chip:hover { border-color: #3b82f6; color: #dbeafe; background: rgba(30,64,175,.2); }
.section-chip.active { border-color: #3b82f6; background: rgba(30,64,175,.35); color: #dbeafe; }
.card { background: #111827; border: 1px solid #1f2937; border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 4px 18px rgba(2, 6, 23, .18); }
.card h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.25; color: #f8fafc; }
.muted { color: #9ca3af; font-size: 13px; }
.sidebar-brand { text-align: center; margin-bottom: 14px; display: block; text-decoration: none; color: inherit; }
.sidebar-brand:hover { opacity: .95; }
.sidebar-brand-logo { display: block; max-width: 148px; width: 100%; height: auto; margin: 0 auto 10px; }
.brand { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.nav-section { margin-bottom: 14px; }
.nav-title { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.nav-links a { color: #cbd5e1; display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: 13px; line-height: 1.3; }
.nav-links a:hover { color: #60a5fa; background: rgba(59,130,246,.15); }
.nav-links a.active { background: rgba(59,130,246,.2); color: #93c5fd; }
.logout-btn { background: #1f2937; color: #e5e7eb; border: 1px solid #334155; padding: 8px 14px; }
.logout-btn:hover { background: #334155; color: #f8fafc; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid #1f2937; text-align: left; padding: 9px 10px; vertical-align: top; }
thead th { position: sticky; top: 0; background: #0f172a; z-index: 1; }
tbody tr:nth-child(2n) td { background: rgba(15, 23, 42, .32); }
tbody tr:hover td { background: rgba(30, 64, 175, .18); }
.table-wrap { overflow: auto; border: 1px solid #1f2937; border-radius: 10px; }
button { background: #2563eb; border: 0; color: white; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 8px; background: #1f2937; font-size: 12px; }
.pill-ok { background: #14532d; color: #bbf7d0; }
.pill-off { background: #451a1a; color: #fecaca; }
.pill-internal { background: #1e3a5f; color: #93c5fd; }
.product-card-badge { display: block; margin-top: 6px; }
.product-card-commercial { display: block; font-size: 12px; line-height: 1.45; color: #cbd5e1; margin-top: 4px; }
.product-commercial-strip { margin: 0 0 14px; }
.catalog-report h1 { font-size: 1.25rem; margin: 0 0 8px; color: #f8fafc; }
.catalog-report h2 { font-size: 1rem; margin: 22px 0 10px; color: #e2e8f0; }
.catalog-report .meta { font-size: 0.88rem; color: #94a3b8; margin-bottom: 16px; line-height: 1.5; }
.catalog-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.catalog-table th, .catalog-table td { border: 1px solid #334155; padding: 8px 10px; vertical-align: top; color: #e2e8f0; }
.catalog-table th { background: #111827; text-align: left; color: #cbd5e1; }
.catalog-table.notes td { font-size: 11px; color: #94a3b8; }
.catalog-report a { color: #93c5fd; }
.catalog-selector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.catalog-selector-card { background: #0b1220; border: 1px solid #334155; border-radius: 12px; padding: 12px; cursor: pointer; user-select: none; }
.catalog-selector-card.active { border-color: #2563eb; box-shadow: 0 0 0 1px rgba(37,99,235,.35); background: rgba(30,64,175,.15); }
.catalog-selector-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.catalog-selector-title { font-size: 13px; color: #f8fafc; font-weight: 600; margin: 0; }
.catalog-selector-line { font-size: 12px; color: #9ca3af; margin: 0; line-height: 1.4; }
@media print {
  .app-topbar, .sidebar, .section-rail, .catalog-no-print { display: none !important; }
  .shell-body { display: block !important; }
  .content-shell, main.content { max-width: none !important; padding: 0 !important; }
  body { background: #fff !important; color: #111 !important; }
  .card { border: none !important; box-shadow: none !important; background: #fff !important; }
  .catalog-report h1, .catalog-report h2, .catalog-report .meta { color: #111 !important; }
  .catalog-table th, .catalog-table td { color: #111 !important; border-color: #ccc !important; }
  .catalog-table th { background: #f3f4f6 !important; }
}
.auth-loading { display: none; min-height: 100vh; align-items: center; justify-content: center; color: #94a3b8; }
.auth-pending .shell { display: none; }
.auth-pending .auth-loading { display: flex; }
.auth-layout { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #0f172a; }
.auth-panel { width: 100%; max-width: 440px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head img { height: 48px; margin: 0 auto 12px; display: block; }
.auth-head h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.auth-head p { margin: 8px 0 0; color: #9ca3af; }
.auth-card { width: 100%; background: #111827; border: 1px solid #1f2937; border-radius: 14px; padding: 20px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.auth-alert { border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.auth-alert.warn { background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .35); color: #fde68a; }
.auth-alert.error { background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .35); color: #fecaca; }
.auth-field { margin-top: 12px; }
.auth-field label { display: block; font-size: 13px; color: #cbd5e1; margin-bottom: 6px; }
.auth-field input { width: 100%; box-sizing: border-box; background: #0b1220; border: 1px solid #243244; color: #f8fafc; border-radius: 8px; padding: 10px 12px; }
.auth-error { color: #ef4444; min-height: 22px; margin-top: 10px; font-size: 13px; }
.auth-2fa { margin-top: 14px; border-radius: 10px; border: 1px solid #1d4ed8; background: rgba(37,99,235,.12); padding: 12px; display: none; }
.auth-2fa.show { display: block; }
.auth-2fa p { margin: 0 0 10px; color: #bfdbfe; font-size: 13px; }
.auth-2fa .split { text-align: center; font-size: 12px; color: #93c5fd; margin: 10px 0; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}
.nav-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  box-sizing: border-box;
  background: linear-gradient(165deg, rgba(17, 24, 39, 0.92) 0%, rgba(11, 18, 32, 0.98) 100%);
  border: 1px solid rgba(51, 65, 85, 0.9);
  border-radius: 16px;
  padding: 22px 22px 20px;
  text-decoration: none;
  color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.nav-icon { font-size: 22px; margin-right: 10px; vertical-align: -3px; }
.nav-card strong {
  display: block;
  margin: 0;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.nav-card strong + span {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}
.nav-card:hover {
  border-color: rgba(59, 130, 246, 0.75);
  background: linear-gradient(165deg, rgba(30, 58, 138, 0.38) 0%, rgba(11, 18, 32, 0.98) 100%);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.45), 0 0 0 1px rgba(59, 130, 246, 0.18);
  transform: translateY(-3px);
}
.nav-card:active { transform: translateY(-1px); }
.nav-card:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 3px;
}
.nav-card-dns .dns-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-card-dns .dns-card-logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.nav-card-dns .dns-card-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.nav-card-dns strong {
  flex: 1;
  min-width: 0;
}
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.inline-form input, .inline-form select { background: #0b1220; border: 1px solid #243244; color: #f8fafc; border-radius: 8px; padding: 8px 10px; }
.inline-edit-row td { background: #0a0f18; vertical-align: top; }
.inline-edit-panel { padding: 14px 16px; border-radius: 10px; border: 1px solid #334155; margin: 6px 0 10px; }
.inline-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.inline-edit-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #94a3b8; }
.inline-edit-field input, .inline-edit-field select, .inline-edit-field textarea { background: #0b1220; border: 1px solid #243244; color: #f8fafc; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.inline-edit-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
button.inline-cancel { background: #4b5563; }
tfoot.receipt-sum td { border-top: 1px solid #334155; background: rgba(15,23,42,.72); font-weight: 600; }
a.action-link { display: inline-block; background: #2563eb; color: #fff; text-decoration: none; border-radius: 8px; padding: 8px 12px; font-size: 14px; border: 0; cursor: pointer; }
a.action-link:hover { filter: brightness(1.08); }
.toggle-switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; inset: 0; background: #334155; border-radius: 999px; transition: .18s ease; border: 1px solid #475569; }
.toggle-slider:before { content: ''; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px; border-radius: 50%; background: #e2e8f0; transition: .18s ease; }
.toggle-switch input:checked + .toggle-slider { background: #1d4ed8; border-color: #2563eb; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); background: #fff; }
.product-toggle-card { border: 1px solid #25334a; border-radius: 12px; padding: 10px 12px; background: #0b1220; }
.product-toggle-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.json-details { margin-top: 12px; border: 1px solid #25334a; border-radius: 10px; background: #0b1220; }
.json-details summary { cursor: pointer; padding: 9px 12px; color: #bfdbfe; font-size: 12px; }
.json-details pre { margin: 0; border-top: 1px solid #25334a; padding: 12px; max-height: 340px; overflow: auto; white-space: pre-wrap; }
button.linkish { background: transparent; border: none; color: #93c5fd; cursor: pointer; text-decoration: underline; padding: 0 4px; font: inherit; }
button.linkish:hover { color: #bfdbfe; }
.stack-form label { display: block; margin-bottom: 12px; color: #cbd5e1; font-size: 13px; }
.stack-form input[type="date"], .stack-form textarea { width: 100%; max-width: 720px; box-sizing: border-box; background: #0b1220; border: 1px solid #243244; color: #f8fafc; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.stack-form textarea { min-height: 120px; font-family: ui-monospace, Consolas, monospace; }
.section-subtotal { margin-top: 12px; padding-top: 10px; border-top: 1px solid #334155; font-size: 13px; color: #cbd5e1; }
.metric-bars { border: 1px solid #233248; border-radius: 10px; background: #0b1220; padding: 10px 12px; margin: 10px 0 16px; }
.metric-bar-row { display: grid; grid-template-columns: 180px 1fr 90px; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12px; }
.metric-bar-label { color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-bar-label a.metric-bar-drill { color: #93c5fd; text-decoration: underline dotted; }
.metric-bar-label a.metric-bar-drill:hover { color: #e0f2fe; }
.metric-bar-track { height: 9px; border-radius: 999px; background: #1f2937; overflow: hidden; }
.metric-bar-fill { display: block; height: 9px; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #38bdf8); }
.metric-bar-value { color: #93c5fd; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1024px) {
  .shell-body { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid #1f2937; }
  .content-shell { padding: 12px; }
}
