:root {
  --brand-orange: #e8590c;
  --brand-orange-dark: #c94f0f;
  --brand-navy: #1c2733;
  --brand-navy-light: #263444;
  --brand-steel: #4a5a6a;
  --bg-body: #f4f6f8;
  --border-light: #e3e7eb;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: #212a33;
}

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

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-navy) 0%, #141c25 100%);
  color: #d7dee5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1030;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: .3px;
}
.sidebar-brand i { color: var(--brand-orange); font-size: 1.4rem; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-nav .nav-link {
  color: #b7c1cb;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: .92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .15s ease;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; font-size: 1.05rem; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav .nav-link.active {
  background: var(--brand-orange);
  color: #fff;
  box-shadow: 0 3px 10px rgba(232,89,12,0.35);
}

.sidebar-heading {
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .08em;
  color: #6b7885;
  padding: 16px 14px 6px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px 20px;
  font-size: .75rem;
  color: #5f6c78;
  border-top: 1px solid rgba(255,255,255,0.08);
}

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

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar-title { font-size: 1.15rem; font-weight: 700; color: var(--brand-navy); }

.role-badge { font-weight: 600; font-size: .7rem; letter-spacing: .04em; padding: .4em .7em; }

.avatar-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
}

.app-content {
  padding: 24px;
  flex: 1;
}

/* ---------- Cards ---------- */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 20px;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 12px;
}
.stat-card .stat-label { font-size: .8rem; color: #6b7885; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--brand-navy); }
.icon-orange { background: var(--brand-orange); }
.icon-navy { background: var(--brand-navy); }
.icon-green { background: #2f9e44; }
.icon-red { background: #e03131; }

.card {
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  font-weight: 700;
  color: var(--brand-navy);
}

/* ---------- Tables ---------- */
.table thead th {
  background: #f8f9fb;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7885;
  font-weight: 700;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
}
.table td { vertical-align: middle; font-size: .9rem; }

.progress { height: 8px; border-radius: 20px; background: #edf0f2; }

/* ---------- Buttons ---------- */
.btn-brand {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #fff;
  font-weight: 600;
}
.btn-brand:hover { background: var(--brand-orange-dark); border-color: var(--brand-orange-dark); color: #fff; }

.btn-navy {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #fff;
  font-weight: 600;
}
.btn-navy:hover { background: #141c25; border-color: #141c25; color: #fff; }

/* ---------- Login page ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.login-visual {
  flex: 1.1;
  background: linear-gradient(160deg, var(--brand-navy) 0%, #101820 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.login-visual::after {
  content: "";
  position: absolute;
  right: -80px; bottom: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(232,89,12,0.35) 0%, transparent 70%);
}
.login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 40px;
}
.login-card { width: 100%; max-width: 380px; }

/* ---------- Badges for categories ---------- */
.badge-category { font-weight: 600; font-size: .72rem; padding: .45em .7em; }

/* ---------- Misc ---------- */
.section-title { font-weight: 800; color: var(--brand-navy); }
.text-muted-light { color: #8a97a3; }
.receipt-thumb { width: 100%; max-width: 260px; border-radius: 8px; border: 1px solid var(--border-light); }

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: -260px;
    transition: left .2s ease;
  }
  .sidebar.show { left: 0; }
  .login-visual { display: none; }
}
