:root {
  --bg: #020805;
  --panel: #03150a;
  --panel-2: #052010;
  --text: #8dff9e;
  --text-dim: #3d8a4e;
  --accent: #00ff6a;
  --blue: #2f62e8;
  --blue-dim: #1a3d9a;
  --border: #0d4a22;
  --border-hi: #1a7a38;
  --danger: #ff5d5d;
  --warn: #e8d25a;
  --scan: rgba(0, 80, 20, 0.12);
  --glow: rgba(0, 255, 90, 0.28);
  --font-ui: "IBM Plex Mono", "PT Mono", "Courier New", ui-monospace, monospace;
  --font-data: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
}

body {
  text-shadow: 0 0 2px rgba(0, 255, 90, 0.25);
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 2px,
    var(--scan) 2px 3px
  );
  opacity: 0.45;
}

.crt {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: 0 0 18px var(--glow), inset 0 0 24px rgba(0, 255, 80, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  background: #fff;
  border-radius: 2px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
}

.brand-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.brand-text { display: flex; flex-direction: column; }
.brand-sys {
  color: var(--accent);
  letter-spacing: 0.12em;
  font-size: 13px;
}
.brand-sub { color: var(--text-dim); font-size: 11px; }

.top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sys-ok {
  color: var(--accent);
  border: 1px solid var(--border-hi);
  padding: 2px 8px;
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.who { color: var(--text-dim); }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }
.top-settings { font-weight: 600; }

.reveal-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.reveal-switch .btn.is-open,
.reveal-switch .btn-primary.is-open { box-shadow: 0 0 10px var(--glow); }
.reveal-panel { margin-top: 8px; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 2px solid var(--border);
  border-top: 0;
  background: #021108;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 14px;
  border-right: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.nav a:hover { background: var(--panel-2); color: var(--accent); }
.nav a.active {
  background: #063018;
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.main { flex: 1; padding: 16px 0; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.dim { color: var(--text-dim); }

h1, h2 {
  font-weight: 400;
  color: var(--accent);
  text-shadow: 0 0 8px var(--glow);
  margin: 0 0 12px;
}
h1 { font-size: 22px; }
h2 { font-size: 16px; margin-top: 22px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: inset 0 0 30px rgba(0, 255, 80, 0.04);
  margin-bottom: 16px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.card {
  border: 1px solid var(--border);
  background: #02140a;
  padding: 12px;
}

.card .n {
  font-size: 28px;
  color: var(--accent);
  font-family: var(--font-data);
}

.card.warn .n { color: var(--warn); }
.card.danger .n { color: var(--danger); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.filter, input, select, textarea, button, .btn {
  font-family: inherit;
  font-size: 14px;
}

.filter {
  flex: 1;
  min-width: 180px;
  background: #001208;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 10px;
}

input, select, textarea {
  background: #001208;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 10px;
  width: 100%;
  text-shadow: none;
}

input[type="file"] {
  width: auto;
  color: var(--text-dim);
  padding: 4px;
}

.file-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 12px;
  margin-top: 6px;
}
.file-slots input[type="file"] {
  width: 100%;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
}

label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin: 8px 0 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px 12px;
}

.form-grid .span-2 { grid-column: span 2; }
.form-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.drop-zone {
  position: relative;
  border: 1px dashed var(--border-hi);
  background: var(--panel-2);
  padding: 18px 14px 14px;
  text-align: center;
  cursor: pointer;
  margin-top: 4px;
  min-height: 72px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.drop-zone-compact {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  min-width: 140px;
  padding: 8px 12px;
  margin-top: 0;
  vertical-align: middle;
}
.drop-zone.is-drag {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--glow);
  background: var(--panel);
}
.drop-zone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font-size: 0;
  z-index: 2;
}
.drop-zone-title { font-weight: 600; pointer-events: none; }
.drop-zone-hint { font-size: 12px; pointer-events: none; }
.drop-zone-files {
  margin-top: 8px;
  font-size: 12px;
  word-break: break-word;
  pointer-events: none;
}
.drop-zone-compact .drop-zone-files { margin-top: 4px; }

button, .btn {
  background: #032410;
  color: var(--accent);
  border: 1px solid var(--border-hi);
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 0 6px rgba(0, 255, 90, 0.15);
}

button:hover, .btn:hover {
  box-shadow: 0 0 12px rgba(0, 255, 90, 0.4);
  color: #fff;
}

.btn-primary { background: #0a3d1c; }
.btn-tiny {
  padding: 0 6px;
  font-size: 12px;
  line-height: 1.4;
}
form.inline-form {
  display: inline;
  margin-left: 4px;
}
.danger, .btn.danger { color: var(--danger); border-color: #7a2020; }
.ghost { opacity: 0.85; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  max-height: 70vh;
}

table.data {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-data);
  font-size: 13px;
  text-shadow: none;
  min-width: 720px;
}

table.data th, table.data td {
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
}

table.data th {
  position: sticky;
  top: 0;
  background: #073016;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 2;
  cursor: pointer;
}

table.data tr:nth-child(even) td { background: rgba(0, 40, 15, 0.35); }
table.data tr:hover td { background: rgba(0, 80, 30, 0.45); }
table.data tr.overdue td { background: rgba(120, 40, 0, 0.28); }
table.data tr.inv-pending td { background: rgba(230, 200, 40, 0.35); }
table.data tr.inv-part td { background: rgba(47, 98, 232, 0.28); }
table.data tr.inv-full td { background: rgba(26, 143, 60, 0.28); }
table.data tr.inv-rej td { background: rgba(198, 40, 40, 0.28); }

#lines-table {
  table-layout: fixed;
  min-width: 760px;
}
#lines-table th:nth-child(1),
#lines-table td:nth-child(1) { width: 2.4rem; }
#lines-table th:nth-child(2),
#lines-table td.ln-name-cell { width: 28%; }
#lines-table th:nth-child(3),
#lines-table td:nth-child(3) { width: 4.6rem; }
#lines-table th:nth-child(4),
#lines-table td:nth-child(4) { width: 3.6rem; }
#lines-table th:nth-child(5),
#lines-table td:nth-child(5),
#lines-table th:nth-child(6),
#lines-table td:nth-child(6) { width: 8.5rem; }
#lines-table th:nth-child(7),
#lines-table td:nth-child(7) { width: 6.4rem; }
#lines-table th:nth-child(8),
#lines-table td:nth-child(8) { width: 2.4rem; text-align: center; }
#lines-table textarea.ln-name {
  width: 100%;
  min-height: 2.1em;
  height: 2.1em;
  max-height: 4.2em;
  resize: vertical;
  line-height: 1.3;
}
#lines-table input.ln-qty,
#lines-table input.ln-unit,
#lines-table input.ln-price,
#lines-table input.ln-total {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.badge {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--font-ui);
}
.st-plan { color: var(--text-dim); }
.st-way { color: var(--warn); border-color: #7a6a20; }
.st-done { color: var(--accent); }

.flash {
  padding: 10px 12px;
  border: 1px solid var(--border-hi);
  margin-bottom: 14px;
  background: #042010;
}
.flash-warn { border-color: var(--warn); color: var(--warn); }
.flash-err { border-color: var(--danger); color: var(--danger); }

.news-item {
  border-left: 3px solid var(--blue);
  padding: 8px 12px;
  margin-bottom: 10px;
  background: #02100c;
}
.news-item.pinned { border-left-color: var(--accent); }
.news-item h3 { margin: 0 0 4px; font-size: 15px; color: var(--accent); font-weight: 400; }

.files { list-style: none; margin: 0; padding: 0; }
.files li { margin: 2px 0; }
.files a { color: var(--blue); }

.login-box {
  max-width: 420px;
  margin: 48px auto;
}

.check-list {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  padding: 8px;
  background: #011008;
}

.check-list label { color: var(--text); margin: 4px 0; }

.scan-field { position: relative; }
.scan-suggest {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  max-height: 260px;
  margin-top: 4px;
}
.scan-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 2px 0;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
}
.scan-suggest button:hover { background: var(--hover, rgba(255,255,255,.06)); }
.scan-suggest .dim { pointer-events: none; padding: 6px 8px; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.tabs a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 12px;
  font-size: 12px;
  text-transform: uppercase;
}
.tabs a.active { color: var(--accent); border-bottom: 2px solid var(--accent); }

.tmc-photo {
  min-height: 180px;
  border: 1px solid var(--border);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tmc-photo img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.stock-card {
  display: grid;
  grid-template-columns: minmax(180px, 340px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 800px) {
  .stock-card { grid-template-columns: 1fr; }
}
.pager { margin: 12px 0; }
.pager a {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border: 1px solid var(--border);
}
.pager a.active { font-weight: 700; }

.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.inline input[type="file"] { width: auto; }

.preview {
  border: 1px dashed var(--border);
  padding: 10px;
  color: var(--text-dim);
  white-space: pre-wrap;
  font-size: 13px;
  margin-top: 8px;
}

.view-val {
  min-height: 1.4em;
  padding: 4px 0;
  white-space: pre-wrap;
  font-family: var(--font-data);
}

table.data th.chk, table.data td.chk {
  width: 36px;
  white-space: nowrap;
  vertical-align: middle;
}

.theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.theme-row label { margin: 0; color: var(--text); }
.theme-row select { width: auto; min-width: 280px; }

@media (max-width: 720px) {
  .brand-sub { display: none; }
  .brand-logo img { height: 28px; }
  .form-grid .span-2 { grid-column: span 1; }
  table.data { min-width: 640px; }
}

/* Industrial Quiet — light skin. CRT stays on .theme-dark. */
html.theme-light {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #eef1f4;
  --text: #1c2128;
  --text-dim: #5c6570;
  --accent: #2f62e8;
  --green: #1a8f3c;
  --blue: #2f62e8;
  --blue-dim: #1a4fd0;
  --border: #e2e6eb;
  --border-hi: #2f62e8;
  --danger: #c62828;
  --warn: #b8860b;
  --scan: transparent;
  --glow: transparent;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-data: ui-monospace, "IBM Plex Mono", "PT Mono", "Courier New", monospace;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 33, 40, 0.05), 0 8px 24px rgba(28, 33, 40, 0.04);
}

html.theme-light body {
  text-shadow: none;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
}

html.theme-light .scanlines,
html.theme-light .sys-ok {
  display: none;
}

html.theme-light .crt {
  max-width: 1320px;
  padding: 16px 20px 28px;
}

html.theme-light .top {
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: none;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #fff;
  padding: 12px 16px;
}

html.theme-light .brand-logo {
  background: transparent;
  border-radius: 6px;
  padding: 0;
}

html.theme-light .brand-sys {
  color: var(--text);
  letter-spacing: 0.02em;
  font-weight: 650;
  font-size: 14px;
}

html.theme-light .brand-sub {
  font-size: 12px;
}

html.theme-light .nav {
  position: sticky;
  top: 60px;
  z-index: 39;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  gap: 2px;
  padding: 4px 6px;
}

html.theme-light .nav a {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  border-right: 0;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
}

html.theme-light .nav a:hover {
  background: #eef3ff;
  color: var(--blue);
}

html.theme-light .nav a.active {
  background: #e8eefc;
  color: var(--blue);
  box-shadow: none;
  font-weight: 650;
}

html.theme-light .main { padding: 20px 0 8px; }

html.theme-light h1,
html.theme-light h2,
html.theme-light .news-item h3 {
  text-shadow: none;
  color: var(--text);
  font-weight: 650;
}

html.theme-light h1 { color: #12161c; font-size: 22px; letter-spacing: -0.02em; }
html.theme-light h2 { color: #2a313c; margin-top: 18px; }

html.theme-light .panel {
  box-shadow: var(--shadow);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

html.theme-light .drop-zone {
  background: #f7f8fa;
  border-radius: var(--radius);
  border-color: #c9d6f8;
}
html.theme-light .drop-zone.is-drag {
  background: #eef3ff;
  border-color: var(--blue);
  box-shadow: none;
}

html.theme-light .card {
  background: #fff;
  border-radius: 8px;
  box-shadow: none;
}

html.theme-light .card .n {
  color: var(--blue);
  font-family: var(--font-data);
  font-size: 26px;
  font-weight: 600;
}

html.theme-light .filter,
html.theme-light input,
html.theme-light select,
html.theme-light textarea {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
}

html.theme-light input:focus,
html.theme-light select:focus,
html.theme-light textarea:focus,
html.theme-light .filter:focus {
  outline: 2px solid rgba(47, 98, 232, 0.22);
  border-color: var(--blue);
}

html.theme-light label { color: var(--text-dim); font-weight: 500; }

html.theme-light button,
html.theme-light .btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
  border-radius: 7px;
  font-weight: 550;
}

html.theme-light button:hover,
html.theme-light .btn:hover {
  color: var(--blue);
  box-shadow: none;
  background: #eef3ff;
  border-color: #c9d6f8;
}

html.theme-light .btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

html.theme-light .btn-primary:hover {
  background: var(--blue-dim);
  color: #fff;
  border-color: var(--blue-dim);
}

html.theme-light .danger,
html.theme-light .btn.danger {
  color: var(--danger);
  border-color: #f0c4c4;
  background: #fff;
}

html.theme-light .table-wrap {
  border-radius: 8px;
  border-color: var(--border);
}

html.theme-light table.data {
  font-family: var(--font-ui);
  font-size: 13px;
}

html.theme-light table.data th {
  background: #f7f8fa;
  color: #5c6570;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
}

html.theme-light table.data td {
  font-variant-numeric: tabular-nums;
}

html.theme-light table.data tr:nth-child(even) td { background: #fafbfc; }
html.theme-light table.data tr:hover td { background: #eef3ff; }
html.theme-light table.data tr.overdue td { background: #fdecea; }
html.theme-light table.data tr.inv-pending td { background: #fff8e1; }
html.theme-light table.data tr.inv-part td { background: #e8eefc; }
html.theme-light table.data tr.inv-full td { background: #e6f4ea; }
html.theme-light table.data tr.inv-rej td { background: #fdecea; }

html.theme-light .badge {
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 550;
  padding: 2px 8px;
}

html.theme-light .flash {
  background: #eef3ff;
  border-radius: 8px;
  border-color: #c9d6f8;
  color: var(--text);
}
html.theme-light .flash-warn { background: #fff8e6; border-color: #ead7a0; color: #7a5b00; }
html.theme-light .flash-err { background: #fdecea; border-color: #f0c4c4; color: var(--danger); }

html.theme-light .news-item {
  background: #f7f8fa;
  border-radius: 8px;
}
html.theme-light .news-item.pinned { border-left-color: var(--blue); }
html.theme-light .check-list {
  background: #fff;
  border-radius: 8px;
}
html.theme-light .tabs a {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 500;
}
html.theme-light .tabs a.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 650; }
html.theme-light .st-plan { color: var(--text-dim); }
html.theme-light .st-way { color: #9a6b00; border-color: #ead7a0; }
html.theme-light .st-done { color: var(--green); border-color: #b7e0c2; }
html.theme-light .link { color: var(--blue); }
html.theme-light .preview {
  background: #f7f8fa;
  border-radius: 8px;
}
html.theme-light .pager a {
  border-radius: 6px;
  background: #fff;
}
html.theme-light .pager a.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
html.theme-light .tmc-photo {
  border-radius: 8px;
  background: #f7f8fa;
}
html.theme-light .login-box .panel {
  box-shadow: var(--shadow);
}
html.theme-light details.fold > summary {
  color: var(--blue);
  border-color: var(--border);
  text-transform: none;
  letter-spacing: 0;
  border-radius: 7px;
  font-weight: 550;
}
html.theme-light .foot {
  color: var(--text-dim);
  border-color: transparent;
  padding: 8px 4px 0;
}

html.theme-dark {
  --green: #00ff6a;
}

html.theme-dark .scanlines {
  display: block;
}

/* Светлая — bir3yk language on a light canvas. Industrial Quiet = .theme-light */
html.theme-bir {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #eef1f6;
  --text: #1c2128;
  --text-dim: #6b7280;
  --accent: #2f62e8;
  --green: #1a8f3c;
  --blue: #2f62e8;
  --blue-dim: #1a4fd0;
  --border: #e4e7ee;
  --border-hi: #2f62e8;
  --danger: #c62828;
  --warn: #b8860b;
  --scan: transparent;
  --glow: transparent;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-data: ui-monospace, "IBM Plex Mono", "PT Mono", "Courier New", monospace;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(28, 33, 40, 0.06);
}

html.theme-bir body {
  text-shadow: none;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
}

html.theme-bir .scanlines,
html.theme-bir .sys-ok {
  display: none;
}

html.theme-bir .crt {
  max-width: 1280px;
  padding: 16px 20px 32px;
}

html.theme-bir .top {
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 4px 8px;
}

html.theme-bir .brand-logo {
  background: transparent;
  border-radius: 10px;
  padding: 0;
}

html.theme-bir .brand-sys {
  color: var(--text);
  letter-spacing: 0.01em;
  font-weight: 700;
  font-size: 16px;
}

html.theme-bir .brand-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

html.theme-bir .nav {
  position: sticky;
  top: 58px;
  z-index: 39;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: none;
  gap: 4px;
  padding: 5px 8px;
}

html.theme-bir .nav a {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  border-right: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
}

html.theme-bir .nav a:hover {
  background: var(--panel-2);
  color: var(--text);
}

html.theme-bir .nav a.active {
  background: #1c2128;
  color: #fff;
  box-shadow: none;
  font-weight: 650;
}

html.theme-bir .main { padding: 22px 0 10px; }

html.theme-bir h1,
html.theme-bir h2,
html.theme-bir .news-item h3 {
  text-shadow: none;
  color: var(--text);
  font-weight: 750;
  letter-spacing: -0.03em;
}

html.theme-bir h1 { font-size: 28px; }
html.theme-bir h2 { color: var(--text); margin-top: 20px; font-size: 18px; }

html.theme-bir .panel {
  box-shadow: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

html.theme-bir .drop-zone {
  background: #f7f8fb;
  border-radius: var(--radius);
  border-color: var(--border);
}
html.theme-bir .drop-zone.is-drag {
  background: #eef3ff;
  border-color: var(--blue);
  box-shadow: none;
}

html.theme-bir .card {
  background: var(--panel);
  border-radius: 12px;
  border-color: var(--border);
}

html.theme-bir .card .n {
  color: var(--text);
  font-family: var(--font-data);
  font-size: 26px;
  font-weight: 600;
}

html.theme-bir .filter,
html.theme-bir input,
html.theme-bir select,
html.theme-bir textarea {
  background: #f3f5f8;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
}

html.theme-bir textarea {
  border-radius: 12px;
}

html.theme-bir input:focus,
html.theme-bir select:focus,
html.theme-bir textarea:focus,
html.theme-bir .filter:focus {
  outline: 2px solid rgba(47, 98, 232, 0.2);
  border-color: var(--blue);
}

html.theme-bir label { color: var(--text-dim); font-weight: 500; }

html.theme-bir button,
html.theme-bir .btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
  border-radius: 999px;
  font-weight: 550;
}

html.theme-bir button:hover,
html.theme-bir .btn:hover {
  color: #fff;
  background: #1c2128;
  border-color: #1c2128;
  box-shadow: none;
}

html.theme-bir .btn-primary {
  background: #1c2128;
  color: #fff;
  border-color: #1c2128;
}

html.theme-bir .btn-primary:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

html.theme-bir .danger,
html.theme-bir .btn.danger {
  color: var(--danger);
  border-color: #f0c4c4;
  background: #fff;
}

html.theme-bir .who,
html.theme-bir .link { color: var(--blue); }
html.theme-bir .link:hover { color: var(--blue-dim); }

html.theme-bir .table-wrap {
  border-radius: 12px;
  border-color: var(--border);
}

html.theme-bir table.data {
  font-family: var(--font-ui);
  font-size: 13px;
}

html.theme-bir table.data th {
  background: #f7f8fb;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
}

html.theme-bir table.data td {
  font-variant-numeric: tabular-nums;
  border-bottom-color: var(--border);
}

html.theme-bir table.data tr:nth-child(even) td { background: #fafbfc; }
html.theme-bir table.data tr:hover td { background: #eef3ff; }
html.theme-bir table.data tr.overdue td { background: #fdecea; }
html.theme-bir table.data tr.inv-pending td { background: #fff8e1; }
html.theme-bir table.data tr.inv-part td { background: #e8eefc; }
html.theme-bir table.data tr.inv-full td { background: #e6f4ea; }
html.theme-bir table.data tr.inv-rej td { background: #fdecea; }

html.theme-bir .badge {
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 550;
  padding: 2px 8px;
  border-color: var(--border);
}

html.theme-bir .flash {
  background: #eef3ff;
  border-radius: 12px;
  border-color: #c9d6f8;
  color: var(--text);
}
html.theme-bir .flash-warn { background: #fff8e6; border-color: #ead7a0; color: #7a5b00; }
html.theme-bir .flash-err { background: #fdecea; border-color: #f0c4c4; color: var(--danger); }

html.theme-bir .news-item {
  background: #f7f8fb;
  border-radius: 12px;
}
html.theme-bir .news-item.pinned { border-left-color: var(--blue); }
html.theme-bir .check-list {
  background: #fff;
  border-radius: 12px;
}
html.theme-bir .tabs {
  border-bottom-color: var(--border);
}
html.theme-bir .tabs a {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 500;
}
html.theme-bir .tabs a.active { color: var(--text); border-bottom-color: #1c2128; font-weight: 650; }
html.theme-bir .st-plan { color: var(--text-dim); }
html.theme-bir .st-way { color: #9a6b00; border-color: #ead7a0; }
html.theme-bir .st-done { color: var(--green); border-color: #b7e0c2; }
html.theme-bir .preview {
  background: #f7f8fb;
  border-radius: 12px;
}
html.theme-bir .pager a {
  border-radius: 999px;
  background: #fff;
  color: var(--text);
}
html.theme-bir .pager a.active {
  background: #1c2128;
  color: #fff;
  border-color: #1c2128;
}
html.theme-bir .tmc-photo {
  border-radius: 12px;
  background: #f7f8fb;
}
html.theme-bir details.fold > summary {
  color: var(--text);
  border-color: var(--border);
  text-transform: none;
  letter-spacing: 0;
  border-radius: 999px;
  font-weight: 550;
  background: #fff;
}
html.theme-bir .foot {
  color: var(--text-dim);
  border-color: var(--border);
  padding: 12px 4px 0;
}

.mail-body {
  white-space: pre-wrap;
  font-family: var(--font-data);
  margin: 10px 0;
  max-height: 28rem;
  overflow: auto;
}
.mt { margin-top: 12px; }

details.fold {
  margin-top: 8px;
}
details.fold > summary {
  cursor: pointer;
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border-hi);
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  user-select: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { margin-bottom: 10px; }
details.fold .check-list { margin-top: 8px; }
td.nowrap { white-space: nowrap; }

.ftp-quota-wrap { margin: 12px 0 18px; }
.ftp-quota {
  height: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ftp-quota span {
  display: block;
  height: 100%;
  background: var(--accent);
  max-width: 100%;
}

.ftp-folder-name { font-weight: 700; }
.ftp-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.ftp-ico {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0.9;
}
table.data td.ftp-actions {
  white-space: nowrap;
  width: 1%;
  vertical-align: middle;
}
.row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}
.row-actions .inline-form {
  display: inline-flex;
  margin: 0;
}
table.data tr.ftp-item-row td { border-bottom: none; }
table.data tr.ftp-share-row td {
  padding-top: 0;
  padding-bottom: 10px;
  font-size: 12px;
  word-break: break-all;
}
table.data tr.ftp-share-row:hover td,
html.theme-light table.data tr.ftp-share-row:hover td,
html.theme-bir table.data tr.ftp-share-row:hover td { background: inherit; }

.upload-progress { margin-top: 10px; }
.upload-progress-bar,
.busy-bar {
  height: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.upload-progress-bar span,
.busy-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.upload-progress-bar span { width: 0; transition: width .12s linear; }
.busy-bar span {
  width: 36%;
  animation: busy-slide 1.15s ease-in-out infinite;
}
@keyframes busy-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}
.upload-progress-text { margin: 6px 0 0; font-size: 12px; }

#busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 12, 6, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
#busy-overlay[hidden] { display: none !important; }
.busy-box {
  min-width: 280px;
  max-width: 92vw;
  background: var(--panel);
  border: 1px solid var(--border-hi);
  padding: 18px 20px;
  box-shadow: 0 0 24px var(--glow);
}
.busy-text { margin: 10px 0 0; }
