/* ============================================================
   Shree Sai Balajee Enterprises — CRM Design System
   Theme: Executive Navy × Saffron Gold — refined Indian realty
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --navy:       #1a2e4a;
  --navy-dark:  #0f1e30;
  --navy-mid:   #243a56;
  --navy-light: #2f4a6a;
  --gold:       #c8991a;
  --gold-light: #e0b030;
  --gold-pale:  #fdf5e0;
  --saffron:    #e07820;

  --sidebar-w:    260px;
  --topbar-h:     60px;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;

  --white:        #ffffff;
  --bg:           #f0f4f8;
  --surface:      #ffffff;
  --surface-2:    #f7fafc;

  --gray-50:      #f8fafc;
  --gray-100:     #edf2f7;
  --gray-200:     #e2e8f0;
  --gray-400:     #a0aec0;
  --gray-500:     #718096;
  --gray-700:     #2d3748;
  --gray-900:     #1a202c;

  --green:        #22863a;
  --green-bg:     #e6f4ea;
  --red:          #c0392b;
  --red-bg:       #fde8e8;
  --orange:       #d97706;
  --orange-bg:    #fef3c7;
  --blue:         #2563eb;
  --blue-bg:      #dbeafe;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.14);
  --shadow-navy:  0 4px 24px rgba(26,46,74,.25);

  --transition:   .18s cubic-bezier(.4,0,.2,1);

  --font-body:    'DM Sans', sans-serif;
  --font-display: 'Playfair Display', serif;
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

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

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(200,153,26,.4);
}

.sidebar-title { color: var(--white); }
.sidebar-title .brand-main {
  font-family: var(--font-display);
  font-size: 13.5px;
  line-height: 1.2;
  font-weight: 600;
}
.sidebar-title .brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,.5);
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.nav-section-label {
  padding: 10px 20px 4px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  font-weight: 600;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}

.nav-link i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-link .nav-label { flex: 1; }
.nav-link .nav-chevron { font-size: 10px; transition: transform var(--transition); }

.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,.06);
}

.nav-link.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(200,153,26,.25) 0%, rgba(200,153,26,.1) 100%);
  border-left: 3px solid var(--gold);
  padding-left: 17px;
}

.nav-link.has-sub.open .nav-chevron { transform: rotate(90deg); }

/* Sub-nav */
.nav-sub {
  display: none;
  background: rgba(0,0,0,.15);
}
.nav-sub.open { display: block; }

.nav-sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px 7px 48px;
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
  transition: all var(--transition);
}
.nav-sub-link:before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
  flex-shrink: 0;
}
.nav-sub-link:hover { color: rgba(255,255,255,.9); }
.nav-sub-link.active { color: var(--gold-light); }

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), var(--saffron));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-info .user-name { color: var(--white); font-size: 13px; font-weight: 600; }
.user-info .user-role { color: rgba(255,255,255,.45); font-size: 11px; }

