/* ============================================================
   ERP Pro — CSS
   Aesthetic: Industrial Precision — dark slate, warm amber accent
   Fonts: Syne (display) + DM Sans (body)
   ============================================================ */

:root {
  --bg:        #0e0f11;
  --bg2:       #13151a;
  --bg3:       #1a1d24;
  --bg4:       #22262f;
  --border:    #2a2e38;
  --border2:   #363b47;
  --text:      #e8eaf0;
  --text2:     #9ca3b0;
  --text3:     #5c6270;
  --accent:    #f5a623;
  --accent2:   #e8941a;
  --accent-bg: rgba(245,166,35,.12);
  --blue:      #3b82f6;
  --blue-bg:   rgba(59,130,246,.12);
  --green:     #22c55e;
  --green-bg:  rgba(34,197,94,.12);
  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,.12);
  --purple:    #a855f7;
  --purple-bg: rgba(168,85,247,.12);
  --cyan:      #06b6d4;
  --sidebar-w: 240px;
  --sidebar-collapsed: 60px;
  --topbar-h:  56px;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --font-display: 'Roboto', sans-serif;
  --font-body:    'Roboto Condensed', sans-serif;
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ============================================================
   LOGIN
   ============================================================ */
#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 1000;
  overflow: hidden;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .35;
}
.orb1 { width: 500px; height: 500px; background: radial-gradient(#f5a623, transparent); top: -200px; right: -100px; }
.orb2 { width: 400px; height: 400px; background: radial-gradient(#3b82f6, transparent); bottom: -150px; left: -100px; }
.orb3 { width: 300px; height: 300px; background: radial-gradient(#a855f7, transparent); top: 40%; left: 40%; }

.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: loginIn .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 32px;
}
.brand-mark {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800; font-size: 20px;
  color: #000;
  flex-shrink: 0;
}
.brand-mark.sm { width: 30px; height: 30px; font-size: 15px; border-radius: 7px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

.login-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-desc { color: var(--text2); font-size: 13px; margin-bottom: 24px; }

.login-error {
  background: var(--red-bg); border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: #fca5a5; font-size: 13px; margin-bottom: 16px;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 6px; letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.field textarea { resize: vertical; min-height: 80px; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 40px; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text3); transition: color var(--transition);
}
.toggle-pass:hover { color: var(--text2); }

.check-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2);
  cursor: pointer; margin-bottom: 20px;
}
.check-row input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }

.btn-login {
  width: 100%;
  background: var(--accent); color: #000;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(245,166,35,.25);
}
.btn-login:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,166,35,.35); }
.btn-login:active { transform: none; }
.btn-login.loading { opacity: .7; pointer-events: none; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app {
  display: flex; min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 200;
  transition: width var(--transition);
  overflow: hidden;
}
#sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  overflow: hidden; white-space: nowrap;
}
.sidebar-toggle {
  color: var(--text3); padding: 4px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--text); background: var(--bg3); }
#sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

.company-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  margin: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden; white-space: nowrap;
  cursor: default;
}
.company-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 14px; color: #000;
}
.company-name { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text); }
.company-type { font-size: 11px; color: var(--text3); }

/* Nav */
.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 8px 0;
}
.nav-section {
  padding: 16px 14px 4px;
  font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap; overflow: hidden;
  transition: opacity var(--transition);
}
#sidebar.collapsed .nav-section { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  color: var(--text2); font-size: 13px; font-weight: 500;
  position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
  margin-left: -8px;
}
.nav-item svg { flex-shrink: 0; width: 16px; height: 16px; }
.nav-label { transition: opacity var(--transition); }
#sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

/* Tooltip on collapsed */
#sidebar.collapsed .nav-item { justify-content: center; padding: 9px 0; margin: 1px 8px; }
#sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 12px);
  background: var(--bg4); color: var(--text);
  padding: 5px 10px; border-radius: 6px;
  font-size: 12px; white-space: nowrap;
  border: 1px solid var(--border);
  pointer-events: none; z-index: 999;
  box-shadow: var(--shadow-sm);
}

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
}
.user-info { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text3); }
.btn-logout {
  color: var(--text3); padding: 6px;
  border-radius: 6px; flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}
