/* Gudang DC — enterprise interface system */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-tint: #eef8f7;
  --text: #132238;
  --text-soft: #40516a;
  --muted: #708097;
  --line: #dfe7f0;
  --line-strong: #cbd7e5;
  --primary: #087f7b;
  --primary-strong: #056763;
  --primary-soft: #e6f6f4;
  --navy: #071b32;
  --navy-soft: #102b48;
  --success: #16845b;
  --danger: #d14343;
  --warning: #d68b1f;
  --info: #2475bc;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 35, 58, .04), 0 5px 14px rgba(15, 35, 58, .05);
  --shadow: 0 12px 35px rgba(15, 35, 58, .08);
  --shadow-lg: 0 24px 65px rgba(5, 24, 43, .16);
  --sidebar-width: 280px;
  --topbar-height: 76px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 100% 0, rgba(8, 127, 123, .07), transparent 26rem),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
:focus-visible { outline: 3px solid rgba(8, 127, 123, .22); outline-offset: 2px; }
::selection { color: #fff; background: var(--primary); }

/* Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  overflow: hidden auto;
  color: #dce8f5;
  background:
    radial-gradient(circle at 15% -5%, rgba(26, 178, 169, .23), transparent 18rem),
    linear-gradient(180deg, #0a223b 0%, #06182c 100%);
  box-shadow: 10px 0 30px rgba(5, 23, 41, .08);
  transition: width .24s ease, transform .24s ease;
  scrollbar-width: thin;
  scrollbar-color: #35506b transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #35506b; border-radius: 999px; }
.brand {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(7, 27, 50, .88);
  backdrop-filter: blur(14px);
}
.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #19a99f, #087f7b);
  box-shadow: 0 9px 22px rgba(8,127,123,.3), inset 0 1px rgba(255,255,255,.25);
  font-weight: 800;
  letter-spacing: -.04em;
}
.brand-mark::after { content: ""; position: absolute; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.14); transform: rotate(45deg); }
.brand strong { display: block; color: #fff; font-size: 15px; letter-spacing: .01em; }
.brand span { display: block; margin-top: 1px; color: #88a2bd; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.nav { padding: 14px 12px 28px; }
.nav::before { content: "Navigasi utama"; display: block; padding: 5px 11px 10px; color: #718ca8; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-link, .nav-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 43px;
  margin: 2px 0;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  color: #b8c9da;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.nav-link > i:first-child { display: grid; flex: 0 0 21px; width: 21px; place-items: center; color: #7f9ab5; font-size: 14px; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-link:hover > i:first-child { color: #55d3c9; }
.nav-link.active, .nav-group.active > .nav-toggle { color: #fff; background: linear-gradient(90deg, rgba(17,154,146,.31), rgba(17,154,146,.11)); box-shadow: inset 3px 0 #27c1b7; }
.nav-link.active > i:first-child, .nav-group.active > .nav-toggle > i:first-child { color: #58ddd3; }
.nav-caret { margin-left: auto; color: #718ca8; font-size: 10px; transition: transform .2s ease; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-group:not(.open) .nav-sub { display: none; }
.nav-sub { position: relative; margin: 3px 0 8px 31px; padding: 3px 0 3px 17px; border-left: 1px solid rgba(255,255,255,.12); }
.nav-sub a { position: relative; display: block; padding: 7px 10px; border-radius: 8px; color: #91a7bd; font-size: 12px; transition: .18s ease; }
.nav-sub a::before { content: ""; position: absolute; left: -20px; top: 50%; width: 6px; height: 6px; border: 2px solid #6e879e; border-radius: 50%; background: #071b32; transform: translateY(-50%); }
.nav-sub a:hover, .nav-sub a.active { color: #fff; background: rgba(255,255,255,.06); }
.nav-sub a.active::before { border-color: #43cfc5; background: #43cfc5; box-shadow: 0 0 0 4px rgba(67,207,197,.12); }
.main-shell { display: flex; flex-direction: column; width: calc(100% - var(--sidebar-width)); min-height: 100vh; margin-left: var(--sidebar-width); transition: margin .24s ease, width .24s ease; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: var(--topbar-height);
  padding: 10px clamp(18px, 2.3vw, 32px);
  border-bottom: 1px solid rgba(205,217,230,.85);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
}
.topbar-title { min-width: 0; }
.topbar h1 { overflow: hidden; margin: 0; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.3; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.topbar span { display: block; color: var(--muted); font-size: 11px; }
.topbar-user { display: flex; align-items: center; gap: 11px; margin-left: auto; text-align: right; }
.user-avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #cfe2e1; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-weight: 800; text-transform: uppercase; }
.content { flex: 1; width: 100%; max-width: 1680px; margin: 0 auto; padding: clamp(18px, 2.3vw, 32px); }
.footer { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(18px, 2.3vw, 32px); border-top: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.72); font-size: 12px; }
.footer::after { content: "Secure • Accurate • Traceable"; color: #94a3b8; letter-spacing: .04em; }
.desktop-collapse { display: inline-flex; }
.icon-btn { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--text-soft); background: #fff; cursor: pointer; }
.sidebar-scrim { position: fixed; inset: 0; z-index: 25; visibility: hidden; background: rgba(4,18,33,.56); opacity: 0; transition: .2s ease; backdrop-filter: blur(2px); }

body.sidebar-collapsed .sidebar { width: 78px; }
body.sidebar-collapsed .main-shell { width: calc(100% - 78px); margin-left: 78px; }
body.sidebar-collapsed .brand { justify-content: center; padding-inline: 10px; }
body.sidebar-collapsed .brand > div:last-child, body.sidebar-collapsed .nav::before, body.sidebar-collapsed .nav-link span, body.sidebar-collapsed .nav-caret, body.sidebar-collapsed .nav-sub { display: none; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 11px; }
body.sidebar-collapsed .nav-link:hover { transform: none; }

/* Content primitives */
h1, h2, h3, h4 { color: var(--text); line-height: 1.3; }
h2, h3 { letter-spacing: -.02em; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h2, .page-head h3 { margin: 0; }
.page-subtitle { margin: -10px 0 20px; color: var(--muted); }
.muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  position: relative;
  min-width: 0;
  margin-bottom: 18px;
  padding: clamp(17px, 2vw, 22px);
  border: 1px solid rgba(217,227,237,.95);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card > h3:first-child { margin: 0 0 17px; font-size: 16px; }
.card:hover { border-color: #d2dfea; }
.kpi { display: flex; justify-content: space-between; }
.kpi strong { display: block; margin-top: 8px; font-size: 26px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-soft);
  background: #fff;
  box-shadow: 0 1px 1px rgba(15,35,58,.03);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(15,35,58,.11); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #0c918a, #087873); border-color: #087873; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #087f7b, #056763); }
.btn-secondary { border-color: var(--line); background: #fff; }
.btn-secondary:hover:not(:disabled) { border-color: #bfcddd; background: var(--surface-soft); }
.btn-success { color: #fff; background: var(--success); border-color: var(--success); }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-warning { color: #fff; background: var(--warning); border-color: var(--warning); }

/* Forms */
.filter, .form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 14px; margin-bottom: 18px; }
.filter-master { grid-template-columns: minmax(210px, 1.25fr) repeat(2, minmax(150px, 1fr)) minmax(110px, .72fr) minmax(110px, .72fr); }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; margin-bottom: 13px; }
.field label { display: flex; align-items: center; min-height: 20px; margin-bottom: 6px; color: #35475f; font-size: 12px; font-weight: 750; }
input, select, textarea {
  width: 100%;
  min-height: 41px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15,35,58,.025);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: #9aa8b9; }
input:hover, select:hover, textarea:hover { border-color: #aebfd1; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,127,123,.12); }
input[readonly], .transaction-table input[readonly], .lookup-control input[readonly] { color: #3c4c62; background: #f4f7fa; }
textarea { min-height: 92px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; accent-color: var(--primary); }
.lookup-control { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }

/* Tables */
.table-wrap { position: relative; width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; scrollbar-width: thin; scrollbar-color: #bdc9d7 #f2f5f8; }
.table-wrap::after { content: ""; position: sticky; right: 0; display: block; width: 1px; height: 1px; }
table { width: 100%; border-spacing: 0; border-collapse: separate; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 13px; border-bottom: 1px solid #e7edf3; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; color: #53647a; background: #f5f8fb; box-shadow: inset 0 -1px #dfe7f0; font-size: 10px; font-weight: 800; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { color: #34465d; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s ease; }
tbody tr:hover td { background: #f7fbfb; }
.num { text-align: right; white-space: nowrap; }
.transaction-table { min-width: 820px; }
.transaction-table .row-actions { width: 74px; }
.subtotal td, tr.subtotal td { background: #f4f8fa; font-weight: 700; }
.grand td, tr.grand td { background: #e9f6f4; color: #075e5a; font-weight: 800; }
.section-title td, tr.section-title td { background: #edf2f7; font-weight: 800; }
.table-info { margin: 0 0 10px; color: var(--muted); font-size: 12px; }

/* Status and messaging */
.alert { position: relative; margin-bottom: 16px; padding: 12px 15px 12px 43px; border: 1px solid; border-radius: 10px; box-shadow: var(--shadow-sm); }
.alert::before { position: absolute; left: 15px; top: 12px; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.alert-success { color: #12603f; border-color: #b8e3cd; background: #edf9f2; }
.alert-success::before { content: "\f058"; }
.alert-danger { color: #8e2f2f; border-color: #f0c2c2; background: #fff2f2; }
.alert-danger::before { content: "\f06a"; }
.alert-warning { color: #805611; border-color: #eed7a9; background: #fff9e9; }
.alert-warning::before { content: "\f071"; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.badge-success { color: #126343; background: #dff5e9; }
.badge-danger { color: #9c3030; background: #fde5e5; }
.badge-warning { color: #86590e; background: #fff0cf; }
.badge-primary { color: #086d68; background: #ddf4f1; }
.badge-info { color: #1c639f; background: #e3f1fc; }
.badge-secondary, .badge-muted { color: #556579; background: #edf1f5; }
.status-critical td { background: #fff8f0; }
.empty-state { display: grid; min-height: 180px; place-items: end center; padding: 130px 18px 18px; color: var(--muted); background: url("../images/inventory-vignette.jpg") center 12px / 185px auto no-repeat; text-align: center; }

/* Details, documents and pagination */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.detail-grid div, .doc-meta div { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fb; }
.detail-grid span, .doc-meta span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.detail-grid strong { display: block; overflow-wrap: anywhere; font-weight: 650; }
.doc-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.doc-meta strong { display: block; margin-top: 4px; }
.doc-total-box { max-width: 450px; margin: 16px 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.doc-total-box div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.doc-total-box div:last-child { border-bottom: 0; color: #075e5a; background: #eaf7f5; }
.doc-total-box span { color: var(--muted); font-weight: 650; }
.doc-total-box div:last-child strong { font-size: 19px; }
.signature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; margin-top: 42px; text-align: center; }
.signature-line { margin-top: 56px; padding-top: 8px; border-top: 1px solid #111; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.pagination a, .pagination span { display: grid; min-width: 35px; min-height: 35px; place-items: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 650; }
.pagination a:hover { border-color: #acd6d2; color: var(--primary); background: var(--primary-soft); }
.pagination .active { color: #fff; border-color: var(--primary); background: var(--primary); }

/* Modals and lookup */
.modal-backdrop { position: fixed; inset: 0; z-index: 99; display: grid; overflow: auto; place-items: center; padding: 20px; background: rgba(5,21,38,.62); backdrop-filter: blur(5px); animation: fadeIn .16s ease; }
.modal { width: min(430px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 22px; border: 1px solid rgba(255,255,255,.35); border-radius: 15px; background: #fff; box-shadow: var(--shadow-lg); animation: modalIn .2s ease; }
.modal-wide { width: min(940px,100%); }
.modal-actions { position: sticky; bottom: -22px; display: flex; justify-content: flex-end; gap: 9px; margin: 18px -22px -22px; padding: 13px 22px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.confirm-head { display: flex; align-items: flex-start; gap: 13px; }
.confirm-head h3 { margin: 0 0 5px; }
.confirm-head p { margin: 0; color: var(--muted); }
.confirm-icon { display: grid; flex: 0 0 auto; width: 43px; height: 43px; place-items: center; border-radius: 50%; font-weight: 800; }
.confirm-icon.danger { color: #9b3030; background: #fde6e6; }
.confirm-icon.warning { color: #8a5c10; background: #fff0ce; }
.confirm-icon.success { color: #146140; background: #dff5e9; }
.lookup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.lookup-head h3 { margin: 0; }
.lookup-body { max-height: 56vh; margin-top: 13px; overflow: auto; }
.lookup-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; margin-bottom: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; transition: .14s ease; }
.lookup-row:hover { border-color: #aed5d2; background: #f3fbfa; }
.lookup-row.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(8,127,123,.08); }
.lookup-row strong { display: block; }
.lookup-row span { display: block; color: var(--muted); font-size: 11px; }
.lookup-more { padding: 10px; color: var(--muted); font-size: 11px; text-align: center; }
.lookup-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fb; }
.lookup-chip span { color: #334155; font-weight: 650; }
.lookup-check-wrap { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 700; cursor: pointer; }
.lookup-selected-count { margin-right: auto; color: var(--muted); font-weight: 700; }
.lookup-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Dashboard */
.dashboard-hero {
  position: relative;
  display: flex;
  min-height: 245px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  margin-bottom: 19px;
  padding: clamp(24px,4vw,42px);
  border: 1px solid rgba(43,94,124,.42);
  border-radius: var(--radius-lg);
  color: #fff;
  background: #061a30 url("../images/dc-command-center.jpg") center / cover no-repeat;
  box-shadow: 0 18px 45px rgba(5,25,45,.18);
}
.dashboard-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,21,39,.18), transparent 60%); pointer-events: none; }
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero span { color: #82d9d3; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.dashboard-hero h2 { margin: 8px 0 8px; color: #fff; font-size: clamp(30px,4vw,45px); letter-spacing: -.045em; }
.dashboard-hero p { max-width: 650px; margin: 0; color: #c3d4e5; font-size: 14px; }
.hero-date { min-width: 128px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.17); border-radius: 11px; background: rgba(6,26,48,.52); backdrop-filter: blur(8px); text-align: right; }
.hero-date strong { display: block; color: #fff; font-size: 17px; }
.hero-date span { color: #8eadc9; letter-spacing: .03em; text-transform: none; }
.dashboard-kpis { margin-bottom: 18px; }
.dashboard-kpis .card { margin-bottom: 0; }
.pro-kpi { min-height: 148px; overflow: hidden; }
.pro-kpi::after { content: ""; position: absolute; right: -25px; bottom: -34px; width: 96px; height: 96px; border-radius: 50%; background: rgba(8,127,123,.055); }
.pro-kpi > i { position: absolute; right: 17px; top: 17px; display: grid; width: 41px; height: 41px; place-items: center; border: 1px solid #d6ebe9; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.dashboard-kpis .pro-kpi span, .dashboard-kpis .pro-kpi strong, .dashboard-kpis .pro-kpi small { display: block; }
.pro-kpi span { max-width: calc(100% - 54px); color: var(--text-soft); font-size: 12px; font-weight: 700; }
.pro-kpi strong { max-width: 88%; margin-top: 17px; overflow: hidden; color: var(--text); font-size: clamp(20px,2.1vw,28px); letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.pro-kpi small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.pipeline-chart { display: grid; height: 260px; grid-template-columns: repeat(6,1fr); align-items: end; gap: 12px; padding-top: 12px; }
.pipe-item { display: flex; height: 100%; flex-direction: column; justify-content: flex-end; gap: 9px; }
.pipe-item div { min-height: 57px; }
.pipe-item span { display: block; color: var(--muted); font-size: 10px; }
.pipe-item strong { font-size: 18px; }
.pipe-item b { display: block; min-height: 10px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg,#16a49c,#73d8d1); box-shadow: inset 0 1px rgba(255,255,255,.35); }
.chart-bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px,1fr) 2fr auto; align-items: center; gap: 11px; }
.bar-row span { overflow: hidden; color: #3a4b61; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e8eef3; }
.bar-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#087f7b,#4fc5bd); }
.bar-row strong { color: #405168; font-size: 11px; font-variant-numeric: tabular-nums; }

/* Authentication */
.auth-page { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; padding: clamp(18px,4vw,48px); background: #071b32; }
.auth-page::before { content: ""; position: fixed; inset: 0; opacity: .16; background-image: radial-gradient(rgba(255,255,255,.28) .7px, transparent .7px); background-size: 18px 18px; pointer-events: none; }
.login-shell { position: relative; display: grid; width: min(1240px,100%); min-height: min(720px,calc(100vh - 60px)); grid-template-columns: minmax(0,1.55fr) minmax(360px,.65fr); overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 24px; background: #fff; box-shadow: 0 40px 100px rgba(0,0,0,.32); }
.login-panel { position: relative; display: flex; min-height: 650px; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(28px,4.5vw,60px); color: #fff; background: #071b32 url("../images/warehouse-login-hero.jpg") center / cover no-repeat; }
.login-panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,19,35,.92), rgba(5,23,42,.47) 60%, rgba(5,23,42,.08)); }
.login-panel > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong { display: block; color: #fff; font-size: 16px; }
.login-brand span { display: block; color: #91aac2; font-size: 11px; }
.login-brand-logo { display: grid; width: 46px; height: 46px; overflow: hidden; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.login-brand-logo img { display: block; width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.login-copy { margin: auto 0; padding: 40px 0; }
.login-panel h1 { max-width: 720px; margin: 0 0 16px; color: #fff; font-size: clamp(31px,4.2vw,53px); line-height: 1.08; letter-spacing: -.05em; }
.login-panel p { max-width: 650px; margin: 0; color: #c4d2df; font-size: 15px; }
.login-module-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.login-module-list span { padding: 7px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #d5e2ec; background: rgba(7,27,50,.48); font-size: 11px; }
.login-panel-note { color: #a9bed1; font-size: 11px; }
.login-panel-note i { margin-right: 5px; color: #55d3ca; }
.auth-card { width: min(430px,100%); padding: 30px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.login-card { align-self: center; justify-self: center; width: min(390px,calc(100% - 52px)); border: 0; box-shadow: none; }
.login-card h2 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.035em; }
.login-card form { margin-top: 24px; }
.login-card .field { margin-bottom: 15px; }
.login-card input { min-height: 46px; padding-left: 39px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; z-index: 1; left: 13px; top: 50%; color: #8d9cad; transform: translateY(-50%); }
.password-toggle { position: absolute; z-index: 2; right: 7px; top: 50%; width: 33px; height: 33px; border: 0; border-radius: 8px; color: #7d8da0; background: transparent; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.login-note { margin-top: 18px; padding: 10px 12px; border: 1px solid #dceae8; border-radius: 9px; color: #526478; background: #f3f9f8; font-size: 11px; text-align: center; }

/* Company profile */
.page-kicker { display: block; margin-bottom: 4px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.company-page-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.company-profile-layout { display: grid; grid-template-columns: minmax(250px,320px) minmax(0,1fr); align-items: start; gap: 18px; }
.company-logo-card { position: sticky; top: calc(var(--topbar-height) + 18px); }
.company-logo-card h3, .company-section-head h3 { margin: 0; font-size: 16px; }
.company-logo-card > div:nth-child(2) { margin: 18px 0 15px; }
.company-logo-card .muted, .company-section-head p { margin: 5px 0 0; font-size: 11px; }
.company-logo-preview { display: grid; aspect-ratio: 4 / 3; overflow: hidden; place-items: center; border: 1px solid #dce5ed; border-radius: 15px; background: linear-gradient(145deg,#f8fbfc,#edf4f5); }
.company-logo-preview img { display: block; width: 100%; height: 100%; padding: 20px; object-fit: contain; }
.company-logo-placeholder { display: grid; gap: 8px; place-items: center; color: #8b9bac; font-size: 11px; }
.company-logo-placeholder i { font-size: 34px; color: #b2c2d0; }
.logo-upload-control { display: flex; min-height: 58px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed #9ebbb9; border-radius: 11px; color: #31535a; background: #f3f9f8; cursor: pointer; transition: border-color .2s,background .2s; }
.logo-upload-control:hover { border-color: var(--primary); background: #eaf6f4; }
.logo-upload-control > i { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #fff; background: var(--primary); }
.logo-upload-control span, .logo-upload-control strong, .logo-upload-control small { display: block; min-width: 0; }
.logo-upload-control strong { font-size: 12px; }
.logo-upload-control small { max-width: 190px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.company-logo-note { display: flex; gap: 7px; margin: 13px 0 0; color: #65778c; font-size: 10px; line-height: 1.55; }
.company-logo-note i { margin-top: 2px; color: var(--primary); }
.company-data-card { padding: 24px; }
.company-section-head { padding-bottom: 17px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.company-data-card .field-full { grid-column: 1 / -1; }
.company-data-card .required { margin-left: 3px; color: #b73737; }
.company-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 8px -24px -24px; padding: 16px 24px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: #f8fafc; }
.company-form-actions > span { color: var(--muted); font-size: 10px; }
.company-form-actions > span i { margin-right: 4px; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-master { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .login-shell { grid-template-columns: minmax(0,1.25fr) minmax(350px,.75fr); }
}
@media (max-width: 960px) {
  .sidebar { width: min(86vw,var(--sidebar-width)); transform: translateX(-105%); }
  .sidebar.open { transform: none; }
  .sidebar.open + .sidebar-scrim, body.sidebar-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .main-shell, body.sidebar-collapsed .main-shell { width: 100%; margin-left: 0; }
  .icon-btn { display: inline-flex; }
  .desktop-collapse { display: none; }
  .grid-2, .filter, .form-grid, .detail-grid, .doc-meta { grid-template-columns: 1fr; }
  .dashboard-hero { min-height: 230px; }
  .pipeline-chart { grid-template-columns: repeat(3,1fr); height: 340px; }
  .login-shell { min-height: auto; grid-template-columns: 1fr; }
  .login-panel { min-height: 430px; }
  .login-card { width: min(560px,100%); padding: 34px; }
  .company-profile-layout { grid-template-columns: 1fr; }
  .company-logo-card { position: static; }
}
@media (max-width: 640px) {
  :root { --topbar-height: 68px; }
  .topbar { padding-inline: 14px; }
  .topbar-user > div:not(.user-avatar) { display: none; }
  .topbar-user .btn span { display: none; }
  .topbar-user .btn { width: 38px; min-height: 38px; padding: 0; }
  .content { padding: 15px; }
  .footer { padding: 16px; }
  .footer::after { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .grid, .grid-4 { grid-template-columns: 1fr; gap: 14px; }
  .card { margin-bottom: 14px; padding: 16px; }
  .dashboard-hero { min-height: 330px; align-items: flex-start; flex-direction: column; padding: 24px 20px; background-position: 62% center; }
  .dashboard-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(4,21,39,.2),rgba(4,21,39,.74)); }
  .dashboard-hero > * { z-index: 2; }
  .hero-date { align-self: flex-end; margin-top: auto; }
  .pro-kpi { min-height: 135px; }
  .pipeline-chart { grid-template-columns: repeat(2,1fr); height: 440px; }
  .bar-row { grid-template-columns: minmax(90px,1fr) 1.3fr; }
  .bar-row strong { grid-column: 2; }
  .filter .btn, .form-grid .btn { width: 100%; }
  .actions { gap: 6px; }
  .actions .btn-sm { min-height: 34px; }
  th, td { padding: 10px 11px; }
  .modal-backdrop { place-items: end center; padding: 10px; }
  .modal { width: 100%; max-height: calc(100vh - 20px); border-radius: 16px; }
  .login-shell { border-radius: 17px; }
  .login-panel { min-height: 470px; padding: 25px 22px; background-position: 64% center; }
  .login-copy { padding: 34px 0; }
  .login-panel h1 { font-size: 33px; }
  .login-card { padding: 29px 22px 32px; }
  .company-data-card { padding: 18px; }
  .company-form-actions { align-items: stretch; flex-direction: column; margin: 8px -18px -18px; padding: 15px 18px; }
  .company-form-actions .btn { width: 100%; }
}
@media (max-width: 420px) {
  .login-panel { min-height: 510px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  body { background: #fff; }
  .sidebar, .sidebar-scrim, .topbar, .footer, .filter, .actions, .btn { display: none !important; }
  .main-shell, .content { width: 100%; margin: 0; padding: 0; }
  .card { border: 0; box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; border-color: #bbb; }
  th { position: static; }
}
