/* ================================================================
   VastuVeda Realty CRM — Premium CSS
   Theme: Maroon #800000 · Gold #D4AF37 · Warm White #F8F6F3
================================================================ */

/* ── CSS Variables ────────────────────────────────────────────── */
:root {
  --maroon:      #800000;
  --maroon-dark: #5a0000;
  --maroon-light:#a00000;
  --gold:        #D4AF37;
  --gold-light:  #e8ca6a;
  --warm-white:  #F8F6F3;
  --warm-bg:     #F2EDE6;
  --white:       #ffffff;
  --text:        #1a1a2e;
  --text-muted:  #6b7280;
  --border:      #e8dfd6;
  --shadow-sm:   0 1px 3px rgba(128,0,0,.08);
  --shadow-md:   0 4px 16px rgba(128,0,0,.12);
  --shadow-lg:   0 10px 32px rgba(128,0,0,.15);
  --radius:      10px;
  --sidebar-w:   260px;
  --topbar-h:    60px;
  --transition:  .2s ease;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; font-size: 14px; color: var(--text); line-height: 1.6; }
a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--maroon-light); }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Auth Layout ──────────────────────────────────────────────── */
.auth-body { margin: 0; padding: 0; min-height: 100vh; font-family: 'Montserrat', sans-serif; background: #0a0505; }

/* ── Keyframe animations ── */
@keyframes blob1   { 0%,100%{transform:translate(0,0) scale(1)}   50%{transform:translate(40px,-30px) scale(1.12)} }
@keyframes blob2   { 0%,100%{transform:translate(0,0) scale(1)}   50%{transform:translate(-30px,40px) scale(1.08)} }
@keyframes blob3   { 0%,100%{transform:translate(0,0) scale(1)}   50%{transform:translate(20px,20px)  scale(1.15)} }
@keyframes card-in { from{opacity:0;transform:translateY(28px)}   to{opacity:1;transform:translateY(0)} }
@keyframes line-in { from{width:0} to{width:40px} }

/* ── Login page — centered card ───────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
  background: #0a0505;
}

/* Animated background blobs */
.ln-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.ln-blob-1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(128,0,0,.28) 0%, transparent 70%); top: -100px; left: -100px; animation: blob1 12s ease-in-out infinite; }
.ln-blob-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(212,175,55,.1) 0%, transparent 70%); bottom: -80px; right: -80px; animation: blob2 14s ease-in-out infinite 2s; }
.ln-blob-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(90,0,0,.2) 0%, transparent 70%); top: 40%; left: 50%; animation: blob3 10s ease-in-out infinite 1s; }

/* Card */
.ln-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(20, 8, 8, 0.85);
  border: 1px solid rgba(212,175,55,.12);
  border-radius: 24px;
  padding: 44px 40px 36px;
  backdrop-filter: blur(24px);
  box-shadow: 0 32px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.02) inset;
  animation: card-in .5s cubic-bezier(.22,1,.36,1) both;
}

/* Logo / brand */
.ln-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.ln-brand-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, rgba(212,175,55,.12), rgba(212,175,55,.04));
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
}
.ln-brand-name { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: 5px; line-height: 1; }
.ln-brand-sub  { font-size: 9px; color: var(--gold); letter-spacing: 6px; font-weight: 600; margin-top: 2px; }

/* Gold accent line */
.ln-line {
  display: block;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 28px;
  animation: line-in .8s ease .4s forwards;
}

.lp-flash { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.28); color: #fca5a5; font-size: 12.5px; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }

/* Fields */
.lp-field { position: relative; margin-bottom: 14px; }
.lp-field-label { display: block; font-size: 10px; font-weight: 700; color: rgba(255,255,255,.35); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.lp-field-inner { position: relative; }
.lp-field input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: 13px 44px 13px 44px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  color: #fff;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.lp-field input::placeholder { color: rgba(255,255,255,.2); }
.lp-field input:focus { border-color: rgba(212,175,55,.45); background: rgba(255,255,255,.055); box-shadow: 0 0 0 3px rgba(212,175,55,.07); }
.lp-field-inner:focus-within .lp-field-icon { color: rgba(212,175,55,.75); }
.lp-field .lp-field-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.22); font-size: 14px; pointer-events: none; transition: color .2s; }
.lp-field .lp-pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: rgba(255,255,255,.22); font-size: 13px; cursor: pointer; padding: 4px; transition: color .2s; }
.lp-field .lp-pw-toggle:hover { color: rgba(255,255,255,.6); }

