/* Satcop Stock — light admin theme (Viren design reference).
   White sidebar, light grey canvas, one blue accent, Inter.
   Light theme only. No dark surfaces. Styling and layout only. */

:root {
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --bg-canvas: #EBEEF2;
  --bg-sidebar: #F9FAFC;
  --bg-main: #FFFFFF;
  --bg-muted: #F4F6F8;
  --bg-input: #F4F6F8;
  --bg-hover: #F0F3F7;
  --text: #1C1D21;
  --text-secondary: #6B7080;
  --text-muted: #8B909A;
  --text-inverse: #FFFFFF;
  --accent: #2F6FED;
  --accent-hover: #2560D9;
  --accent-soft: #E8F0FE;
  --accent-text: #2F6FED;
  --line: #EEF0F3;
  --line-strong: #E4E7EC;
  --ok: #17A34A;
  --ok-soft: #E8F8EE;
  --ok-text: #15803C;
  --warn: #D97706;
  --warn-soft: #FFF6E5;
  --warn-text: #B45309;
  --danger: #E11D48;
  --danger-soft: #FDE8EC;
  --danger-text: #BE123C;
  --info: #2F6FED;
  --info-soft: #E8F0FE;
  --yellow: #CA8A04;
  --yellow-soft: #FEF6D8;
  --yellow-text: #A16207;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.05), 0 1px 2px rgba(16, 24, 40, 0.03);
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --tap: 44px;
  --fs-body: 15px;
  --fs-form: 16px;
  --fs-title: 28px;
  --fs-top: 20px;
  --fs-kpi: 32px;
  --fs-small: 13px;
  --fs-micro: 12px;
  --fs-nav: 14px;
}

@font-face {
  font-family: Inter;
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.45;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  -webkit-font-smoothing: antialiased;
  color-scheme: light only;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; color-scheme: light; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: var(--fs-title); font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 8px; }
h3 { font-size: 16px; font-weight: 650; margin: 0 0 12px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin: 12px 0 6px; }
.muted { color: var(--text-secondary); font-size: 13px; font-weight: 450; }

