/* =============================
   EXPENSE LEDGER - Premium CSS
   ============================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0d0f1a;
  --bg-secondary: #131628;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(124, 58, 237, 0.5);

  --purple: #7c3aed;
  --purple-light: #9d5ef5;
  --purple-glow: rgba(124, 58, 237, 0.3);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.3);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.3);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.3);
  --blue: #3b82f6;
  --blue-glow: rgba(59, 130, 246, 0.3);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 60%);
}

/* ======= SCROLLBAR ======= */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: var(--radius-full); }

/* ======= SCREEN ROUTER ======= */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  animation: fadeSlideUp 0.35s ease forwards;
}
.screen.active { display: flex; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======= TOP NAV ======= */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(13, 15, 26, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-nav .nav-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.top-nav .nav-back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 18px;
}
.top-nav .nav-back:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-action-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--purple-glow);
  border: 1px solid rgba(124, 58, 237, 0.4);
  cursor: pointer;
  color: var(--purple-light);
  font-size: 18px;
  transition: var(--transition);
}
.nav-action-btn:hover { background: var(--purple); color: white; }

/* ======= CONTENT AREA ======= */
.content {
  flex: 1;
  padding: 20px;
  padding-bottom: 120px;
}
/* Sub-screens with no bottom nav need less padding */
#screen-send-advance .content,
#screen-users .content,
#screen-payment-modes .content,
#screen-advances .content,
#screen-purchases-list .content,
#screen-approvals .content,
#screen-ledger .content,
#screen-settings .content {
  padding-bottom: 32px;
}

/* ======= BOTTOM NAV ======= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(13, 15, 26, 0.95);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-color);
  display: flex;
  padding: 8px 0 20px;
  z-index: 100;
}
.bottom-nav.hidden { display: none; }
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-md);
  position: relative;
}
.nav-item .nav-icon { font-size: 22px; transition: var(--transition); }
.nav-item .nav-label { font-size: 10px; font-weight: 500; color: var(--text-muted); transition: var(--transition); }
.nav-item.active .nav-icon { transform: translateY(-2px); }
.nav-item.active .nav-label { color: var(--purple-light); }
.nav-item .nav-dot {
  position: absolute;
  top: 6px; right: calc(50% - 14px);
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
  display: none;
}
.nav-item .nav-dot.show { display: block; }

/* ====== CARDS ====== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}
.card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.card-glass {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(10px);
}

/* ====== STAT CARDS ====== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.stat-icon { font-size: 24px; }
.stat-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.amber { color: var(--amber); }
.stat-value.purple { color: var(--purple-light); }
.stat-value.blue { color: var(--blue); }

/* ====== HERO BALANCE CARD ====== */
.hero-card {
  background: linear-gradient(135deg, #1e0a4e, #0f2b5b);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--shadow-glow);
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.25), transparent 70%);
  pointer-events: none;
}
.hero-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
  pointer-events: none;
}
.hero-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.hero-amount {
  font-size: 38px; font-weight: 800;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.hero-meta { display: flex; gap: 20px; }
.hero-meta-item { display: flex; flex-direction: column; gap: 2px; }
.hero-meta-label { font-size: 10px; color: rgba(255,255,255,0.4); font-weight: 500; }
.hero-meta-value { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.85); }

