/* ============================================================
   buffspace — платформа администратора
   Общий стиль для всех страниц
   ============================================================ */

:root {
  --bg: #f4f4f7;
  --surface: #ffffff;
  --surface2: #f0f0f4;
  --border: rgba(20, 20, 50, 0.09);
  --border-strong: rgba(20, 20, 50, 0.16);
  --accent: #5b4ee0;
  --accent-soft: rgba(91, 78, 224, 0.08);
  --accent2: #0ea59a;
  --text: #16162a;
  --color-text-primary: #16162a; /* алиас для совместимости с перенесёнными инструкциями */
  --muted: #6b6b8a;
  --warm: #d97706;
  --danger: #e05555;
  --ok: #16a34a;
  --head: "Unbounded", sans-serif;
  --body: "Golos Text", sans-serif;
  --shadow-sm: 0 1px 2px rgba(20, 20, 50, 0.04), 0 1px 3px rgba(20, 20, 50, 0.05);
  --shadow-md: 0 4px 14px rgba(20, 20, 50, 0.07);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(91, 78, 224, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 78, 224, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 80%);
}
a { color: inherit; text-decoration: none; }

/* ===================== TOP NAV ===================== */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.7rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; flex-shrink: 0; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, #5b4ee0, #0ea59a);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-size: 13px; font-weight: 700; color: #fff;
  box-shadow: 0 4px 12px rgba(91, 78, 224, 0.3);
}
.brand b { font-family: var(--head); font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.brand span { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 1px; font-weight: 500; }
.nav-links { display: flex; gap: 0.15rem; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  font-size: 0.84rem; font-weight: 500; color: var(--muted);
  padding: 0.42rem 0.8rem; border-radius: 9px; transition: all 0.14s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: rgba(20, 20, 50, 0.04); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

/* ===================== PAGE SHELL ===================== */
.wrap { max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem 4rem; position: relative; z-index: 1; }
.page-head { margin-bottom: 1.75rem; }
.page-head h1 { font-family: var(--head); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 0.4rem; font-size: 0.92rem; max-width: 60ch; }
.eyebrow {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.55rem;
}

/* ===================== DASHBOARD ===================== */
.hero {
  background: linear-gradient(135deg, #5b4ee0 0%, #6d5ce8 45%, #0ea59a 130%);
  border-radius: 22px; padding: 2.6rem 2.4rem; color: #fff;
  position: relative; overflow: hidden; margin-bottom: 2rem;
  box-shadow: 0 18px 44px rgba(91, 78, 224, 0.25);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
}
.hero h1 { font-family: var(--head); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; position: relative; }
.hero p { margin-top: 0.7rem; font-size: 1rem; opacity: 0.92; max-width: 52ch; position: relative; }
.hero .pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.22);
  padding: 0.3rem 0.75rem; border-radius: 30px; font-size: 0.76rem; font-weight: 600;
  margin-bottom: 1rem; position: relative;
}

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.35rem 1.4rem; transition: all 0.16s; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.5rem; position: relative; overflow: hidden;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.tile .ico {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 1.25rem; margin-bottom: 0.3rem;
}
.tile h3 { font-family: var(--head); font-size: 0.98rem; font-weight: 600; }
.tile p { font-size: 0.83rem; color: var(--muted); line-height: 1.5; }
.tile .arrow { margin-top: auto; font-size: 0.8rem; font-weight: 600; color: var(--accent); padding-top: 0.4rem; }

.section-title { font-family: var(--head); font-size: 1.05rem; font-weight: 600; margin: 2.4rem 0 1rem; }

/* mini reminder strip */
.reminders { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.75rem; }
.reminder {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--warm);
  border-radius: 10px; padding: 0.85rem 1rem; font-size: 0.84rem; line-height: 1.5;
}
.reminder b { display: block; font-size: 0.8rem; margin-bottom: 2px; }

/* ===================== SCRIPTS / SPLIT LAYOUT ===================== */
.toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#search, .input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  padding: 0.62rem 1rem 0.62rem 2.4rem; color: var(--text); font-family: var(--body);
  font-size: 0.9rem; outline: none; transition: border-color 0.14s, box-shadow 0.14s;
}
#search:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input { padding-left: 1rem; }

.split { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: start; }
.sidebar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 0; position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.nav-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0.7rem 1.1rem 0.35rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.46rem 1.1rem; cursor: pointer;
  font-size: 0.85rem; color: var(--muted); border-left: 2px solid transparent; transition: all 0.12s;
}
.nav-item:hover { color: var(--text); background: rgba(20,20,50,0.025); }
.nav-item.active { color: var(--text); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.main-area { min-width: 0; }
.cat-section { display: none; }
.cat-section.visible { display: block; }
.sec-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.3rem; }
.sec-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.sec-title { font-family: var(--head); font-size: 1.05rem; font-weight: 600; }
.sec-desc { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }

/* CARD */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card-head { padding: 0.9rem 1rem 0.7rem; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.card-title { font-size: 0.88rem; font-weight: 600; line-height: 1.35; }
.card-tag { font-size: 0.66rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; letter-spacing: 0.02em; }
.card-body { padding: 0.9rem 1rem; font-size: 0.83rem; color: #3a3a5c; line-height: 1.65; white-space: pre-line; max-height: 168px; overflow: hidden; position: relative; }
.card-body.expanded { max-height: none; }
.card-fade { position: absolute; bottom: 0; left: 0; right: 0; height: 42px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.card-body.expanded .card-fade { display: none; }
.card-note { margin: 0 1rem 0.5rem; padding: 0.5rem 0.75rem; background: rgba(217,119,6,0.07); border-left: 2px solid var(--warm); border-radius: 0 6px 6px 0; font-size: 0.78rem; color: #92560a; line-height: 1.5; }
.card-actions { padding: 0.65rem 1rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; margin-top: auto; }
.btn {
  font-family: var(--body); font-size: 0.78rem; font-weight: 500; padding: 0.42rem 0.85rem;
  border-radius: 8px; border: 1px solid var(--border); cursor: pointer; transition: all 0.12s;
  background: transparent; color: var(--muted);
}
.btn:hover { color: var(--text); border-color: var(--border-strong); background: rgba(20,20,50,0.03); }
.btn-copy { background: var(--accent-soft); border-color: rgba(91,78,224,0.22); color: var(--accent); }
.btn-copy:hover { background: rgba(91,78,224,0.15); }
.btn-copy.copied { background: rgba(22,163,74,0.09); border-color: rgba(22,163,74,0.28); color: var(--ok); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #4c40c8; color: #fff; }
.no-results { text-align: center; padding: 3rem; color: var(--muted); }

/* ===================== INSTRUCTIONS ===================== */
.instr-section { display: none; }
.instr-section.visible { display: block; }
.instr-h1 { font-family: var(--head); font-size: 1.15rem; font-weight: 600; margin-bottom: 0.4rem; }
.instr-sub { font-size: 0.84rem; color: var(--muted); margin-bottom: 1.75rem; line-height: 1.5; }
.iblock { margin-bottom: 2rem; }
.iblock-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem; }
.iblock-title span { width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; }
.istep { display: flex; gap: 0.85rem; margin-bottom: 0.8rem; align-items: flex-start; }
.istep-n { width: 23px; height: 23px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; margin-top: 1px; background: var(--accent-soft); color: var(--accent); }
.istep-body { flex: 1; min-width: 0; }
.istep-title { font-size: 0.87rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.istep-desc { font-size: 0.82rem; color: #555577; line-height: 1.6; }
kbd { display: inline-block; background: var(--accent-soft); color: #4c42c0; border-radius: 5px; padding: 1px 6px; font-size: 0.78rem; font-family: monospace; margin: 1px; }
.warn { background: rgba(217,119,6,0.07); border-left: 3px solid var(--warm); border-radius: 0 8px 8px 0; padding: 0.65rem 0.9rem; margin: 0.6rem 0; font-size: 0.82rem; color: #92560a; line-height: 1.55; }
.tip { background: rgba(22,163,74,0.07); border-left: 3px solid var(--ok); border-radius: 0 8px 8px 0; padding: 0.65rem 0.9rem; margin: 0.6rem 0; font-size: 0.82rem; color: #145f30; line-height: 1.55; }
.info { background: rgba(14,165,154,0.07); border-left: 3px solid var(--accent2); border-radius: 0 8px 8px 0; padding: 0.65rem 0.9rem; margin: 0.6rem 0; font-size: 0.82rem; color: #0a6b63; line-height: 1.55; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.6rem 0; }
.fitem { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.79rem; }
.fitem b { color: var(--text); display: block; font-size: 0.77rem; margin-bottom: 1px; }
.fitem span { color: var(--muted); }
.instr-main table { width: 100%; border-collapse: collapse; }
.instr-main td, .instr-main th { padding: 7px 10px; border-bottom: 1px solid var(--border); }

/* card wrapper for instructions main */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem 1.9rem; box-shadow: var(--shadow-sm); min-width: 0;
}

/* ===================== CALCULATORS ===================== */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; align-items: start; }
.calc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.6rem; box-shadow: var(--shadow-sm);
}
.calc h3 { font-family: var(--head); font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.35rem; }
.calc .lead { font-size: 0.82rem; color: var(--muted); margin-bottom: 1.2rem; line-height: 1.5; }
.field { margin-bottom: 0.95rem; }
.field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; }
.field select, .field input[type="number"] {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.55rem 0.8rem; font-family: var(--body); font-size: 0.88rem; color: var(--text); outline: none;
}
.field select:focus, .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; cursor: pointer; margin-bottom: 0.5rem; }
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.calc-result {
  margin-top: 1.1rem; padding: 1.1rem 1.2rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(14,165,154,0.06));
  border: 1px solid rgba(91,78,224,0.16);
}
.calc-result .big { font-family: var(--head); font-size: 1.7rem; font-weight: 700; color: var(--accent); }
.calc-result .lbl { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.calc-result .breakdown { margin-top: 0.7rem; font-size: 0.82rem; color: #444466; line-height: 1.7; }
.calc-result .breakdown .row { display: flex; justify-content: space-between; gap: 1rem; }
.calc-result .breakdown .row b { color: var(--text); }

/* ===================== CHECKLISTS ===================== */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 1.25rem; align-items: start; }
.checklist {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.checklist > header { padding: 1.1rem 1.3rem 0.9rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.7rem; }
.checklist > header .cl-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.checklist > header h3 { font-family: var(--head); font-size: 0.95rem; font-weight: 600; }
.checklist > header p { font-size: 0.75rem; color: var(--muted); margin-top: 1px; }
.cl-items { padding: 0.6rem 0.5rem 0.9rem; }
.cl-item { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.5rem 0.85rem; border-radius: 9px; cursor: pointer; transition: background 0.12s; }
.cl-item:hover { background: rgba(20,20,50,0.025); }
.cl-item input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.cl-item span { font-size: 0.85rem; line-height: 1.5; color: var(--text); }
.cl-item input:checked + span { color: var(--muted); text-decoration: line-through; }
.cl-foot { padding: 0.6rem 1.3rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.cl-progress { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.cl-reset { font-size: 0.74rem; color: var(--accent); cursor: pointer; background: none; border: none; font-family: var(--body); font-weight: 600; }
.cl-reset:hover { text-decoration: underline; }

/* mistakes block */
.mistake { display: flex; gap: 0.8rem; padding: 0.85rem 1rem; border-radius: 10px; background: rgba(224,85,85,0.05); border: 1px solid rgba(224,85,85,0.15); margin-bottom: 0.7rem; }
.mistake .num { width: 24px; height: 24px; border-radius: 7px; background: rgba(224,85,85,0.14); color: var(--danger); font-weight: 700; font-size: 0.78rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mistake .m-body b { font-size: 0.85rem; }
.mistake .m-body p { font-size: 0.81rem; color: #555; margin-top: 2px; line-height: 1.5; }
.mistake .m-body .rule { font-size: 0.8rem; color: var(--ok); margin-top: 4px; font-weight: 500; }

/* ===================== CONTACTS ===================== */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; align-items: start; }
.info-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.6rem; box-shadow: var(--shadow-sm);
}
.info-card h3 { font-family: var(--head); font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.55rem; margin-bottom: 1rem; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--border); font-size: 0.86rem; align-items: center; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); flex-shrink: 0; }
.kv .v { font-weight: 600; text-align: right; word-break: break-word; }
.kv .copybtn { margin-left: 0.5rem; cursor: pointer; border: none; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 2px 7px; font-size: 0.7rem; font-family: var(--body); font-weight: 600; transition: all 0.12s; }
.kv .copybtn:hover { background: rgba(91,78,224,0.16); }
.kv .copybtn.copied { background: rgba(22,163,74,0.1); color: var(--ok); }
.contact-person { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0; border-bottom: 1px dashed var(--border); }
.contact-person:last-child { border-bottom: none; }
.contact-person .av { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--head); flex-shrink: 0; }
.contact-person .cp-name { font-weight: 600; font-size: 0.9rem; }
.contact-person .cp-role { font-size: 0.78rem; color: var(--muted); }
.contact-person a.tel { margin-left: auto; font-weight: 600; color: var(--accent); font-size: 0.86rem; white-space: nowrap; }
.linkbtn {
  display: inline-flex; align-items: center; gap: 0.45rem; background: var(--accent-soft);
  border: 1px solid rgba(91,78,224,0.2); color: var(--accent); padding: 0.5rem 0.9rem;
  border-radius: 10px; font-size: 0.84rem; font-weight: 600; transition: all 0.13s; margin: 0.25rem 0.4rem 0.25rem 0;
}
.linkbtn:hover { background: rgba(91,78,224,0.14); }

table.tariffs { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.tariffs th { text-align: left; padding: 0.6rem 0.7rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 2px solid var(--border); font-weight: 700; }
table.tariffs td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); }
table.tariffs tr:last-child td { border-bottom: none; }
table.tariffs td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }

/* ===================== FOOTER ===================== */
.foot { max-width: 1180px; margin: 0 auto; padding: 1.5rem; color: var(--muted); font-size: 0.78rem; position: relative; z-index: 1; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 0.7rem 1.2rem; border-radius: 11px;
  font-size: 0.85rem; font-weight: 500; opacity: 0; pointer-events: none; transition: all 0.25s;
  z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== ANIM ===================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.4s ease both; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.6rem; }
  .sidebar .nav-label { width: 100%; padding: 0.4rem 0.5rem 0.1rem; }
  .nav-item { border-left: none; border-radius: 8px; padding: 0.4rem 0.7rem; }
  .nav-item.active { border-left: none; }
}
@media (max-width: 640px) {
  .topnav-inner { flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem 1rem; }
  .nav-links { margin-left: 0; width: 100%; overflow-x: auto; }
  .wrap { padding: 1.25rem 1rem 3rem; }
  .hero { padding: 1.8rem 1.5rem; }
  .hero h1 { font-size: 1.5rem; }
  .cards { grid-template-columns: 1fr; }
  .panel { padding: 1.2rem 1.1rem; }
  .fgrid { grid-template-columns: 1fr; }
}

/* ===================== AUTH PAGES (login / shift / remarks / reconciliation) ===================== */

/* Login */
.login-wrap { min-height: 78vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 2.4rem 2.6rem; width: 100%; max-width: 420px; box-shadow: var(--shadow-md);
}
.login-logo {
  width: 58px; height: 58px; border-radius: 17px;
  background: linear-gradient(135deg, #5b4ee0, #0ea59a);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-size: 18px; font-weight: 700; color: #fff;
  margin: 0 auto 1.2rem; box-shadow: 0 8px 24px rgba(91,78,224,0.28);
}
.login-err {
  display: none; color: var(--danger); font-size: 0.83rem;
  background: rgba(224,85,85,0.07); border: 1px solid rgba(224,85,85,0.2);
  border-radius: 9px; padding: 0.6rem 0.85rem; margin-bottom: 0.9rem;
}
.login-btn {
  width: 100%; padding: 0.75rem; font-size: 0.95rem; font-weight: 600;
  background: var(--accent); color: #fff; border: none; border-radius: 12px;
  cursor: pointer; font-family: var(--body); transition: background 0.14s; margin-top: 0.4rem;
}
.login-btn:hover:not(:disabled) { background: #4c40c8; }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Generic auth-page add form */
.auth-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
}
.auth-form h4 { font-family: var(--head); font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.form-grid .field { margin-bottom: 0; }

/* Generic action buttons */
.btn-action {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 0.55rem 1.2rem; font-size: 0.86rem; font-weight: 600;
  cursor: pointer; font-family: var(--body); transition: background 0.14s;
}
.btn-action:hover:not(:disabled) { background: #4c40c8; }
.btn-action.secondary {
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(91,78,224,0.25);
}
.btn-action.secondary:hover { background: rgba(91,78,224,0.15); }
.btn-action.danger { background: var(--danger); }
.btn-action.danger:hover { background: #c83c3c; }
.btn-action:disabled { opacity: 0.5; cursor: not-allowed; }

/* Status badges (shared) */
.badge { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.badge-ok       { background: rgba(22,163,74,0.1); color: var(--ok); }
.badge-warn     { background: rgba(217,119,6,0.1); color: var(--warm); }
.badge-err      { background: rgba(224,85,85,0.1); color: var(--danger); }
.badge-info     { background: var(--accent-soft); color: var(--accent); }

/* Textarea field */
.field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.6rem 0.85rem; font-family: var(--body);
  font-size: 0.88rem; color: var(--text); outline: none; resize: vertical;
  min-height: 78px; transition: border-color 0.14s, box-shadow 0.14s;
}
.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Responsive for narrow screens — shift page */
@media (max-width: 640px) {
  .shift-type-grid { grid-template-columns: 1fr; }
  .rec-tabs, .rmk-tabs { flex-wrap: wrap; width: 100%; }
  .rec-tab, .rmk-tab { flex: 1; text-align: center; }
}