.btn-logout:hover { color: var(--red); background: var(--red-bg); }
#sidebar.collapsed .user-info,
#sidebar.collapsed .btn-logout { display: none; }
#sidebar.collapsed .sidebar-footer { justify-content: center; }
#sidebar.collapsed .user-avatar { margin: 0; }

/* ── Main area ─────────────────────────────────────────── */
#main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
#sidebar.collapsed ~ #main-wrap { margin-left: var(--sidebar-collapsed); }

/* Topbar */
#topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.mobile-menu-btn { display: none; color: var(--text2); padding: 4px; }
.topbar-title {
  flex: 1;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--text);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.notif-btn {
  position: relative; padding: 8px;
  color: var(--text2); border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.notif-btn:hover { background: var(--bg3); color: var(--text); }
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  background: var(--red); color: #fff;
  border-radius: 99px; font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
  border: 2px solid var(--bg2);
}

/* Notif panel */
.notif-panel {
  position: fixed; top: var(--topbar-h); right: 16px;
  width: 340px; max-height: 480px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 300; overflow: hidden;
  animation: slideDown .2s ease both;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.link-btn { color: var(--accent); font-size: 12px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; max-height: 400px; }
.notif-item {
  display: flex; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg3); }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 5px;
}
.notif-content { flex: 1; }
.notif-title { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.notif-msg { font-size: 11px; color: var(--text2); line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--text3); margin-top: 3px; }
.notif-empty { padding: 32px; text-align: center; color: var(--text3); font-size: 13px; }

/* Page content */
#page-content {
  flex: 1; padding: 24px;
  animation: pageIn .25s ease both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ── Page header ───────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header-left {}
.page-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  margin-bottom: 4px;
}
.page-subtitle { font-size: 13px; color: var(--text2); }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: all var(--transition); cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary   { background: var(--accent);  color: #000; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,166,35,.25); }
.btn-secondary { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.btn-secondary:hover { background: var(--bg4); border-color: var(--border2); }
.btn-danger    { background: var(--red-bg); color: var(--red); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-ghost     { color: var(--text2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); color: var(--text2); transition: background var(--transition), color var(--transition); }
.btn-icon:hover { background: var(--bg3); color: var(--text); }
.btn-icon.danger:hover { background: var(--red-bg); color: var(--red); }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  gap: 12px;
}
.card-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.card-body { padding: 20px; }

/* ── Stat cards ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.amber  { background: var(--accent-bg); color: var(--accent); }
.stat-icon.blue   { background: var(--blue-bg);   color: var(--blue); }
.stat-icon.green  { background: var(--green-bg);  color: var(--green); }
.stat-icon.red    { background: var(--red-bg);    color: var(--red); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.cyan   { background: rgba(6,182,212,.12); color: var(--cyan); }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text2); margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* ── Table ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 11px 16px; text-align: left;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }
tbody td { padding: 12px 16px; font-size: 13px; vertical-align: middle; }

/* ── Toolbar ───────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text3); width: 15px; height: 15px; }
.search-input {
  width: 100%; padding: 8px 12px 8px 34px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  outline: none; transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.filter-select {
  padding: 8px 30px 8px 11px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.badge-amber  { background: var(--accent-bg); color: var(--accent); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray   { background: var(--bg4);       color: var(--text2); }
.badge-cyan   { background: rgba(6,182,212,.12); color: var(--cyan); }

/* ── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  padding: 5px 10px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 12px;
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) { background: var(--bg4); color: var(--text); }
.page-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Modal ─────────────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#modal-box {
  width: 100%; max-width: 560px; max-height: 90vh;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px; box-shadow: 0 32px 80px rgba(0,0,0,.6);
  display: flex; flex-direction: column;
  animation: modalIn .2s cubic-bezier(.34,1.56,.64,1) both;
}
#modal-box.lg { max-width: 740px; }
#modal-box.xl { max-width: 920px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.92) translateY(16px); }
  to   { opacity: 1; transform: none; }
}
#modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#modal-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
#modal-close { color: var(--text3); padding: 4px; border-radius: 6px; transition: color var(--transition), background var(--transition); }
#modal-close:hover { color: var(--text); background: var(--bg3); }
#modal-body { padding: 22px; overflow-y: auto; flex: 1; }
#modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 22px; border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#modal-footer:empty { display: none; }

/* ── Form ──────────────────────────────────────────────── */
.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }
.form-divider {
  grid-column: 1 / -1;
  border: none; border-top: 1px solid var(--border);
  margin: 4px 0;
}
.form-section-title {
  grid-column: 1 / -1;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text3);
  padding-top: 4px;
}

