:root {
  --navy-950: #071326;
  --navy-900: #0a1f3d;
  --navy-800: #0e2a52;
  --navy-700: #123663;
  --royal-700: #1d4ed8;
  --royal-600: #2563eb;
  --royal-500: #3b82f6;
  --royal-100: #dbeafe;
  --royal-50: #eff6ff;
  --blue: #2563eb;
  --green: #16a34a;
  --orange: #ea580c;
  --purple: #7c3aed;
  --white: #ffffff;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, .07);
  --shadow-lg: 0 20px 40px rgba(7, 19, 38, .16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--slate-100);
  color: var(--slate-800);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; transition: all .16s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--royal-700); color: #fff; box-shadow: 0 8px 18px rgba(29, 78, 216, .28); }
.btn-primary:hover:not(:disabled) { background: var(--royal-600); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--slate-700); border-color: var(--slate-300); }
.btn-secondary:hover:not(:disabled) { background: var(--slate-50); border-color: var(--slate-400); }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline-white:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 12px; }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 7px; letter-spacing: .1px; }
.input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--slate-300); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--slate-800); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--royal-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .16); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 8px; color: var(--slate-500);
}
.pw-toggle:hover { color: var(--slate-700); }
.pw-toggle svg { display: block; }

/* ---------- LOGIN ---------- */
.login-screen {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff;
}
.login-visual {
  position: relative; background: radial-gradient(1200px 700px at 0% 0%, #163d74 0%, #0a1f3d 55%, #071326 100%);
  color: #fff; padding: 64px 72px; display: flex; flex-direction: column; overflow: hidden;
}
.login-visual::after {
  content: ""; position: absolute; right: -160px; bottom: -160px; width: 480px; height: 480px;
  border-radius: 50%; background: rgba(59, 130, 246, .14); filter: blur(2px);
}
.login-visual::before {
  content: ""; position: absolute; right: 80px; top: 120px; width: 240px; height: 240px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
}
.lv-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.lv-top .lv-mark {
  width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, var(--royal-500), var(--royal-700));
  display: grid; place-items: center; font-weight: 800; font-size: 19px; color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.lv-top .lv-title { font-weight: 800; font-size: 16px; letter-spacing: .4px; }
.lv-top .lv-sub { display: block; font-size: 11px; font-weight: 500; color: #93a7c3; letter-spacing: 1.4px; }
.lv-body { position: relative; z-index: 1; margin-top: auto; padding-bottom: 8px; }
.lv-body h1 { font-size: 40px; font-weight: 800; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.4px; }
.lv-body h1 span { color: #7ea6f2; }
.lv-body p { color: #b8c6db; font-size: 16px; max-width: 440px; margin: 0 0 26px; }
.lv-companies { display: flex; gap: 10px; flex-wrap: wrap; }
.lv-companies .lv-chip {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14); padding: 8px 14px; border-radius: 999px;
  font-weight: 700; font-size: 13px; letter-spacing: .6px;
}
.lv-companies .lv-chip img { width: 16px; height: 16px; object-fit: contain; }

.login-panel {
  display: flex; align-items: center; justify-content: center; padding: 48px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
}
.login-card { width: 100%; max-width: 400px; }
.login-card .lc-eye { margin-bottom: 10px; color: var(--royal-700); }
.login-card h2 { font-size: 26px; font-weight: 800; color: var(--navy-900); margin: 0 0 6px; letter-spacing: -.3px; }
.login-card .lc-sub { color: var(--slate-500); font-size: 14px; margin: 0 0 30px; }
.login-btn { width: 100%; margin-top: 6px; }
/* ---------- COMPANY SELECT ---------- */
.company-select {
  min-height: 100vh; background: linear-gradient(180deg, #0a1f3d 0%, #0e2a52 300px, #f1f5f9 300px);
}
.cs-top { max-width: 1280px; margin: 0 auto; padding: 48px 40px 0; color: #fff; }
.cs-top .cs-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 54px; }
.cs-brand .cs-mark {
  width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--royal-500), var(--royal-700));
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.cs-brand .cs-bname { font-weight: 800; letter-spacing: .3px; }
.cs-brand .cs-bsub { display: block; font-size: 10.5px; color: #9db2d0; letter-spacing: 1.4px; }
.cs-head { max-width: 720px; }
.cs-head h1 { font-size: 34px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.4px; }
.cs-head h1 .brands { color: #7ea6f2; }
.cs-head .cs-tagline { color: #b8c6db; font-size: 16px; margin: 0; }
.cs-pick { max-width: 1280px; margin: 0 auto; padding: 0 40px 48px; }
.cs-pick-label { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--slate-500); margin: 40px 0 20px; }
.company-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.company-card {
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg);
  padding: 18px 16px 16px; text-align: center; cursor: pointer; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); transition: all .18s ease;
}
.company-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--royal-100); }
.company-card .cc-logo {
  height: 140px; display: grid; place-items: center; margin-bottom: 10px;
}
.company-card .cc-logo img {
  max-width: 90%; max-height: 125px; width: auto; height: auto; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(7, 19, 38, .16));
}
.company-card .cc-code { font-size: 15px; font-weight: 800; letter-spacing: 1px; color: var(--navy-900); }
.company-card .cc-name { font-size: 12.5px; color: var(--slate-500); margin: 2px 0 14px; min-height: 17px; line-height: 1.35; }
.company-card .cc-btn {
  margin-top: auto; width: 100%; padding: 9px 12px; border-radius: 9px;
  background: var(--navy-900); color: #fff; font-weight: 600; font-size: 12.5px;
  border: none; cursor: pointer; transition: background .16s;
}
.company-card .cc-btn:hover { background: var(--royal-700); }