.app {
  display: flex;
  min-height: 100vh;
  background: var(--bg-canvas);
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 4px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.test {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 3px;
}
.top-test { margin-top: 0; flex-shrink: 0; }

.side-search { display: flex; align-items: center; gap: 8px; }
.side-search .field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text-muted);
}
.side-search .field input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--text);
  box-shadow: none;
}
.side-search .field input::placeholder { color: var(--text-muted); }
.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: #3A3F47;
  font-size: var(--fs-nav);
  font-weight: 500;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.nav-item .ico { color: #5C6370; flex-shrink: 0; }
.nav-item.active, .nav-item.on {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.nav-item.active .ico, .nav-item.on .ico { color: #fff; }
.nav-item.danger { color: var(--danger-text); }
.nav-item.danger .ico { color: var(--danger-text); }
.nav-item[hidden] { display: none !important; }
.nav-spacer { flex: 1; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
}
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title {
  font-size: var(--fs-top);
  font-weight: 650;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar #net { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-right: 4px; }
.topbar #net a { color: var(--text-secondary); }
.bell-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.v-div { width: 1px; height: 28px; background: var(--line-strong); margin: 0 8px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--text);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  color: #fff;
  background: #5B7CFA;
  flex-shrink: 0;
}
.user-meta { text-align: left; line-height: 1.2; }
.user-meta .n { display: block; font-size: 13px; font-weight: 600; }
.user-meta .r { display: block; font-size: 12px; color: var(--text-muted); font-weight: 400; }

.content { padding: 24px 28px 28px; flex: 1; }
.content > h2 { margin-bottom: 6px; }
.content > h2 + .muted, .content > h2 + p.muted { margin-bottom: 18px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1, .page-head h2 { font-size: var(--fs-title); font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; margin: 0; }
.page-head .sub { margin-top: 4px; color: var(--text-secondary); font-size: 14px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.card.muted { color: var(--text-secondary); }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.g { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.g:hover { background: #15803C; border-color: #15803C; }
.btn.r { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.r:hover { background: #BE123C; border-color: #BE123C; }
.btn.l, .btn.outline {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
  font-weight: 550;
}
.btn.l:hover, .btn.outline:hover { background: var(--bg-hover); }
.btn.big { width: 100%; min-height: 44px; padding: 0 18px; font-size: 15px; border-radius: 12px; margin-top: 10px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

input[type="text"], input[type="password"], input[type="search"], input[type="date"],
input[type="number"], input:not([type]), select, textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: var(--fs-form);
  color: var(--text);
  outline: none;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7080' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
}
.table-card .table-card { border: 0; margin: 0; box-shadow: none; border-radius: 0; }
.table-scroll { overflow-x: auto; }
table, table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td, table.data th, table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th, table.data th {
  background: #F7F8FA;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
td, table.data td { color: var(--text); font-weight: 500; }
tr:last-child td, table.data tr:last-child td { border-bottom: 0; }

.msg { padding: 10px 14px; border-radius: 12px; margin: 8px 0 12px; font-size: 14px; font-weight: 550; }
.ok, .msg.ok { background: var(--ok-soft); color: var(--ok-text); }
.err, .msg.err { background: var(--danger-soft); color: var(--danger-text); }
.warn, .msg.warn { background: var(--warn-soft); color: var(--warn-text); }

.pill, .pill.p-ok, .pill.p-wait, .pill.p-red, .pill.p-grey {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.p-ok, .pill.p-ok { background: var(--ok-soft); color: var(--ok-text); }
.p-wait, .pill.p-wait { background: var(--yellow-soft); color: var(--yellow-text); }
.p-red, .pill.p-red { background: var(--danger-soft); color: var(--danger-text); }
.p-grey, .pill.p-grey { background: #EEF0F3; color: #5C6370; }
.pill.progress, .pill.info { background: var(--info-soft); color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
}
.chips span.bad { background: var(--danger-soft); color: var(--danger-text); }
.chips span a { color: inherit; font-weight: 700; }

.kpis, .tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 20px;
}
.kpi, .tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-xs);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kpi-title, .tile .kpi-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.kpi-title .ico { color: var(--text-secondary); }
.kpi-num, .tile b, .tile .kpi-num {
  font-size: var(--fs-kpi);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tile b { display: flex; }
.delta {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.delta.up { background: var(--ok-soft); color: var(--ok-text); }
.delta.down { background: var(--danger-soft); color: var(--danger-text); }
.delta.flat { background: var(--bg-muted); color: var(--text-muted); }
.kpi-cap, .tile .kpi-cap, .tile { font-size: 13px; color: var(--text-muted); }
.tile { color: var(--text-muted); }
.tile b { color: var(--text); margin-bottom: 8px; }

section h3, .section-title { margin: 8px 0 12px; font-size: 16px; font-weight: 650; }

.u {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.u:last-child { border-bottom: 0; }
.u > div { min-width: 0; word-break: break-all; }

video { width: 100%; border-radius: 12px; background: #1C1D21; max-height: 260px; }

.tabs {
  display: none;
  background: #fff;
  border-top: 1px solid var(--line);
}
.tabs a {
  flex: 1;
  text-align: center;
  padding: 14px 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}
.tabs a.on { color: var(--accent); background: var(--accent-soft); }

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-canvas);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 32px 28px;
  display: grid;
  gap: 4px;
}
.login-card .brand { padding: 0; margin-bottom: 12px; }
.login-card .test { margin-top: 3px; }
.login-card h1, .login-card h2 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 8px 0 4px;
}
.login-card .sub, .login-card .muted { color: var(--text-secondary); font-size: 14px; margin-bottom: 8px; }
.login-card label { margin-top: 12px; }
.login-card .btn.big { margin-top: 16px; }
.login-card #srv { margin-top: 14px; }

.hamburger { display: none; }
.backdrop { display: none; }

body.eng .content { max-width: 640px; }

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 30;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-105%);
    box-shadow: none;
    overflow: auto;
  }
  body.menu-open .sidebar { transform: translateX(0); box-shadow: 8px 0 30px rgba(16,24,40,0.08); }
  .backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(230, 234, 238, 0.72);
    z-index: 25;
  }
  body.menu-open .backdrop { display: block; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .topbar-title { font-size: 18px; }
  .topbar .user-meta .n { display: none; }
  .v-div { display: none; }
  .content { padding: 16px 16px 28px; }
  .kpis, .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi, .tile { padding: 12px; }
  .kpi-num, .tile b { font-size: 26px; }
  h2, .page-head h1, .page-head h2 { font-size: 24px; }
  body.eng .tabs { display: flex; position: sticky; bottom: 0; z-index: 10; }
  body.eng .content { padding-bottom: 24px; max-width: none; }
}

@media (max-width: 640px) {
  .row > * { min-width: 100%; }
  .login-card { padding: 24px 20px; }
}
