/* ==========================================================================
   Хууль зүйн хэргийн удирдлагын систем — үндсэн загвар
   ========================================================================== */
:root {
  /* Primary Colors */
  --color-primary-dark: #234454;
  --color-primary-green: #09894E;
  --color-accent-green: #029C4C;
  --color-black: #000000;
  
  /* Legacy aliases for compatibility */
  --navy:        #234454;
  --navy-2:      #2b4558;
  --navy-3:      #3b5f73;
  --accent:      #09894E;
  --accent-soft: #eaf8f2;
  --gold:        #c7a36a;

  --ok:      #09894E;
  --ok-bg:   #e9f8f1;
  --warn:    #b7771d;
  --warn-bg: #fff2df;
  --err:     #b3261e;
  --err-bg:  #fdeceb;
  --info-bg: #edf5f9;

  --text:    #000000;
  --muted:   #597181;
  --line:    #dbe6eb;
  --line-2:  #edf3f5;
  --bg:      #f5f6f7;
  --card:    #ffffff;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(31,51,67,.06), 0 8px 26px rgba(31,51,67,.08);
  --mono: "Consolas", "SF Mono", ui-monospace, monospace;
}


* { box-sizing: border-box; }

html, body {
  margin: 0; 
  padding: 0;
  font-family: 'Segoe UI', 'Inter', Arial, 'Noto Sans Mongolian', sans-serif;
  font-size: 14px; 
  color: var(--color-black);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Байрлал ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-2) 0%, var(--navy) 100%);
  color: #d8e2ed;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.sidebar .brand {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.brand-logo {
  width: 100%;
  max-width: 200px;
  height: 56px;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto 12px;
  border-radius: 8px;
  /* Лого нь тунгалаг дэвсгэртэй, бараан navy үсэгтэй тул хажуугийн самбарын
     бараан дэвсгэр дээр уусч алга болдог. Цагаан суурь дээр байрлуулна. */
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  padding: 9px 12px;
  box-sizing: border-box;
}

.sidebar .brand .logo {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.sidebar .brand .sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.56);
  margin-top: 4px;
}

.nav {
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.nav::-webkit-scrollbar {
  width: 6px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.nav .group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.42);
  padding: 16px 20px 8px;
  font-weight: 700;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #d8e2ed;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
}