/* ── Toast ─────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 13px; min-width: 260px; max-width: 360px;
  animation: toastIn .25s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.info    .toast-icon { color: var(--blue); }
.toast.warning .toast-icon { color: var(--accent); }
.toast-msg { flex: 1; line-height: 1.4; }

/* ── Empty state ───────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; color: var(--text3); text-align: center;
  gap: 12px;
}
.empty-state svg { width: 40px; height: 40px; opacity: .4; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text2); }
.empty-state-sub { font-size: 13px; }

/* ── Loading ───────────────────────────────────────────── */
.loading-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text3);
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inline tag ────────────────────────────────────────── */
.code { font-family: monospace; font-size: 12px; background: var(--bg3); padding: 2px 6px; border-radius: 4px; color: var(--text2); }

/* ── Detail rows ───────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.detail-row {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.detail-row:nth-child(even) { padding-left: 20px; }
.detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); font-weight: 600; }
.detail-value { font-size: 13px; font-weight: 500; }

/* ── Alert inline ──────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-warning { background: var(--accent-bg); border: 1px solid rgba(245,166,35,.3); color: #fcd34d; }
.alert-danger  { background: var(--red-bg);    border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-info    { background: var(--blue-bg);   border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

/* ── Progress bar ──────────────────────────────────────── */
.progress-bar { height: 6px; background: var(--bg4); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.progress-fill.green  { background: var(--green); }
.progress-fill.amber  { background: var(--accent); }
.progress-fill.red    { background: var(--red); }

/* ── Dashboard quick lists ─────────────────────────────── */
.quick-list {}
.quick-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.quick-item:last-child { border-bottom: none; }
.quick-item-name { flex: 1; font-weight: 500; }
.quick-item-meta { font-size: 12px; color: var(--text2); }

/* ── Tags row ──────────────────────────────────────────── */
.tags-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── 2-col grid ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #sidebar {
    transform: translateX(-100%);
    width: 240px !important;
    transition: transform var(--transition);
    box-shadow: var(--shadow);
  }
  #sidebar.mobile-open { transform: translateX(0); }
  #main-wrap { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  #page-content { padding: 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
}

/* ============================================================
   MODULE-SPECIFIC
   ============================================================ */

/* Stok indicator */
.stok-bar { display: flex; align-items: center; gap: 8px; }
.stok-val { font-weight: 700; font-size: 14px; }
.stok-min { font-size: 11px; color: var(--text3); }

/* Kondisi aset */
.kondisi-baik        { color: var(--green); }
.kondisi-rusak_ringan { color: var(--accent); }
.kondisi-rusak_berat  { color: var(--red); }
.kondisi-tidak_aktif  { color: var(--text3); }

/* Meter display */
.meter-display {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
}
.meter-unit { font-size: 11px; color: var(--text3); font-family: var(--font-body); font-weight: 400; }

/* Status dot */
.status-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; margin-right: 5px;
}
.dot-green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-amber  { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.dot-red    { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-gray   { background: var(--text3); }

/* Permission matrix */
.perm-matrix { width: 100%; }
.perm-matrix th, .perm-matrix td { padding: 8px 10px; text-align: center; font-size: 12px; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; }
.perm-check { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

/* Role badge color */
.role-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
  background: var(--blue-bg); color: var(--blue);
}

/* SA badge */
.sa-badge {
  background: linear-gradient(135deg, #f5a623, #e8941a);
  color: #000; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
}