/* ── Top Bar ─────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--gray-700);
  cursor: pointer;
  padding: 4px;
}

.topbar-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}
.topbar-search i {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}
.topbar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
}
.topbar-search input:focus {
  background: var(--white);
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,46,74,.08);
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  display: none;
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
}
.search-results.visible { display: block; }
.search-result-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--gray-100);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--gray-50); }
.search-result-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.search-result-item .result-name { font-weight: 600; font-size: 13px; }
.search-result-item .result-sub  { font-size: 11px; color: var(--gray-500); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.topbar-btn {
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { border-color: var(--navy); color: var(--navy); background: var(--gray-50); }

.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.topbar-date {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: 24px;
}

.page-header {
  margin-bottom: 20px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--navy-dark);
  font-weight: 700;
}
.page-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb-sep { color: var(--gray-400); }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon.navy   { background: rgba(26,46,74,.1);  color: var(--navy); }
.stat-icon.gold   { background: rgba(200,153,26,.12); color: var(--gold); }
.stat-icon.info   { background: var(--blue-bg);    color: var(--blue); }
.stat-icon.success{ background: var(--green-bg);   color: var(--green); }
.stat-icon.danger { background: var(--red-bg);     color: var(--red); }
.stat-icon.orange { background: var(--orange-bg);  color: var(--orange); }

.stat-card.navy::before   { background: var(--navy); }
.stat-card.gold::before   { background: var(--gold); }
.stat-card.info::before   { background: var(--blue); }
.stat-card.success::before{ background: var(--green); }
.stat-card.danger::before { background: var(--red); }

.stat-content { flex: 1; min-width: 0; }
.stat-label { font-size: 11.5px; color: var(--gray-500); font-weight: 500; letter-spacing: .2px; text-transform: uppercase; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--gray-900); line-height: 1.2; margin-top: 2px; }
.stat-change { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i { color: var(--gold); }
.card-body { padding: 20px; }

.section-gap { margin-bottom: 20px; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead { background: var(--gray-50); }
.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr.overdue { background: #fff8f8; }
.data-table tbody tr.overdue td { color: var(--red); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-active, .badge-cleared, .badge-paid   { background: var(--green-bg); color: var(--green); }
.badge-pending                                { background: var(--orange-bg); color: var(--orange); }
.badge-cancelled, .badge-overdue, .badge-bounced { background: var(--red-bg); color: var(--red); }
.badge-available                              { background: var(--green-bg); color: var(--green); }
.badge-booked, .badge-held                    { background: var(--blue-bg); color: var(--blue); }
.badge-blocked                                { background: var(--orange-bg); color: var(--orange); }
.badge-sold, .badge-completed                 { background: rgba(26,46,74,.1); color: var(--navy); }
.badge-prospect                               { background: #ede9fe; color: #7c3aed; }
.badge-partial                                { background: #fef9c3; color: #a16207; }
.badge-low    { background: var(--blue-bg);   color: var(--blue); }
.badge-medium { background: var(--orange-bg); color: var(--orange); }
.badge-high   { background: var(--red-bg);    color: var(--red); }
.badge-urgent { background: #fce7f3; color: #db2777; }

.id-badge {
  display: inline-block;
  background: rgba(26,46,74,.08);
  color: var(--navy);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: monospace;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 11px 24px; font-size: 14px; }

.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(26,46,74,.25);
}
.btn-primary:hover { background: var(--navy-dark); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-navy); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(200,153,26,.3);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(200,153,26,.4); color: var(--white); }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #a93226; color: var(--white); }

.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: #1a6e2e; color: var(--white); }

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); background: var(--gray-50); }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 14px;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.form-label .req { color: var(--red); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-900);
  font-size: 13px;
  transition: all var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,46,74,.08);
}
.form-control:disabled, .form-control[readonly] {
  background: var(--gray-50);
  color: var(--gray-500);
}
.form-control.is-invalid { border-color: var(--red); }
.form-control.is-valid   { border-color: var(--green); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23718096'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 4px; }

.form-section {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--gray-100);
}
.form-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--gold);
  border-radius: 2px;
}

/* ── Alert / Flash ───────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  border-left: 3px solid;
}
.alert-success { background: var(--green-bg); color: #1a5e2e; border-color: var(--green); }
.alert-danger   { background: var(--red-bg);   color: #8b1a1a; border-color: var(--red); }
.alert-warning  { background: var(--orange-bg);color: #7a4a00; border-color: var(--orange); }
.alert-info     { background: var(--blue-bg);  color: #1e40af; border-color: var(--blue); }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--gray-700); background: rgba(255,255,255,.6); }
.tab-btn.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: modalIn .2s ease;
}
.modal-lg { max-width: 900px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-dark);
  font-family: var(--font-display);
}
.modal-close {
  width: 28px; height: 28px;
  background: var(--gray-100);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  font-size: 16px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Empty States ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; opacity: .5; }
.empty-state p { font-size: 13.5px; }

/* ── Print Styles ────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  body { background: white; }
}

/* ── Utilities ───────────────────────────────────────────────── */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--green); }
.text-danger  { color: var(--red); }
.text-warning { color: var(--orange); }
.text-gold    { color: var(--gold); }
.text-navy    { color: var(--navy); }
.text-small   { font-size: 11.5px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

.d-flex      { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.flex-wrap   { flex-wrap: wrap; }
.ms-auto     { margin-left: auto; }
.me-2        { margin-right: 8px; }
.mt-3        { margin-top: 16px; }
.mb-0        { margin-bottom: 0; }

.row   { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.col   { flex: 1; padding: 0 10px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 10px; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; padding: 0 10px; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 10px; }
.g-3   { gap: 12px; margin: 0; }
.g-3 > [class*='col'] { padding: 0; }

/* Grid helpers */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
  .topbar-toggle { display: flex; }
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
  .topbar-date { display: none; }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.timeline-dot {
  position: absolute;
  left: -24px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--gray-200);
}
.timeline-time { font-size: 11px; color: var(--gray-400); margin-bottom: 2px; }
.timeline-content { font-size: 13px; color: var(--gray-700); }
.timeline-ref { font-size: 11px; color: var(--navy); font-weight: 600; }

/* ── Tooltip ─────────────────────────────────────────────────── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Number formatting ───────────────────────────────────────── */
.amount-large {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}
.amount-positive { color: var(--green); }
.amount-negative { color: var(--red); }
.amount-pending  { color: var(--orange); }

/* ── Overdue highlight ───────────────────────────────────────── */
.overdue-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red-bg);
  color: var(--red);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