.nav a.active {
  background: rgba(47, 111, 237, 0.18);
  border-left-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.nav a .ic {
  width: 18px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav a .badge-n {
  margin-left: auto;
  background: var(--err);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar .foot {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.1);
}

.sidebar .foot .who {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 13px;
}

.sidebar .foot .role {
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  margin-bottom: 10px;
  font-weight: 500;
}

.sidebar .foot a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.sidebar .foot a:hover {
  color: #ffffff;
  text-decoration: none;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.topbar .spacer {
  flex: 1;
}

.topbar .date {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.content { padding: 24px 32px 48px; background: var(--bg); }

.management-heading { display:flex; justify-content:space-between; align-items:end; gap:16px; margin:0 0 16px; }
.management-heading h2 { margin:3px 0 0; font-size:20px; }
.eyebrow { color:var(--accent); font-size:10px; letter-spacing:1px; font-weight:700; }
.management-kpis { margin-bottom:18px; }
.management-funnel { margin-bottom:18px; }
.funnel-grid { display:flex; align-items:stretch; gap:10px; overflow-x:auto; }
.funnel-step { flex:1; min-width:150px; padding:15px; border:1px solid var(--line); border-radius:7px; background:var(--info-bg); display:flex; flex-direction:column; gap:3px; }
.funnel-step strong { font-size:24px; color:var(--navy); }
.funnel-step strong.money { font-size:19px; }
.brand-company { font-size:11.5px; color:var(--muted); margin-top:2px; letter-spacing:.2px; }
.funnel-step b { font-size:13px; }
.management-funnel .card-h .muted { font-weight:400; font-size:13px; }
.funnel-step span { color:var(--muted); font-size:13px; }
.funnel-arrow { align-self:center; color:var(--muted); font-size:20px; }
.management-panels { margin-bottom:18px; }
.workspace-head { display:flex; justify-content:space-between; align-items:end; gap:16px; margin-bottom:16px; }
.workspace-head h2 { margin:3px 0 0; font-size:20px; }
.work-kpis { margin-bottom:18px; }
.quick-actions { display:flex; gap:10px; flex-wrap:wrap; }
.payment-flow { text-align:center; padding-top:16px; }
.flow-value { font-size:25px; font-weight:700; color:var(--navy); }
.flow-arrow { color:var(--muted); font-size:20px; margin:6px 0; }
.ok-text { color:var(--ok); }
.err-text { color:var(--err); }
@media (max-width: 620px) { .workspace-head { align-items:start; flex-direction:column; } .workspace-head .btn { width:100%; text-align:center; } }
@media (max-width: 620px) { .management-heading { align-items:start; flex-direction:column; } .management-heading .btn { width:100%; text-align:center; } .funnel-arrow { display:none; } .funnel-grid { display:grid; grid-template-columns:1fr 1fr; } .funnel-step { min-width:0; } }

.case-stage-nav {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.case-stage-title { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.case-stage-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.case-stage-buttons .btn { min-width: 190px; justify-content: space-between; display: inline-flex; align-items: center; }
.case-stage-buttons .btn span { margin-left: 12px; border-radius: 10px; padding: 1px 7px; font-size: 11px; background: rgba(255,255,255,.22); }
.case-stage-buttons .stage-enforcement { background: var(--navy-2); color: #fff; }
.case-stage-buttons .stage-first { background: var(--warn-bg); color: var(--warn); }
.case-stage-buttons .stage-to-file { background: var(--info-bg); color: var(--accent); }
.case-stage-buttons .btn.active { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 620px) { .case-stage-buttons .btn { width: 100%; } }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.card > h2,
.card > .card-h {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  background: #fafbfd;
}

.card > .card-h .spacer {
  flex: 1;
}

.card-b {
  padding: 20px;
}

.card-b.tight {
  padding: 0;
}

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  display: block;
  color: inherit;
  transition: all 0.3s ease;
}

a.kpi:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.kpi.k-ok::before {
  background: var(--ok);
}

.kpi.k-warn::before {
  background: var(--warn);
}

.kpi.k-err::before {
  background: var(--err);
}

.kpi.k-gold::before {
  background: var(--gold);
}

.kpi .lbl {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.35;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi .val {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--navy);
}

.kpi .val.sm {
  font-size: 20px;
}

.kpi .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ---------- Хүснэгт ---------- */
.tbl-wrap {
  overflow-x: auto;
  border-radius: 12px;
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
}

table.tbl th {
  background: #f5f7f9;
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #2d3f4b;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

table.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}

table.tbl tbody tr {
  transition: background-color 0.2s ease;
}

table.tbl tbody tr:hover {
  background: #f9fbfd;
}

table.tbl tbody tr:last-child td {
  border-bottom: none;
}

table.tbl tfoot td {
  font-weight: 700;
  background: #f5f7f9;
  border-top: 2px solid var(--line);
  border-bottom: none;
  padding: 12px 14px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: var(--mono);
}

.nowrap {
  white-space: nowrap;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.tbl .clip {
  display: block;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.b-gray {
  background: #f0f2f6;
  color: #4a5a70;
  border-color: #e4ebf0;
}

.b-blue {
  background: var(--info-bg);
  color: #0066cc;
  border-color: #cde4f7;
}

.b-green {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #c8e3d9;
}

.b-amber {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #f0dcb0;
}

.b-red {
  background: var(--err-bg);
  color: var(--err);
  border-color: #f2c4c1;
}

.b-navy {
  background: #e8ecf5;
  color: #1f3343;
  border-color: #d0dce9;
}

.b-gold {
  background: #faf2df;
  color: #8a6d21;
  border-color: #f5e3b8;
}

/* ---------- Товч ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  line-height: 1.4;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  background: #f7f9fc;
  text-decoration: none;
  border-color: var(--line);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-accent-green);
  border-color: var(--color-accent-green);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 156, 76, 0.2);
}

.btn-dark {
  background: var(--navy-2);
  border-color: var(--navy-2);
  color: #ffffff;
}

.btn-dark:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
}

.btn-danger {
  color: var(--err);
  border-color: #f0c9c6;
}

.btn-danger:hover {
  background: var(--err-bg);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 600;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ---------- Форм ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

label.fl {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #2d3f4b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

label.fl .req {
  color: var(--err);
  margin-left: 2px;
}

input[type=text],
input[type=password],
input[type=date],
input[type=time],
input[type=number],
input[type=email],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  background: #ffffff;
  color: var(--text);
  transition: all 0.2s ease;
  font-weight: 500;
}

input::placeholder,
textarea::placeholder {
  color: #a8b8ca;
  font-weight: 400;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.02);
  background: #f8fbff;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line-2);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filters .fi {
  min-width: 140px;
}

.filters .fi.wide {
  min-width: 280px;
  flex: 1;
}

/* ---------- Мэдэгдэл ---------- */
.flash {
  padding: 10px 15px; border-radius: 8px; margin-bottom: 16px; font-size: 13px;
  font-weight: 500; border: 1px solid;
}
.flash.ok   { background: var(--ok-bg);   color: var(--ok);   border-color: #b8e2cd; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dcb0; }
.flash.err  { background: var(--err-bg);  color: var(--err);  border-color: #f2c4c1; }

/* ---------- Хэргийн дэлгэрэнгүй ---------- */
.detail-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1150px) { .detail-grid { grid-template-columns: 1fr; } }

table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv th {
  text-align: left; width: 190px; padding: 8px 12px; color: #4d5d74; font-weight: 600;
  background: #fafbfd; border-bottom: 1px solid var(--line-2); vertical-align: top;
}
table.kv td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }

.case-head {
  background: linear-gradient(180deg, var(--navy-2), var(--navy)); color: #fff;
  padding: 18px 20px; border-radius: var(--radius); margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.case-head h2 { margin: 0 0 6px; font-size: 20px; font-weight: 650; }
.case-head .meta { font-size: 12.5px; color: #b9c8de; display: flex; flex-wrap: wrap; gap: 14px; }
.case-head .chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.case-head .chips .badge { border: 1px solid rgba(255,255,255,.25); }

.stepper { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.stepper .st {
  font-size: 10.5px; padding: 4px 10px; border-radius: 4px;
  background: rgba(255,255,255,.08); color: #93a7c4; white-space: nowrap;
}
.stepper .st.done { background: rgba(255,255,255,.18); color: #dbe5f2; }
.stepper .st.cur  { background: var(--accent); color: #fff; font-weight: 700; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 4px 0 0 4px; }
.timeline li {
  position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 2px; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.timeline .t-date { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.timeline .t-type { font-weight: 650; font-size: 13px; margin: 1px 0 2px; }
.timeline .t-desc { font-size: 12.5px; color: #47566c; line-height: 1.5; }
.timeline .t-by { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- Bar ---------- */
.bar { height: 7px; background: var(--line-2); border-radius: 4px; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Брэндийн өнгө: #000000 хар · #274456 бараан teal · #068C4E ногоон ·
     #000080 бараан цэнхэр. Зөвхөн эдгээрийг зөөлөн уусгасан. */
  background:
    radial-gradient(760px 520px at 14% 14%, rgba(6, 140, 78, 0.22), transparent 62%),
    radial-gradient(720px 560px at 86% 88%, rgba(0, 0, 128, 0.30), transparent 64%),
    linear-gradient(152deg, #000000 0%, #274456 54%, #000000 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Дээрээс ногоон нимгэн туяа, доороос хар гүнзгийрүүлэлт */
  background:
    linear-gradient(180deg, rgba(6, 140, 78, 0.10), transparent 34%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.42), transparent 46%);
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.login-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 20px;
  z-index: 20;
  position: relative;
}

.login-logo-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px 20px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.30), 0 12px 32px rgba(0, 0, 0, 0.28);
  z-index: 21;
  position: relative;
  min-width: 0;
}

.login-logo-img {
  max-width: 200px;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.login-logo-img:hover {
  transform: scale(1.05);
}

.login-brand {
  position: absolute;
  bottom: -2000px;
  left: -2000px;
  padding: 48px;
  text-align: left;
  background: linear-gradient(135deg, #1a3a47 0%, #1f4a56 35%, #1e5968 70%, #174d60 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 
    0 2px 8px rgba(0,0,0,0.08),
    0 12px 40px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  min-height: 520px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  z-index: -1;
  visibility: hidden;
  pointer-events: none;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at -20% 0%, rgba(47,195,125,0.08), transparent 40%),
    radial-gradient(circle at 120% 80%, rgba(45,140,255,0.06), transparent 50%);
  pointer-events: none;
}

.login-brand::after {
  content: "";
  position: absolute;
  bottom: -40%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.03), transparent 70%);
  border-radius: 50%;
}

.brand-content {
  position: relative;
  z-index: 2;
}

.brand-icon {
  font-size: 48px;
  margin-bottom: 20px;
  display: block;
  line-height: 1;
}

.brand-title {
  font-size: 28px;
  line-height: 1.3;
  margin: 0 0 16px;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.78);
  margin: 0 0 32px;
  line-height: 1.65;
  font-weight: 500;
}

.brand-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 36px;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s ease;
}

.feature:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.12);
}

.feature-icon {
  font-size: 20px;
  flex-shrink: 0;
  display: block;
  line-height: 1.4;
}

.feature-text {
  font-size: 13px;
  color: rgba(255,255,255,0.86);
  font-weight: 500;
  line-height: 1.4;
}

.brand-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.09);
}

.company-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.72);
  margin: 0 0 6px;
  text-transform: uppercase;
}

.system-year {
  font-size: 11px;
  color: rgba(255,255,255,0.54);
  margin: 0;
}

/* Login Card */
.login-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 42px;
  width: 100%;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.28),
    0 18px 48px rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 22;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

/* Картны дээд ирмэгийн 4 өнгийн нимгэн зураас */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #068C4E 0%, #274456 52%, #000080 100%);
}

.login-header {
  margin-bottom: 28px;
  text-align: left;
  overflow: hidden;
  word-wrap: break-word;
}

.login-header h2 {
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--navy);
  font-weight: 800;
  letter-spacing: -0.01em;
  word-break: break-word;
  overflow-wrap: break-word;
}

.login-header p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Alert */
.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  border: 1px solid;
}

.alert-error {
  background: var(--err-bg);
  color: var(--err);
  border-color: #f0c9c6;
}

.alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  display: block;
  line-height: 1.4;
}

.alert-text {
  font-weight: 500;
  line-height: 1.4;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: #2d3f4b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.label-required {
  color: var(--err);
  font-size: 14px;
  line-height: 0.8;
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon {
  display: none;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: all 0.2s ease;
  font-weight: 500;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: #a8b8ca;
  font-weight: 400;
}

.form-input:focus {
  outline: none;
  border-color: #068C4E;
  box-shadow:
    0 0 0 3px rgba(6, 140, 78, 0.16),
    inset 0 1px 2px rgba(0, 0, 0, 0.02);
  background: #f7fcf9;
}

/* Submit Button (зөвхөн login хуудсанд) */
.login-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  background-color: var(--color-primary-green);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(9,137,78,0.2);
  font-family: inherit;
  text-transform: uppercase;
}

.login-submit-btn:hover {
  background-color: var(--color-accent-green);
  box-shadow: 0 4px 12px rgba(2,156,76,0.3);
  transform: translateY(-1px);
}

.login-submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(9,137,78,0.2);
}

