/* =====================================================================
   ALEA BANGUNAN — Design tokens (Navy Edition)
   Palette:  ink #0B1A30 (deep navy) · beam #C9A227 (brass gold) ·
             rust #A8472E (clay/rust accent) · plaster #F1F3F6 (bg) ·
             steel #2E4258 (muted blue-steel panels) · smoke #7C8AA0 (secondary text)
   Type:     Oswald (display, condensed/industrial) · Inter (body) ·
             IBM Plex Mono (numbers, ids, prices)
   Signature: "rivet" corner dots on cards + horizontal stock gauges
   ===================================================================== */

:root{
  --ink:#0B1A30;
  --ink-soft:#132745;
  --beam:#C9A227;
  --beam-soft:#E4C766;
  --rust:#A8472E;
  --plaster:#F1F3F6;
  --plaster-dim:#E2E7ED;
  --steel:#2E4258;
  --smoke:#7C8AA0;
  --line: rgba(11,26,48,0.10);
  --shadow: 0 10px 30px rgba(11,26,48,0.10);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  background:var(--plaster);
  color:var(--ink);
  font-family:'Inter',system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4,.font-display{
  font-family:'Oswald',sans-serif;
  text-transform:uppercase;
  letter-spacing:0.03em;
  font-weight:600;
}

.mono{ font-family:'IBM Plex Mono',monospace; }

/* ---------- layout shell ---------- */
.shell{ display:flex; min-height:100vh; }

.sidebar{
  width:250px;
  flex-shrink:0;
  background:var(--ink);
  color:var(--plaster);
  display:flex;
  flex-direction:column;
  position:fixed;
  top:0; bottom:0; left:0;
  z-index:40;
  background-image:
    linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
}

.brand{
  padding:26px 22px 20px;
  border-bottom:1px solid rgba(225,232,240,0.10);
}
.brand-mark{
  display:flex; align-items:center; gap:10px;
}
.brand-mark .bolt{
  width:34px;height:34px;border-radius:3px;
  background:linear-gradient(135deg,var(--beam),#9c7a17);
  display:flex;align-items:center;justify-content:center;
  color:var(--ink); font-family:'Oswald',sans-serif; font-weight:700; font-size:16px;
  box-shadow: inset 0 0 0 2px rgba(6,14,26,0.35);
}
.brand-mark .name{
  font-family:'Oswald',sans-serif;
  font-size:17px; letter-spacing:0.06em; line-height:1.1;
}
.brand-mark .name small{
  display:block; font-family:'Inter',sans-serif; text-transform:none;
  letter-spacing:0; font-size:11px; color:var(--smoke); font-weight:400; margin-top:2px;
}

.nav{ padding:18px 12px; flex:1; }
.nav a{
  display:flex; align-items:center; gap:12px;
  padding:11px 14px; margin-bottom:4px;
  border-radius:4px;
  color:#B9C3D6;
  text-decoration:none;
  font-size:14px; font-weight:500;
  border-left:3px solid transparent;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.nav a:hover{ background:rgba(225,232,240,0.06); color:var(--plaster); }
.nav a.active{
  background:rgba(201,162,39,0.12);
  border-left-color:var(--beam);
  color:var(--beam-soft);
}
.nav a i{ width:18px; text-align:center; font-size:14px; }

.sidebar-foot{
  padding:16px 22px 22px; font-size:11px; color:var(--smoke);
  border-top:1px solid rgba(225,232,240,0.10);
}

/* ---------- main column ---------- */
.main{ margin-left:250px; flex:1; min-width:0; }

.topbar{
  height:74px;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 32px;
  background:var(--plaster);
  border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:30;
}
.topbar h1{ font-size:20px; margin:0; color:var(--ink); }
.topbar .eyebrow{
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:.08em;
  color:var(--rust); text-transform:uppercase; margin-bottom:2px; display:block;
}
.topbar .clock{
  font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--smoke);
}

.content{ padding:32px; }

/* ---------- rivet card (signature element) ---------- */
.card{
  position:relative;
  background:#fff;
  border:1px solid var(--line);
  border-radius:6px;
  box-shadow:var(--shadow);
  padding:24px;
}
.card::before, .card::after{
  content:'';
  position:absolute; top:9px; width:5px; height:5px; border-radius:50%;
  background:var(--plaster-dim);
  box-shadow: inset 0 0 0 1px rgba(6,14,26,0.15);
}
.card::before{ left:9px; }
.card::after{ right:9px; }

.card-beam{ border-left:4px solid var(--beam); }
.card-rust{ border-left:4px solid var(--rust); }

/* ---------- stat tiles ---------- */
.stat-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:18px;
  margin-bottom:28px;
}
.stat{
  background:var(--ink);
  color:var(--plaster);
  border-radius:6px;
  padding:20px 22px;
  position:relative;
  overflow:hidden;
}
.stat .label{
  font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--smoke); font-family:'IBM Plex Mono',monospace;
}
.stat .value{
  font-family:'IBM Plex Mono',monospace;
  font-size:30px; font-weight:600; margin-top:6px; color:var(--beam-soft);
  letter-spacing:0.01em;
}
.stat .sub{ font-size:12px; color:#93A2B9; margin-top:4px; }
.stat .icon{
  position:absolute; right:16px; top:16px; font-size:22px; color:rgba(201,162,39,0.35);
}

/* ---------- gauge (stok) ---------- */
.gauge{
  width:100%; height:7px; border-radius:99px; background:var(--plaster-dim);
  overflow:hidden; position:relative;
}
.gauge > span{
  display:block; height:100%; border-radius:99px;
  background:linear-gradient(90deg, var(--beam), var(--beam-soft));
}
.gauge.low > span{ background:linear-gradient(90deg, var(--rust), #d97a52); }
.gauge-row{ display:flex; align-items:center; gap:10px; min-width:150px; }
.gauge-row .gauge{ flex:1; }
.gauge-row .num{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--smoke); width:34px; text-align:right; }

/* ---------- table ---------- */
.table-wrap{ overflow-x:auto; }
table.data{ width:100%; border-collapse:collapse; font-size:14px; }
table.data thead th{
  text-align:left; padding:12px 14px;
  font-family:'Oswald',sans-serif; font-size:12px; letter-spacing:.06em;
  text-transform:uppercase; color:var(--smoke);
  border-bottom:2px solid var(--ink);
}
table.data tbody td{ padding:13px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
table.data tbody tr:hover{ background:var(--plaster); }
table.data td.mono, table.data th.mono{ font-family:'IBM Plex Mono',monospace; }

.badge{
  display:inline-block; padding:3px 10px; border-radius:99px;
  font-size:11px; font-weight:600; letter-spacing:.03em;
  background:rgba(201,162,39,0.14); color:#8A6B14;
}
.badge.rust{ background:rgba(181,80,42,0.12); color:var(--rust); }
.badge.steel{ background:rgba(63,75,84,0.10); color:var(--steel); }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 18px; border-radius:5px; border:none; cursor:pointer;
  font-family:'Inter',sans-serif; font-weight:600; font-size:13px;
  text-decoration:none; transition:transform .1s ease, filter .15s ease;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--ink); color:var(--beam-soft); }
.btn-primary:hover{ filter:brightness(1.3); }
.btn-ghost{ background:transparent; color:var(--ink); border:1px solid var(--line); }
.btn-ghost:hover{ background:var(--plaster-dim); }
.btn-icon{
  width:34px; height:34px; padding:0; justify-content:center;
  border-radius:5px; border:1px solid var(--line); background:#fff; color:var(--steel);
}
.btn-icon:hover{ background:var(--plaster-dim); }
.btn-icon.danger:hover{ background:#f7e4dd; color:var(--rust); }

/* ---------- forms / modal ---------- */
.field{ margin-bottom:16px; }
.field label{
  display:block; font-size:12px; text-transform:uppercase; letter-spacing:.05em;
  color:var(--smoke); margin-bottom:6px; font-weight:600;
}
.field input, .field select{
  width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:5px;
  font-family:'Inter',sans-serif; font-size:14px; background:var(--plaster);
  color:var(--ink);
}
.field input:focus, .field select:focus{
  outline:none; border-color:var(--beam); background:#fff;
  box-shadow:0 0 0 3px rgba(201,162,39,0.15);
}

.modal-backdrop{
  position:fixed; inset:0; background:rgba(6,14,26,0.60);
  display:none; align-items:center; justify-content:center; z-index:100; padding:20px;
}
.modal-backdrop.open{ display:flex; }
.modal{
  background:#fff; border-radius:8px; width:100%; max-width:440px;
  padding:26px; box-shadow:0 30px 60px rgba(0,0,0,0.3);
  animation:pop .15s ease;
}
@keyframes pop{ from{ transform:scale(.96); opacity:0; } to{ transform:scale(1); opacity:1; } }
.modal-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.modal-head h3{ margin:0; font-size:17px; }
.modal-close{ background:none; border:none; font-size:18px; color:var(--smoke); cursor:pointer; }

.toolbar{ display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.search-box{
  display:flex; align-items:center; gap:8px;
  background:#fff; border:1px solid var(--line); border-radius:5px;
  padding:9px 13px; min-width:240px;
}
.search-box input{ border:none; outline:none; font-size:13px; flex:1; background:transparent; }
.search-box i{ color:var(--smoke); }

.section-title{ display:flex; align-items:baseline; gap:10px; margin-bottom:18px; }
.section-title .idx{ font-family:'IBM Plex Mono',monospace; color:var(--beam); font-size:13px; }

/* responsive */
@media (max-width: 900px){
  .sidebar{ transform:translateX(-100%); transition:transform .2s ease; }
  .sidebar.open{ transform:translateX(0); }
  .main{ margin-left:0; }
  .content{ padding:18px; }
  .topbar{ padding:0 18px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible{
  outline:2px solid var(--beam); outline-offset:2px;
}