@media (max-width: 1100px) { .company-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .company-grid { grid-template-columns: repeat(2, 1fr); } }
/* ---------- PORTAL COMPANY (mockup) ---------- */
.portal { min-height: 100vh; display: flex; }
.sidebar {
  width: 225px; background: var(--navy-900); color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-logo { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 11px; }
.sidebar-logo img { width: 42px; height: 42px; object-fit: contain; }
.sidebar-logo .sb-name { font-weight: 800; font-size: 13.5px; color: #fff; letter-spacing: .2px; }
.sidebar-logo .sb-sub { display: block; font-size: 9.5px; color: #8ba1c0; letter-spacing: 1px; }
.sidebar-menu { flex: 1; padding: 10px 10px; display: flex; flex-direction: column; gap: 1px; overflow-y: hidden; }
.sidebar-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: #cbd5e1; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: all .14s; border: none; background: none; width: 100%; text-align: left;
}
.sidebar-item svg { width: 17px; height: 17px; flex-shrink: 0; color: #7f96b5; }
.sidebar-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-item.active { background: var(--royal-600); color: #fff; }
.sidebar-item.active svg { color: #fff; }
.sidebar-foot { padding: 10px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-switch {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  padding: 9px; border-radius: 9px; border: 1px dashed rgba(255,255,255,.22);
  background: none; color: #cbd5e1; font-weight: 700; font-size: 12.5px; cursor: pointer; transition: all .14s;
}
.sidebar-switch:hover { background: rgba(255,255,255,.07); color: #fff; }

.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 72px; background: #fff; border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; padding: 0 24px; gap: 20px; position: sticky; top: 0; z-index: 30;
}
.topbar-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar-brand img { width: 48px; height: 48px; object-fit: contain; }
.topbar-brand .tb-name { font-weight: 800; font-size: 16px; color: var(--navy-900); white-space: nowrap; letter-spacing: .2px; }
.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search input {
  width: 100%; padding: 10px 14px 10px 39px; border-radius: 9px; border: 1px solid var(--slate-200);
  background: var(--slate-50); font-size: 13.5px; color: var(--slate-700);
}
.topbar-search input:focus { outline: none; border-color: var(--royal-400); background: #fff; }
.topbar-search .ts-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate-400); display: grid; place-items: center; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-right .notif { position: relative; background: none; border: none; cursor: pointer; color: var(--slate-500); padding: 6px; }
.topbar-right .notif:hover { color: var(--slate-800); }
.topbar-right .notif .dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.user-menu { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-menu .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--royal-500), var(--royal-700));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.user-menu .um-name { font-size: 13px; font-weight: 700; color: var(--navy-900); }
.user-menu .um-role { font-size: 11px; color: var(--slate-500); }

.portal-content { padding: 24px 28px; max-width: none; width: 100%; margin: 0 auto; }
/* ---------- HERO ---------- */
.hero {
  position: relative; border-radius: 16px; overflow: hidden; color: #fff;
  background: linear-gradient(120deg, #0b2447 0%, #123f74 48%, #1d4ed8 100%);
  padding: 26px 36px; height: 240px; display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.hero::before {
  content: ""; position: absolute; left: -30px; bottom: -90px; width: 340px; height: 340px;
  border-radius: 50%; background: rgba(59,130,246,.16);
}
.hero::after {
  content: ""; position: absolute; right: 38%; bottom: -70px; width: 220px; height: 220px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.10);
}
.hero-text { position: relative; z-index: 1; }
.hero-kicker { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #9db8e4; margin-bottom: 8px; }
.hero-text h1 { font-size: 30px; font-weight: 800; margin: 0; letter-spacing: -.3px; line-height: 1.12; }
.hero-text h1 .company-name { display: block; font-size: 19px; font-weight: 500; color: #dbe6fb; margin-top: 6px; }
.hero-logo { position: relative; z-index: 1; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.hero-logo img { width: 250px; max-width: 40vw; height: 140px; object-fit: contain; filter: drop-shadow(0 14px 28px rgba(0,0,0,.30)); }

/* ---------- SECTION ---------- */
.section { margin-top: 28px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-size: 18px; font-weight: 800; color: var(--navy-900); margin: 0; letter-spacing: -.2px; }
.section-head p { color: var(--slate-500); font-size: 13px; margin: 3px 0 0; }

/* ---------- APPLICATION CARDS ---------- */
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.app-card {
  border-radius: 14px; padding: 20px; color: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-md); transition: all .16s ease;
  text-align: left; border: none; cursor: pointer; min-height: 128px;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.app-card .ac-icon {
  width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; margin-bottom: 14px;
}
.app-card .ac-icon svg { width: 23px; height: 23px; }
.app-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.app-card p { margin: 0; font-size: 12.5px; opacity: .92; line-height: 1.45; }
.app-card .ac-arrow {
  position: absolute; right: 16px; bottom: 16px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.22); display: grid; place-items: center; transition: all .16s;
}
.app-card:hover .ac-arrow { background: rgba(255,255,255,.4); transform: translateX(3px); }
.app-card.blue { background: linear-gradient(140deg, #2563eb 0%, #1d4ed8 100%); }
.app-card.green { background: linear-gradient(140deg, #16a34a 0%, #15803d 100%); }
.app-card.orange { background: linear-gradient(140deg, #f97316 0%, #ea580c 100%); }
.app-card.purple { background: linear-gradient(140deg, #8b5cf6 0%, #7c3aed 100%); }

/* ---------- DASHBOARD LAYOUT ---------- */
.dashboard { display: grid; grid-template-columns: 1fr 300px; gap: 22px; margin-top: 28px; align-items: start; }
.dash-main { min-width: 0; }
.dash-right { display: flex; flex-direction: column; gap: 18px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.summary-card {
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm);
}
.summary-card .sc-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.summary-card .sc-ic svg { width: 20px; height: 20px; }
.summary-card .sc-v { font-size: 21px; font-weight: 800; color: var(--navy-900); line-height: 1; }
.summary-card .sc-k { font-size: 12px; color: var(--slate-500); margin-top: 3px; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--slate-100); font-weight: 700; font-size: 13.5px; color: var(--navy-900); display: flex; align-items: center; justify-content: space-between; }
.panel-head a { font-size: 12px; color: var(--royal-600); font-weight: 600; cursor: pointer; }
.panel-body { padding: 4px 16px; }
.list-row { padding: 11px 0; border-bottom: 1px solid var(--slate-100); display: flex; align-items: center; gap: 10px; }
.list-row:last-child { border-bottom: none; }
.list-row .lr-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-size: 13px; font-weight: 600; color: var(--slate-800); }
.list-row .lr-sub { font-size: 11.5px; color: var(--slate-500); }
.list-row .lr-time { font-size: 11px; color: var(--slate-400); white-space: nowrap; }

/* ---------- ACTIVE COMPANY PANEL ---------- */
.active-panel { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 22px; text-align: center; box-shadow: var(--shadow-sm); }
/* ---------- ADMIN (kept minimal, same family) ---------- */
.admin-nav {
  display: flex; gap: 4px; background: #fff; border: 1px solid var(--slate-200);
  border-radius: 12px; padding: 6px; margin-bottom: 24px; flex-wrap: wrap; box-shadow: var(--shadow-sm);
}
.admin-nav button {
  border: none; background: none; padding: 9px 16px; border-radius: 9px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--slate-600); transition: all .15s;
}
.admin-nav button:hover { background: var(--slate-100); }
.admin-nav button.active { background: var(--navy-900); color: #fff; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 16px; background: var(--slate-50); color: var(--slate-600);
  font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; border-bottom: 1px solid var(--slate-200); }
td { padding: 12px 16px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--slate-50); }
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 18px 20px; }
.stat-card .k { font-size: 13px; color: var(--slate-500); font-weight: 600; }
.stat-card .v { font-size: 30px; font-weight: 800; color: var(--navy-900); margin-top: 2px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--slate-100); color: var(--slate-600); }
.chip.blue { background: var(--royal-100); color: var(--royal-700); }
.chip.green { background: #dcfce7; color: var(--green); }
.chip.amber { background: #fef3c7; color: var(--amber); }
.chip.red { background: #fee2e2; color: var(--red); }
.chip.navy { background: var(--navy-800); color: #fff; }
.card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 28px; border: 1px solid var(--slate-200); }

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 80;
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
}
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--slate-200); }
.modal-head h3 { margin: 0; font-size: 17px; color: var(--navy-900); }
.modal-body { padding: 22px 24px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--slate-200); }
.close-x { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--slate-400); line-height: 1; }
.close-x:hover { color: var(--slate-700); }

/* ---------- TOAST ---------- */
#toast { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast-item {
  min-width: 240px; max-width: 360px; background: var(--slate-900); color: #fff; padding: 13px 16px;
  border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg); animation: slidein .2s ease; display: flex; gap: 10px; align-items: flex-start;
}
.toast-item.success { background: var(--green); }
.toast-item.error { background: var(--red); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- MISC ---------- */
.muted { color: var(--slate-500); }
.small { font-size: 12.5px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.page-head h1 { margin: 0; font-size: 22px; color: var(--navy-900); }
.page-head p { margin: 6px 0 0; color: var(--slate-500); font-size: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--royal-600); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 60; transition: left .2s; }
  .sidebar.open { left: 0; }
  .hamburger { display: grid !important; }
  .topbar-brand .tb-name { display: none; }
  .topbar-search { max-width: none; }
}
@media (max-width: 430px) {
  .app-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .hero { padding: 20px 20px; height: auto; }
  .hero-logo img { width: 120px; height: 80px; }
  .hero-text h1 { font-size: 22px; }
  .user-menu .um-name, .user-menu .um-role { display: none; }
}

/* hamburger button (hidden on desktop) */
.hamburger { display: none; }

.active-panel .ap-label { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--slate-400); margin-bottom: 16px; }
.active-panel .ap-logo { height: 90px; display: grid; place-items: center; margin-bottom: 12px; }
.active-panel .ap-logo img { max-width: 100%; max-height: 90px; object-fit: contain; }
.active-panel h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--navy-900); }
.active-panel .ap-role { font-size: 13px; color: var(--slate-500); margin: 4px 0 18px; }

.logout-link { background: none; border: none; cursor: pointer; color: var(--slate-500); font-size: 13px; font-weight: 600; }
.logout-link:hover { color: var(--red); }

@media (max-width: 430px) { .company-grid { grid-template-columns: 1fr; } }

.login-err { color: var(--red); min-height: 20px; font-size: 13px; margin: -6px 0 10px; }

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
}

/* ---------- PRODUKSI: SIDEBAR SUBMENU ---------- */
.prod-group { display: flex; flex-direction: column; }
.prod-parent.expanded { background: rgba(255,255,255,.07); color:#fff; }
.prod-caret { margin-left:auto; font-style:normal; color:#7f96b5; transition: transform .16s ease; display:grid; place-items:center; }
.prod-parent.expanded .prod-caret { transform: rotate(90deg); color:#fff; }
.prod-sub { display:flex; flex-direction:column; padding-left: 6px; }
.prod-sub-item { display:flex; align-items:center; gap:10px; padding: 8px 12px; margin-left: 26px; border-radius: 8px; border:none; background:none; color:#94a3b8; font-weight:600; font-size:12.5px; cursor:pointer; text-align:left; transition: all .14s; width: calc(100% - 26px); }
.prod-sub-item:hover { background: rgba(255,255,255,.05); color:#fff; }
.prod-sub-item.active { background: rgba(37,99,235,.35); color:#fff; }

/* ---------- PRODUKSI: PAGE LAYOUT ---------- */
.prod-page { max-width: 1180px; margin: 0 auto; }
.prod-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom: 20px; }
.prod-crumb { font-size: 11.5px; font-weight:600; color: var(--slate-400); letter-spacing:.6px; text-transform:uppercase; margin-bottom: 4px; }
.prod-crumb span.sep { margin: 0 6px; color: var(--slate-300); }
.prod-crumb span.cur { color: var(--royal-600); }
.prod-page-head h1 { margin:0; font-size: 24px; font-weight:800; letter-spacing:-.3px; color: var(--navy-900); }
.prod-page-head p { margin: 4px 0 0; color: var(--slate-500); font-size: 13.5px; }
.prod-page-badge { display:inline-flex; align-items:center; gap:8px; padding: 7px 14px; border-radius: 999px; background: var(--royal-50); color: var(--royal-700); font-weight:800; font-size:11.5px; letter-spacing:1.4px; white-space:nowrap; }
.prod-page-badge svg { width:15px; height:15px; }
.prod-back-btn { background:none; border:1px solid var(--slate-300); color:var(--slate-600); border-radius:9px; padding:8px 14px; font-weight:600; font-size:12.5px; cursor:pointer; transition:all .14s; }
.prod-back-btn:hover { background: var(--slate-50); color: var(--navy-900); border-color: var(--slate-400); }
.prod-stats { display:grid; grid-template-columns: repeat(4, 1fr); gap:14px; margin-bottom: 18px; }
.prod-stat-card { display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--slate-200); border-radius: var(--radius); padding:14px; box-shadow: var(--shadow-sm); }
.prod-stat-ic { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; flex-shrink:0; }
.prod-stat-ic svg { width:20px; height:20px; }
.prod-stat-v { font-size:21px; font-weight:800; color: var(--navy-900); line-height:1; margin-bottom:3px; }
.prod-stat-k { font-size:12px; color: var(--slate-500); }
.prod-grid-2 { display:grid; grid-template-columns: 1fr 340px; gap:16px; align-items:start; }
.prod-main-col, .prod-side-col { display:flex; flex-direction:column; gap:16px; min-width:0; }
.prod-card { background:#fff; border:1px solid var(--slate-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding:18px; }
.prod-card-head { font-size:13px; font-weight:800; letter-spacing:.8px; text-transform:uppercase; color: var(--navy-900); margin-bottom:14px; }
.prod-form-card .prod-form-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:12px 14px; }
.prod-form-card .field { margin-bottom:0; }
.prod-form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:16px; }
.prod-table-wrap { overflow-x:auto; }
.prod-table { width:100%; border-collapse:collapse; font-size:13px; }
.prod-table th { text-align:left; font-size:11px; letter-spacing:.6px; text-transform:uppercase; color:var(--slate-400); padding:6px 8px; border-bottom:1px solid var(--slate-200); font-weight:700; }
.prod-table td { padding:8px; border-bottom:1px solid var(--slate-100); color:var(--slate-600); }
.prod-panel { background:#fff; border:1px solid var(--slate-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.prod-panel-head { padding:14px 16px; border-bottom:1px solid var(--slate-200); font-size:12px; font-weight:800; letter-spacing:.6px; text-transform:uppercase; color:var(--navy-900); }
.prod-panel-body { display:flex; flex-direction:column; }
.prod-row { display:flex; gap:10px; padding:11px 14px; border-bottom:1px solid var(--slate-100); align-items:center; }
.prod-row:last-child { border-bottom:none; }
.prod-row-ic { width:32px; height:32px; border-radius:9px; background:var(--slate-100); color:var(--slate-500); display:grid; place-items:center; flex-shrink:0; }
.prod-row-ic svg { width:16px; height:16px; }
.prod-row-main { flex:1; min-width:0; }
.prod-row-t { font-size:13px; font-weight:700; color:var(--navy-900); }
.prod-row-s { font-size:12px; color:var(--slate-500); margin-top:1px; }
.prod-row-r { font-size:12px; font-weight:700; color:var(--slate-500); white-space:nowrap; }
.prod-empty { padding:14px; text-align:center; color:var(--slate-400); font-size:13px; }
.prod-empty-card, .prod-placeholder { padding:46px 22px; text-align:center; border:1px dashed var(--slate-300); border-radius: var(--radius-lg); background:#fff; color: var(--slate-500); }
.prod-empty-ic, .prod-ph-ic { width:54px; height:54px; margin:0 auto 12px; border-radius:14px; background: var(--royal-50); color: var(--royal-600); display:grid; place-items:center; }
.prod-empty-ic svg, .prod-ph-ic svg { width:26px; height:26px; }
.prod-empty-card h3, .prod-placeholder h3 { margin:0 0 4px; font-size:16px; color: var(--navy-900); }
.prod-empty-card p, .prod-placeholder p { margin:0; font-size:13px; color: var(--slate-500); }

@media (max-width: 1100px) { .prod-stats { grid-template-columns: repeat(2, 1fr); } .prod-grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .prod-stats { grid-template-columns: 1fr; } .prod-form-card .prod-form-grid { grid-template-columns: 1fr; } .prod-page-head { flex-direction: column; } }


/* environment badge (PREVIEW only) */
.env-badge { display:inline-flex; align-items:center; padding: 3px 10px; border-radius: 999px; background: #f97316; color:#fff; font-size:10.5px; font-weight:800; letter-spacing:1.2px; margin-left:8px; text-transform:uppercase; white-space:nowrap; box-shadow: 0 0 0 3px rgba(249,115,22,.18); }

/* standard icon wrapper (svg inline through innerHTML) */
.svg-ic { display:inline-flex; align-items:center; justify-content:center; }
.svg-ic svg { width:16px; height:16px; }
.sidebar-switch .svg-ic svg, .sidebar-item .svg-ic svg { width:18px; height:18px; color:inherit; }
/* Export Master � compact & distinct color (NOT primary/secondary) */
.btn-export { background:#0e7490; color:#fff; box-shadow:0 6px 14px rgba(14,116,144,.25); }
.btn-export:hover { background:#155e75; transform:translateY(-1px); }

/* Master action buttons - compact, same height, distinct colors */
.btn-master-add, .btn-export, .btn-master-upload { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:36px; padding:0 14px; border-radius:9px; border:1px solid transparent; font-size:13.5px; font-weight:600; letter-spacing:.2px; cursor:pointer; white-space:nowrap; color:#fff; box-shadow:none; text-decoration:none; transition:all .15s ease; }
.btn-master-add .svg-ic svg, .btn-export .svg-ic svg, .btn-master-upload .svg-ic svg { width:16px; height:16px; }
.btn-master-add:hover, .btn-export:hover, .btn-master-upload:hover { transform:translateY(-1px); }
.btn-master-add { background: var(--green); }
.btn-master-add:hover { background:#15803d; }
.btn-export { background:#0e7490; }
.btn-export:hover { background:#155e75; box-shadow:none; }
.btn-master-upload { background: var(--orange); }
.btn-master-upload:hover { background:#c2410c; }


/* ---------- MASTER MANAGEMENT PAGE (tabs + cards) ---------- */
.master-head-actions { display:flex; align-items:center; gap:10px; }
.master-head-actions .btn-master-create { margin-left:4px; }
.master-manager-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.btn-master-create {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:36px; padding:0 14px; border-radius:9px; border:1px solid var(--slate-300);
  background:#fff; color:var(--slate-700); font-size:13px; font-weight:600;
  cursor:pointer; white-space:nowrap; transition:all .15s ease; text-decoration:none; box-shadow:none;
}
.btn-master-create .svg-ic svg { width:16px; height:16px; }
.btn-master-create:hover { background:var(--slate-50); border-color:var(--slate-400); color:var(--navy-900); }

.master-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:18px; padding:6px; background:#fff; border:1px solid var(--slate-200); border-radius:12px; box-shadow:var(--shadow-sm); width:fit-content; }
.master-tab {
  display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:8px;
  border:1px solid transparent; background:transparent; color:var(--slate-600);
  font-size:13px; font-weight:600; cursor:pointer; transition:all .14s ease; white-space:nowrap;
}
.master-tab:hover { background:var(--slate-100); color:var(--navy-900); }
.master-tab.active { background:var(--royal-700); color:#fff; box-shadow:0 4px 10px rgba(29,78,216,.25); }
.master-tab-count { font-size:10.5px; font-weight:800; background:rgba(100,116,139,.15); color:inherit; border-radius:999px; padding:1px 7px; }
.master-tab.active .master-tab-count { background:rgba(255,255,255,.22); }

.master-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:12px; }
.master-card {
  background:#fff; border:1px solid var(--slate-200); border-radius:var(--radius);
  padding:16px; cursor:pointer; box-shadow:var(--shadow-sm); transition:all .16s ease;
  display:flex; flex-direction:column; gap:8px; min-width:0;
}
.master-card:hover { transform:translateY(-2px); border-color:var(--royal-500); box-shadow:var(--shadow-md); }
.master-card-ic { width:38px; height:38px; border-radius:10px; background:var(--royal-50); color:var(--royal-700); display:grid; place-items:center; }
.master-card-ic svg { width:19px; height:19px; }
.master-card-name { font-size:14px; font-weight:700; color:var(--navy-900); line-height:1.3; }
.master-card-sub { font-size:12px; color:var(--slate-500); }
.master-card-go { margin-top:auto; font-size:12px; font-weight:700; color:var(--royal-600); }

.master-toolbar { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
@media (max-width:600px) { .master-manager-head { flex-direction:column; } .master-toolbar { justify-content:flex-start; } }