.btn-arrow {
  font-size: 16px;
  font-weight: 800;
}

/* Login Footer */
.login-footer {
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.security-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #4a5f6f;
  margin: 0;
  font-weight: 500;
  line-height: 1.5;
}

.notice-icon {
  font-size: 14px;
  flex-shrink: 0;
  display: block;
  line-height: 1.4;
}

.support-text {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
  font-weight: 400;
  text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .login-container {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .login-wrap {
    padding: 16px;
  }
  
  .login-container {
    width: 100%;
  }
  
  .login-logo-img {
    max-width: 150px;
  }
  
  .login-card {
    padding: 32px 24px;
  }
  
  .login-header h2 {
    font-size: 20px;
  }
  
  .form-input-wrapper {
    margin-bottom: 6px;
  }
}

@media (max-width: 480px) {
  .login-wrap {
    padding: 12px;
  }
  
  .login-container {
    width: 100%;
  }
  
  .login-logo-section {
    padding: 12px;
  }
  
  .login-logo-img {
    max-width: 120px;
  }
  
  .login-card {
    padding: 24px 16px;
  }
  
  .login-header h2 {
    font-size: 18px;
    margin-bottom: 4px;
  }
  
  .login-submit-btn {
    min-height: 44px;
    font-size: 13px;
  }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tabs a, .tabs button {
  padding: 9px 15px; font-size: 13px; font-weight: 600; color: var(--muted);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent;
  font-family: inherit;
}
.tabs a.active, .tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Бусад ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1050px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.b { font-weight: 650; }
.mt { margin-top: 14px; }
.sep { height: 1px; background: var(--line-2); margin: 14px 0; }

details.acc > summary {
  cursor: pointer; padding: 9px 0; font-weight: 650; font-size: 13px; list-style: none;
}
details.acc > summary::marker { display: none; }
details.acc > summary::before { content: "▸ "; color: var(--accent); }
details.acc[open] > summary::before { content: "▾ "; }

@media print {
  .sidebar, .topbar, .filters, .form-actions, .btn { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; page-break-inside: avoid; }
}