.lp-row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 20px; }
.lp-remember { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.45); font-size: 12px; cursor: pointer; }
.lp-remember input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--gold); cursor: pointer; }
.lp-forgot { color: var(--gold); font-size: 12px; font-weight: 600; text-decoration: none; }
.lp-forgot:hover { opacity: .8; }

.lp-signin-btn {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  border: none;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #1a0808;
  text-transform: uppercase;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s, background .2s;
  margin-bottom: 18px;
}
.lp-signin-btn:hover { background: var(--gold-light); box-shadow: 0 6px 24px rgba(212,175,55,.35); transform: translateY(-1px); }
.lp-signin-btn:active { transform: translateY(0); }

.lp-or { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lp-or hr { flex: 1; border: none; border-top: 1px solid rgba(255,255,255,.07); }
.lp-or span { font-size: 10px; color: rgba(255,255,255,.2); letter-spacing: 1px; }

.lp-support-btn { width: 100%; padding: 11px; background: transparent; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 500; color: rgba(255,255,255,.4); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: border-color .2s, color .2s; text-decoration: none; }
.lp-support-btn:hover { border-color: rgba(212,175,55,.25); color: rgba(212,175,55,.7); }

.ln-footer { margin-top: 28px; text-align: center; }
.ln-footer-text { font-size: 10px; color: rgba(255,255,255,.15); letter-spacing: 2.5px; text-transform: uppercase; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .ln-card { padding: 32px 24px 28px; border-radius: 18px; }
  .ln-brand-name { font-size: 16px; }
}

/* ── App Layout ───────────────────────────────────────────────── */
.app-body { background: var(--warm-bg); }

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-w); background: linear-gradient(180deg, var(--maroon-dark) 0%, var(--maroon) 60%, #6b0000 100%); overflow-y: auto; overflow-x: hidden; z-index: 200; transition: transform var(--transition); }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.sidebar-brand { display: flex; align-items: center; gap: .875rem; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-icon { width: 38px; height: 38px; background: linear-gradient(135deg, var(--gold), var(--gold-light)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; color: var(--maroon); flex-shrink: 0; }
.brand-name { display: block; font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub { display: block; font-size: 10px; color: var(--gold); letter-spacing: .8px; text-transform: uppercase; }

.sidebar-nav { padding: 12px 0 24px; }
.nav-section-label { padding: 16px 20px 6px; font-size: 9.5px; font-weight: 600; letter-spacing: 1.2px; color: rgba(212,175,55,.6); text-transform: uppercase; }

.nav-item { display: flex; align-items: center; gap: .75rem; padding: 10px 20px; color: rgba(255,255,255,.75); font-size: 13.5px; font-weight: 400; transition: all var(--transition); position: relative; }
.nav-item i { width: 18px; text-align: center; font-size: 14px; opacity: .85; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item.active { background: rgba(212,175,55,.15); border-right: 3px solid var(--gold); }
.nav-item.active i { color: var(--gold); }
.nav-logout { margin-top: .5rem; }
.nav-logout:hover { background: rgba(255,80,80,.15); color: #ff9999; }
.badge-bubble { margin-left: auto; background: var(--gold); color: var(--maroon); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 12px; }

/* Main wrapper */
.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left var(--transition); }

/* Topbar */
.topbar { height: var(--topbar-h); background: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 1rem; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.sidebar-toggle { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--text-muted); font-size: 16px; transition: background var(--transition); }
.sidebar-toggle:hover { background: var(--warm-bg); color: var(--maroon); }
.topbar-title { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 600; color: var(--maroon); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }

.icon-btn { background: none; border: none; cursor: pointer; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 15px; position: relative; transition: background var(--transition); }
.icon-btn:hover { background: var(--warm-bg); color: var(--maroon); }
.notif-dot { position: absolute; top: 4px; right: 4px; background: var(--maroon); color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

.user-chip { display: flex; align-items: center; gap: .5rem; background: var(--warm-bg); border: 1px solid var(--border); border-radius: 24px; padding: 4px 12px 4px 4px; cursor: pointer; transition: all var(--transition); }
.user-chip:hover { border-color: var(--maroon); }
.user-avatar { width: 28px; height: 28px; background: var(--maroon); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.user-name-short { font-size: 13px; font-weight: 500; }

.user-dropdown { position: absolute; top: calc(var(--topbar-h) - 8px); right: 24px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); min-width: 200px; box-shadow: var(--shadow-lg); z-index: 300; display: none; overflow: hidden; }
.user-dropdown.show { display: block; }
.dropdown-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dropdown-header strong { display: block; font-weight: 600; }
.dropdown-header small { color: var(--text-muted); font-size: 12px; }
.role-tag { display: inline-block; margin-top: 4px; background: var(--warm-bg); color: var(--maroon); font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 12px; border: 1px solid var(--border); }
.user-dropdown a { display: flex; align-items: center; gap: .5rem; padding: 10px 16px; color: var(--text); font-size: 13px; transition: background var(--transition); }
.user-dropdown a:hover { background: var(--warm-bg); }
.user-dropdown .logout-link:hover { background: #fff5f5; color: #c0392b; }

/* Page content */
.page-content { flex: 1; padding: 24px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-title { font-family: 'Montserrat', sans-serif; font-size: 26px; font-weight: 700; color: var(--maroon); line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-subtitle a { color: var(--text-muted); }
.page-subtitle a:hover { color: var(--maroon); }
.page-actions { display: flex; gap: .5rem; align-items: center; }

/* Flash */
.flash { display: flex; align-items: center; gap: .75rem; margin: 0 24px 0; padding: 12px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 500; animation: slideDown .25s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.flash-close   { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 18px; opacity: .6; line-height: 1; }

/* ── Cards ────────────────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 600; color: var(--maroon); }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.mt-3 { margin-top: 1.5rem; }

/* ── Stat Cards ───────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; gap: 1rem; border: none; box-shadow: var(--shadow-sm); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-value { font-family: 'Montserrat', sans-serif; font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; font-weight: 500; opacity: .8; text-transform: uppercase; letter-spacing: .4px; }
.stat-sub { font-size: 11px; opacity: .65; margin-top: 2px; }

.stat-blue   { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; }
.stat-blue   .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-red    { background: linear-gradient(135deg, #b91c1c, #ef4444); color: #fff; }
.stat-red    .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-green  { background: linear-gradient(135deg, #047857, #10b981); color: #fff; }
.stat-green  .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-purple { background: linear-gradient(135deg, #6d28d9, #8b5cf6); color: #fff; }
.stat-purple .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-gold   { background: linear-gradient(135deg, var(--maroon), var(--maroon-light)); color: #fff; }
.stat-gold   .stat-icon { background: rgba(212,175,55,.25); color: var(--gold); }
.stat-orange { background: linear-gradient(135deg, #b45309, #f59e0b); color: #fff; }
.stat-orange .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-secondary { background: linear-gradient(135deg, #374151, #6b7280); color: #fff; }

/* ── Charts ───────────────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.chart-card .card-body { padding: 16px 20px; }
.chart-donut-wrap { max-width: 260px; margin: 0 auto; }

/* ── Tables ───────────────────────────────────────────────────── */
.table-card { overflow: hidden; }
.table-meta { padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th { background: var(--warm-bg); color: var(--text-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--warm-bg); }
.table-link { color: var(--maroon); font-weight: 500; }
.table-link:hover { text-decoration: underline; }
.table-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.table-actions { display: flex; gap: .3rem; align-items: center; }
.action-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--warm-bg); border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; cursor: pointer; transition: all var(--transition); }
.action-btn:hover { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.action-btn-danger:hover { background: #ef4444; border-color: #ef4444; }
.inline-form { display: inline; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .2px; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-secondary { background: #f3f4f6; color: #374151; }
.badge-dark      { background: #374151; color: #fff; }

/* Role badges */
.role-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.role-admin          { background: #fee2e2; color: #800000; }
.role-manager        { background: #fef3c7; color: #92400e; }
.role-sales_executive { background: #dbeafe; color: #1e40af; }

/* ── Filters ──────────────────────────────────────────────────── */
.filter-card { padding: 16px 20px; margin-bottom: 1rem; }
.filter-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filter-form .form-control { min-width: 150px; max-width: 200px; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-card { padding: 24px; }
.form-section-title { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 600; color: var(--maroon); border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 1rem; margin-top: 1.5rem; }
.form-section-title:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: 12.5px; font-weight: 500; color: var(--text); }
.req { color: #ef4444; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; background: var(--white); color: var(--text); transition: border-color var(--transition), box-shadow var(--transition); outline: none; font-family: 'Montserrat', sans-serif; }
.form-control:focus { border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(128,0,0,.1); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input { width: 16px; height: 16px; cursor: pointer; }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.self-end { align-self: flex-end; }

/* Input with icon */
.input-icon-wrap { position: relative; }
.input-icon-wrap > i:first-child { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.4); font-size: 13px; }
.input-icon-wrap .form-control { padding-left: 36px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.input-icon-wrap .form-control::placeholder { color: rgba(255,255,255,.4); }
.input-icon-wrap .form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.2); background: rgba(255,255,255,.12); }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: rgba(255,255,255,.4); font-size: 13px; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: 8px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; border: none; transition: all var(--transition); font-family: 'Montserrat', sans-serif; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-light); color: #fff; }
.btn-secondary { background: var(--warm-bg); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--warm-bg); color: var(--text); }
.btn-full { width: 100%; justify-content: center; padding: 11px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-link { background: none; border: none; color: var(--maroon); font-size: 12px; cursor: pointer; padding: 0; font-family: 'Montserrat', sans-serif; }
.btn-link:hover { text-decoration: underline; }

/* ── Pagination ───────────────────────────────────────────────── */
.pagination { display: flex; list-style: none; gap: .25rem; padding: 16px 20px; flex-wrap: wrap; }
.page-item .page-link { display: flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--text); font-size: 13px; transition: all var(--transition); text-decoration: none; background: var(--white); }
.page-item.active .page-link { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.page-item.disabled .page-link { opacity: .4; cursor: not-allowed; }
.page-item:not(.disabled) .page-link:hover { background: var(--warm-bg); border-color: var(--maroon); }

/* ── Projects grid ────────────────────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.project-card { display: flex; flex-direction: column; transition: box-shadow var(--transition); }
.project-card:hover { box-shadow: var(--shadow-md); }
.project-img { height: 160px; background-size: cover; background-position: center; }
.project-img-placeholder { background: var(--warm-bg); display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--border); }
.project-body { padding: 16px; flex: 1; }
.project-status-row { margin-bottom: .5rem; }
.project-name { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; color: var(--maroon); margin-bottom: .3rem; }
.project-location { font-size: 12px; color: var(--text-muted); margin-bottom: .75rem; }
.project-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: .25rem; }
.pstat { text-align: center; }
.pstat span { display: block; font-weight: 700; font-size: 15px; color: var(--maroon); }
.pstat small { font-size: 10px; color: var(--text-muted); }
.project-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: .5rem; }
.project-status { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-upcoming { background: #dbeafe; color: #1e40af; }
.status-ongoing  { background: #d1fae5; color: #065f46; }
.status-completed{ background: #f3f4f6; color: #374151; }
.status-archived { background: #fef3c7; color: #92400e; }

/* Source tag */
.source-tag { display: inline-block; padding: 2px 8px; background: var(--warm-bg); border-radius: 20px; font-size: 11px; color: var(--text-muted); }

/* ── Detail layout ────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.detail-card { height: 100%; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: 13.5px; }
.detail-list dt { color: var(--text-muted); font-size: 12px; font-weight: 500; padding-top: 2px; white-space: nowrap; }
.detail-list dd { font-weight: 500; }
.notes-box { background: var(--warm-bg); border-radius: 8px; padding: 12px; margin-top: 1rem; font-size: 13px; }
.notes-box strong { font-size: 12px; color: var(--text-muted); }

/* ── Followup/Timeline ────────────────────────────────────────── */
.followup-list { }
.followup-item { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .25rem; }
.followup-item:last-child { border-bottom: none; }
.followup-name { font-weight: 600; font-size: 13.5px; color: var(--maroon); }
.followup-meta { display: flex; gap: 1rem; font-size: 12px; color: var(--text-muted); }
.followup-date.overdue { color: #ef4444; font-weight: 600; }

.timeline { padding: 16px 0; }
.timeline-item { display: flex; gap: 1rem; padding: 0 20px 20px; position: relative; }
.timeline-item::before { content:''; position: absolute; left: 36px; top: 36px; bottom: 0; width: 1px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--warm-bg); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--maroon); flex-shrink: 0; margin-top: 2px; }
.timeline-header { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .25rem; }
.timeline-header strong { font-weight: 600; font-size: 13px; }
.timeline-date { font-size: 12px; color: var(--text-muted); }
.timeline-notes { font-size: 13px; color: var(--text); margin-bottom: .25rem; }

/* ── Notifications ────────────────────────────────────────────── */
.notif-list { }
.notif-item { display: flex; align-items: center; gap: 1rem; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.notif-item.unread { background: #fffbf0; }
.notif-item:last-child { border-bottom: none; }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--warm-bg); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--maroon); flex-shrink: 0; }
.notif-msg { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.notif-time { font-size: 11px; color: var(--text-muted); }

/* ── Reports ──────────────────────────────────────────────────── */
.reports-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.report-card { padding: 28px; text-align: center; transition: box-shadow var(--transition); color: var(--text); cursor: pointer; }
.report-card:hover { box-shadow: var(--shadow-md); border-color: var(--maroon); }
.report-icon { width: 56px; height: 56px; background: var(--warm-bg); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--maroon); margin: 0 auto 1rem; }
.report-card h3 { font-family: 'Montserrat', sans-serif; font-size: 18px; color: var(--maroon); margin-bottom: .4rem; }
.report-card p { font-size: 12.5px; color: var(--text-muted); }

/* ── User cell ────────────────────────────────────────────────── */
.user-cell { display: flex; align-items: center; gap: .6rem; }
.user-avatar-sm { width: 30px; height: 30px; background: var(--maroon); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.avatar-lg { width: 72px; height: 72px; background: var(--maroon); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; margin: 0 auto; }

/* ── Misc ─────────────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; color: var(--text-muted); gap: .75rem; }
.empty-state i { font-size: 32px; opacity: .4; }
.text-center { text-align: center; }
.text-danger  { color: #ef4444; }
.text-success { color: #10b981; }
.text-muted   { color: var(--text-muted); }
.fw-600       { font-weight: 600; }
.py-4         { padding-top: 1rem; padding-bottom: 1rem; }
.py-5         { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mt-2         { margin-top: .5rem; }

/* ── Sidebar collapsed ────────────────────────────────────────── */
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main-wrapper { margin-left: 0; }

/* ── Attendance / Face Recognition ───────────────────────────── */
.face-video-wrap { position: relative; display: inline-block; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.face-video-wrap video, .face-video-wrap canvas { display: block; }
.face-video-wrap canvas { position: absolute; top: 0; left: 0; }
.alert { padding: .85rem 1.2rem; border-radius: 10px; margin-bottom: 1rem; display: flex; align-items: flex-start; gap: .6rem; font-size: .9rem; }
.alert-info    { background: #e8f4fd; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.alert-success { background: #d1e7dd; color: #155724; border: 1px solid #badbcc; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.d-flex        { display: flex; }
.gap-2         { gap: .5rem; }
.gap-3         { gap: .75rem; }
.justify-content-center { justify-content: center; }
.flex-wrap     { flex-wrap: wrap; }
.mb-0          { margin-bottom: 0; }
.mb-3          { margin-bottom: .75rem; }
.mb-4          { margin-bottom: 1rem; }
.mx-auto       { margin-left: auto; margin-right: auto; }
.text-warning  { color: #fd7e14; }
.d-block       { display: block; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.col-lg-7 { min-width: 0; }
.col-lg-5 { min-width: 0; }

/* ── Print ────────────────────────────────────────────────────── */
@media print {
  .no-print, .sidebar, .topbar, .flash { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-wrapper { margin-left: 0; }
  .sidebar.open { transform: translateX(0); }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .reports-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: 1; }
  .auth-left { display: none; }
  .auth-right { flex: 1; }
  .projects-grid { grid-template-columns: 1fr; }
}
