/* ============================================================
   Logistics MCU System - tema korporat (biru, merah, hijau)
   ============================================================ */
:root {
  --blue: #0b5cab; --blue-dark: #08447f; --red: #e31e24; --green: #5fb336;
  --navy: #0a1f3c; --navy-2: #123560;
  --bg: #f2f5fa; --ink: #1c2a3e; --muted: #6b7a90; --line: #e3e9f2;
  --bs-primary: #0b5cab; --bs-primary-rgb: 11, 92, 171;
  --bs-link-color: #0b5cab; --bs-link-hover-color: #08447f;
  --sidebar-w: 264px;
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); font-size: .93rem; }
h1, h2, h3, h4, h5 { letter-spacing: -.01em; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .5rem 1rem; }
.btn-sm { padding: .3rem .7rem; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--blue); --bs-btn-border-color: var(--blue); --bs-btn-hover-bg: var(--blue-dark); --bs-btn-hover-border-color: var(--blue-dark); --bs-btn-active-bg: var(--blue-dark); --bs-btn-active-border-color: var(--blue-dark); --bs-btn-disabled-bg: var(--blue); --bs-btn-disabled-border-color: var(--blue); }
.btn-outline-primary { --bs-btn-color: var(--blue); --bs-btn-border-color: var(--blue); --bs-btn-hover-bg: var(--blue); --bs-btn-hover-border-color: var(--blue); --bs-btn-active-bg: var(--blue-dark); }
.btn-danger { --bs-btn-bg: var(--red); --bs-btn-border-color: var(--red); --bs-btn-hover-bg: #c5161c; --bs-btn-hover-border-color: #c5161c; }
.btn-success { --bs-btn-bg: #4ea02a; --bs-btn-border-color: #4ea02a; --bs-btn-hover-bg: #3f8a20; --bs-btn-hover-border-color: #3f8a20; }
.form-control, .form-select { border-radius: 10px; border-color: #d5dde9; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .2rem rgba(11, 92, 171, .15); }
.form-label { font-size: .8rem; font-weight: 600; color: #3b4a60; margin-bottom: .3rem; }

/* ---------- Sidebar ---------- */
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #c5d2e6; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease; }
.sidebar::before { content: ""; flex: 0 0 4px; background: linear-gradient(90deg, var(--red) 0 33.3%, var(--blue) 33.3% 66.6%, var(--green) 66.6% 100%); }
.brand { display: flex; align-items: center; gap: .8rem; padding: 1.4rem 1.3rem 1.2rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand img { height: 40px; width: auto; background: #fff; border-radius: 8px; padding: 4px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--red), #ff5a5f); color: #fff; font-size: 1.25rem; box-shadow: 0 6px 16px rgba(227, 30, 36, .4); }
.brand-title { color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.15; }
.brand-sub { font-size: .72rem; color: #8fa5c4; letter-spacing: .02em; }
.nav-menu { padding: 1rem .8rem; flex: 1; overflow-y: auto; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #6f86a8; padding: .6rem .8rem; }
.nav-item-x { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 10px; color: #c5d2e6; text-decoration: none; font-weight: 500; margin-bottom: 3px; transition: all .15s; }
.nav-item-x i { font-size: 1.05rem; width: 20px; text-align: center; }
.nav-item-x:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item-x.active { background: linear-gradient(90deg, rgba(11, 92, 171, .95), rgba(11, 92, 171, .55)); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.nav-count { margin-left: auto; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 20px; }
.sidebar-user { padding: 1rem 1.2rem; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: .75rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), #3d8fe0); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.su-name { color: #fff; font-weight: 600; font-size: .86rem; line-height: 1.2; }
.su-role { font-size: .72rem; color: #8fa5c4; }
.su-out { margin-left: auto; color: #9db2d0; font-size: 1.15rem; }
.su-out:hover { color: #fff; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(8, 20, 40, .55); z-index: 1035; }

/* ---------- Main ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: .8rem 1.75rem; display: flex; align-items: center; gap: .9rem; }
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.topbar-date { margin-left: auto; color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: .4rem; }
.btn-menu { display: none; border: 0; background: transparent; font-size: 1.5rem; padding: 0 .3rem; color: var(--ink); }
.content { padding: 1.75rem; flex: 1; }
.app-footer { padding: 1rem 1.75rem; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); background: #fff; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.4rem; }
.page-head h2 { font-size: 1.45rem; font-weight: 800; margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }

/* ---------- Cards ---------- */
.card-x { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 10px rgba(16, 44, 82, .04); }
.card-x .card-head { padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.card-x .card-head h5 { margin: 0; font-size: 1rem; font-weight: 700; }
.card-x .card-body-x { padding: 1.3rem; }
.stat { display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.3rem; position: relative; overflow: hidden; height: 100%; transition: transform .2s, box-shadow .2s; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16, 44, 82, .1); }
.stat::after { content: ""; position: absolute; right: -28px; top: -28px; width: 100px; height: 100px; border-radius: 50%; background: currentColor; opacity: .06; }
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; flex: 0 0 auto; }
.stat-label { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.stat-value small { font-size: .78rem; font-weight: 500; color: var(--muted); }
.stat-blue { color: var(--blue); } .stat-blue .stat-icon { background: #e4effb; }
.stat-green { color: #3f8a20; } .stat-green .stat-icon { background: #e6f5dd; }
.stat-amber { color: #b97a00; } .stat-amber .stat-icon { background: #fff2cf; }
.stat-red { color: var(--red); } .stat-red .stat-icon { background: #fde6e7; }

/* ---------- Tables & badges ---------- */
.table-x { margin: 0; }
.table-x thead th { font-size: .71rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f7f9fc; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap; padding: .8rem .9rem; }
.table-x td { padding: .8rem .9rem; border-color: #eef2f8; }
tr.row-expired > td { background: #fff4f4; }
tr.row-warning > td { background: #fffaf0; }
tr.row-selected > td { background: #eaf3ff !important; }
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; padding: .3rem .65rem; border-radius: 20px; white-space: nowrap; }
.badge-soft-success { background: #e6f5dd; color: #3a7d1b; }
.badge-soft-warning { background: #fff2cf; color: #8a5d00; }
.badge-soft-danger { background: #fde6e7; color: #b3151b; }
.badge-soft-secondary { background: #eceff4; color: #56657a; }
.cell-input { border: 1px solid transparent; background: transparent; border-radius: 8px; padding: .3rem .5rem; font-size: .85rem; width: 100%; min-width: 110px; transition: all .15s; }
.cell-input:hover { border-color: #d5dde9; background: #fff; }
.cell-input:focus { outline: 0; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 .18rem rgba(11, 92, 171, .14); }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.tabs-x { display: flex; gap: .4rem; flex-wrap: wrap; }
.tabs-x a { padding: .4rem .9rem; border-radius: 20px; text-decoration: none; font-weight: 600; font-size: .82rem; color: var(--muted); background: #fff; border: 1px solid var(--line); }
.tabs-x a.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.tabs-x a span { opacity: .75; margin-left: .25rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .5; }
.chart-box { position: relative; max-width: 320px; margin: 0 auto; }
.legend-row { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.legend-row:last-child { border: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .5rem; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: .9rem 1.3rem; border-radius: 0 0 16px 16px; display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-brand { position: relative; background: radial-gradient(circle at 20% 15%, #1a4f8f 0%, var(--navy) 60%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-brand::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, var(--red) 0 33.3%, #fff 33.3% 66.6%, var(--green) 66.6% 100%); }
.login-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); }
.login-brand h1 { font-weight: 800; font-size: 2.1rem; line-height: 1.2; }
.login-brand p { color: #b7c7de; max-width: 420px; }
.login-form-wrap { display: grid; place-items: center; padding: 2rem; }
.login-form { width: 100%; max-width: 380px; }
.login-form h3 { font-weight: 800; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .sidebar-backdrop.show { display: block; }
  .main { margin-left: 0; }
  .btn-menu { display: block; }
  .content { padding: 1.1rem; }
  .topbar { padding: .7rem 1rem; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}