/* ====== BUTTONS ====== */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-bounce);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple), #5b21b6);
  color: white;
  box-shadow: 0 4px 20px var(--purple-glow);
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5); transform: translateY(-1px); }
.btn-success {
  background: linear-gradient(135deg, var(--green), #059669);
  color: white;
  box-shadow: 0 4px 20px var(--green-glow);
}
.btn-danger {
  background: linear-gradient(135deg, var(--red), #b91c1c);
  color: white;
  box-shadow: 0 4px 20px var(--red-glow);
}
.btn-ghost {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); background: var(--bg-card-hover); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-amber {
  background: linear-gradient(135deg, var(--amber), #d97706);
  color: white;
  box-shadow: 0 4px 20px var(--amber-glow);
}

/* ====== FORMS ====== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
select.form-control option { background: #1e1e2e; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ====== LIST ITEMS ====== */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: var(--transition);
  cursor: pointer;
}
.list-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateX(2px); }
.list-item-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.list-item-icon.purple { background: var(--purple-glow); }
.list-item-icon.green { background: var(--green-glow); }
.list-item-icon.red { background: var(--red-glow); }
.list-item-icon.amber { background: var(--amber-glow); }
.list-item-icon.blue { background: var(--blue-glow); }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-item-right { text-align: right; flex-shrink: 0; }
.list-item-amount { font-size: 15px; font-weight: 700; }
.list-item-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ====== BADGE ====== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-purple { background: var(--purple-glow); color: var(--purple-light); border: 1px solid rgba(124,58,237,0.25); }
.badge-green { background: var(--green-glow); color: var(--green); border: 1px solid rgba(16,185,129,0.25); }
.badge-amber { background: var(--amber-glow); color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.badge-red { background: var(--red-glow); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.badge-blue { background: var(--blue-glow); color: var(--blue); border: 1px solid rgba(59,130,246,0.25); }

/* ====== SECTION HEADER ====== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
}
.section-link {
  font-size: 13px; font-weight: 600; color: var(--purple-light); cursor: pointer;
  text-decoration: none;
}
.section-link:hover { text-decoration: underline; }

/* ====== QUICK ACTIONS ====== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-bounce);
  text-decoration: none;
}
.quick-action:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.quick-action:active { transform: scale(0.96); }
.qa-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.qa-icon.purple { background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(124,58,237,0.1)); }
.qa-icon.green { background: linear-gradient(135deg, rgba(16,185,129,0.3), rgba(16,185,129,0.1)); }
.qa-icon.amber { background: linear-gradient(135deg, rgba(245,158,11,0.3), rgba(245,158,11,0.1)); }
.qa-icon.red { background: linear-gradient(135deg, rgba(239,68,68,0.3), rgba(239,68,68,0.1)); }
.qa-icon.blue { background: linear-gradient(135deg, rgba(59,130,246,0.3), rgba(59,130,246,0.1)); }
.qa-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-align: center; }

/* ====== DIVIDER ====== */
.divider {
  height: 1px; background: var(--border-color); margin: 20px 0;
}
.divider-text {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  color: var(--text-muted); font-size: 12px; font-weight: 500;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border-color);
}

/* ====== LOGIN SCREEN ====== */
#screen-login {
  background: var(--bg-primary);
  justify-content: center;
  align-items: center;
  padding: 32px 24px;
  min-height: 100vh;
}
.login-logo {
  text-align: center;
  margin-bottom: 40px;
}
.login-logo-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--purple), #4f46e5);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  box-shadow: 0 20px 50px var(--purple-glow);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 20px 50px var(--purple-glow); }
  50% { box-shadow: 0 20px 70px rgba(124, 58, 237, 0.5); }
}
.login-logo h1 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-logo p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.login-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
}
.login-users-grid {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px;
}
.user-select-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  width: 100%; text-align: left;
}
.user-select-btn:hover { border-color: var(--purple); background: rgba(124, 58, 237, 0.08); }
.user-avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
  color: white;
}
.user-info { flex: 1; }
.user-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.user-arrow { color: var(--text-muted); font-size: 16px; }

/* ====== IMAGE UPLOAD ====== */
.image-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.image-upload-area:hover { border-color: var(--purple); background: rgba(124, 58, 237, 0.05); }
.image-upload-area input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 13px; color: var(--text-muted); }
.upload-preview {
  width: 100%; height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: none;
}

