:root {
  --navy: #01013F;
  --navy-light: #14144F;
  --navy-soft: #EAEAF3;
  --orange: #FF9C06;
  --orange-soft: #FFF1DC;
  --bg: #F6F7FB;
  --card: #FFFFFF;
  --text: #1F2430;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --success: #16A34A;
  --danger: #DC2626;
  --warning: #D97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(1,1,63,0.06), 0 1px 2px rgba(1,1,63,0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Nirmala UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--navy); text-decoration: none; }

/* ===== Layout ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #01013F 0%, #0a0a52 100%);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo img { height: 34px; }
.sidebar-logo span { font-weight: 700; font-size: 15px; letter-spacing: .5px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.7);
  padding: 10px 14px;
  font-size: 13.5px;
  border-radius: 9px;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(255,156,6,0.18), rgba(255,156,6,0.05));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--orange);
}
.sidebar-section-title {
  padding: 16px 14px 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 20px);
  margin: 0 10px 2px;
  background: none;
  border: none;
  border-radius: 9px;
  color: rgba(255,255,255,0.7);
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-group-toggle:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-group-toggle.open { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-group-arrow { transition: transform .15s ease; font-size: 11px; opacity: .7; }
.sidebar-group-toggle.open .sidebar-group-arrow { transform: rotate(90deg); }
.sidebar-submenu a {
  padding-left: 34px;
  font-size: 13px;
  margin-left: 10px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(1,1,63,0.04), 0 2px 8px rgba(1,1,63,0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 19px; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; }
.topbar-user { display: flex; align-items: center; gap: 14px; }
.topbar-user .text-muted { font-size: 13px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange) 0%, #E8850A 100%);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(255,156,6,0.35);
}

.content { padding: 24px; flex: 1; }
/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(1,1,63,0.04), 0 4px 16px rgba(1,1,63,0.06);
  padding: 22px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  box-shadow: 0 2px 6px rgba(1,1,63,0.06), 0 8px 24px rgba(1,1,63,0.08);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--navy); margin: 0 0 14px; letter-spacing: -0.01em; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card { padding: 14px; gap: 10px; }
.stat-icon { width: 40px; height: 40px; min-width: 40px; }
.stat-icon i { width: 18px; height: 18px; }
.stat-card .label { font-size: 11px; }
.stat-card .value { font-size: 16px; }
@media (max-width: 500px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { filter: brightness(0.95); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--navy); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-icon { padding: 6px 8px; display:inline-flex; align-items:center; justify-content:center; color: var(--text-muted); transition: color 0.15s ease, transform 0.1s ease; }
.btn-icon svg { width:16px; height:16px; display:block; }
.btn-icon:hover { color: var(--navy); }
.btn-icon:active { transform: scale(0.94); }
.btn-icon.btn-icon-success:hover { color: var(--success, #16A34A); }
.btn-icon.btn-icon-accent:hover { color: var(--orange); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  background: #fff;
  color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }

/* ===== Tables ===== */
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--navy-soft);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.data-table tr:hover td { background: #FAFAFD; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-pending { background: #FFF3D6; color: var(--warning); }
.badge-approved,.badge-active,.badge-delivered { background: #DCFCE7; color: var(--success); }
.badge-rejected,.badge-danger { background: #FEE2E2; color: var(--danger); }
.badge-stage { background: var(--orange-soft); color: var(--orange); }

/* ===== Login page ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, #0a0a5c 100%);
}
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  text-align: center;
}
.login-card img { height: 70px; margin-bottom: 16px; }
.login-card h1 { font-size: 18px; color: var(--navy); margin: 0 0 22px; }
.login-error {
  background: #FEE2E2; color: var(--danger);
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}

/* ===== Progress bar (order stage) ===== */
.progress-track { background: var(--navy-soft); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { background: var(--orange); height: 100%; border-radius: 999px; }

.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* Stat card — compact, circular icon avatar layout */
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(1,1,63,0.04), 0 4px 12px rgba(1,1,63,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(1,1,63,0.06), 0 8px 20px rgba(1,1,63,0.08);
}
.stat-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  box-shadow: 0 3px 6px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.5);
}
.stat-icon i {
  width: 22px;
  height: 22px;
}
.stat-card .label {
  font-size: 12px;
  margin-bottom: 4px;
}
.stat-card .value {
  font-size: 19px;
}