/* ====== MODAL / BOTTOM SHEET ====== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  width: 100%;
  max-width: 430px;
  background: #161828;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px;
  padding-bottom: 40px;
  border: 1px solid var(--border-color);
  border-bottom: none;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  margin: 0 auto 20px;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

/* ====== LEDGER TIMELINE ====== */
.ledger-timeline { position: relative; }
.ledger-timeline::before {
  content: ''; position: absolute;
  left: 21px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--purple), var(--border-color));
}
.ledger-entry {
  display: flex; gap: 14px;
  margin-bottom: 16px;
  position: relative;
}
.ledger-dot {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.ledger-dot.income { background: var(--green-glow); border: 2px solid var(--green); }
.ledger-dot.expense { background: var(--red-glow); border: 2px solid var(--red); }
.ledger-dot.pending { background: var(--amber-glow); border: 2px solid var(--amber); }
.ledger-body {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.ledger-body-title { font-size: 14px; font-weight: 600; }
.ledger-body-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ledger-body-amount { font-size: 16px; font-weight: 700; margin-top: 6px; }
.ledger-body-amount.income { color: var(--green); }
.ledger-body-amount.expense { color: var(--red); }
.ledger-body-amount.pending { color: var(--amber); }

/* ====== APPROVAL CARD ====== */
.approval-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
}
.approval-card:hover { border-color: var(--amber); }
.approval-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.approval-img {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.approval-img img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.approval-body { flex: 1; }
.approval-title { font-size: 15px; font-weight: 600; }
.approval-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.approval-amount { font-size: 20px; font-weight: 800; color: var(--amber); text-align: right; }
.approval-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ====== EMPTY STATE ====== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-icon { font-size: 60px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub { font-size: 14px; color: var(--text-muted); max-width: 220px; margin: 0 auto 20px; line-height: 1.5; }

/* ====== TAG CHIPS ====== */
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}
.tag-chip:hover, .tag-chip.selected {
  border-color: var(--purple); color: var(--purple-light); background: var(--purple-glow);
}
.tag-chip .remove { font-size: 14px; color: var(--text-muted); }

/* ====== ROLE BADGE ====== */
.role-boss { color: var(--purple-light); }
.role-purchaser { color: var(--blue); }

/* ====== TOAST ====== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}
.toast {
  background: #1e2235;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
}
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(59,130,246,0.4); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

/* ====== UTILITIES ====== */
.mt-4 { margin-top: 16px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.fw-700 { font-weight: 700; }
.gap-2 { gap: 8px; }
.flex { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.justify-between { justify-content: space-between; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.hidden { display: none !important; }

/* ====== PURCHASE DETAIL PREVIEW PHOTO ====== */
.purchase-photo-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: block;
  margin-bottom: 12px;
}

/* ====== SETTINGS PAGE ====== */
.settings-section { margin-bottom: 28px; }
.settings-section-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 12px; padding-left: 4px;
}
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.settings-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.settings-item-label { font-size: 14px; font-weight: 500; }
.settings-item-value { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ====== LOGIN SCREEN UPDATES ====== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.input-with-icon {
  position: relative;
}
.input-with-icon i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.input-with-icon .form-control {
  padding-left: 44px;
}

/* ====== GLOBAL LOADER ====== */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 15, 26, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.loader-overlay.active {
  display: flex;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--purple-glow);
  border-top-color: var(--purple-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loader-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* ====== PRINT / PDF EXPORT STYLES ====== */
@media print {
  body {
    background: #0d0f1a !important; /* Keep dark theme for PDF */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* Hide UI elements not needed in PDF */
  .top-nav, 
  .bottom-nav, 
  .toast-container, 
  .loader-overlay,
  .modal-overlay,
  button, 
  .btn {
    display: none !important;
  }

  /* Make sure only the active screen prints */
  .screen:not(.active) {
    display: none !important;
  }
  
  .screen.active {
    display: block !important;
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  
  .content {
    padding: 20px !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* Avoid page breaks inside important cards */
  .stat-card, .ledger-entry {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
