/* ============================================
   MANORTHA ERP - Global Design System
   Brand: Manortha Builders & Developers
   ============================================ */

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

/* ---- CSS Variables (Design Tokens) ---- */
/* Brand: Manortha Builders & Developers
   Primary Navy: #1F2A44
   Gold: #FDB813 → #D9531E → #8C1D18 (gradient)
   Tagline: white on burgundy-to-gold strip
*/
:root {
  /* ── Core Brand ── */
  --primary: #1F2A44;
  --primary-dark: #141c30;
  --primary-container: #273351;
  --primary-light: #2e3d60;
  --on-primary: #ffffff;
  --on-primary-container: #a8b4cc;

  /* ── Brand Gradient (icon / accent) ── */
  --gold-bright: #FDB813;
  --gold-mid: #D9531E;
  --gold-dark: #8C1D18;
  --brand-gradient: linear-gradient(135deg, #FDB813 0%, #D9531E 50%, #8C1D18 100%);
  --brand-gradient-h: linear-gradient(90deg, #FDB813 0%, #D9531E 55%, #8C1D18 100%);

  /* ── Secondary / Gold ── */
  --secondary: #D9531E;
  --secondary-light: #FDB813;
  --secondary-container: #FFF0D6;
  --on-secondary: #ffffff;
  --on-secondary-container: #8C1D18;

  /* ── Surfaces ── */
  --background: #F5F6F8;
  --surface-white: #ffffff;
  --surface-container-low: #f0f2f5;
  --surface-container: #e9ecf1;
  --surface-container-high: #e0e4eb;

  /* ── Text ── */
  --on-surface: #111827;
  --on-surface-variant: #374151;
  --text-muted: #6B7280;

  /* ── UI ── */
  --border-subtle: #E2E8F0;
  --status-success: #10B981;
  --status-pending: #F59E0B;
  --status-error: #EF4444;
  --accent-sky: #A7D1EF;

  /* ── Legacy compat ── */
  --champagne-gold: #D9531E;
  --outline: #9CA3AF;
  --error-container: #ffdad6;
  --on-error-container: #93000a;

  /* ── Sidebar ── */
  --sidebar-bg: #1F2A44;
  --sidebar-active-bg: rgba(253,184,19,0.12);
  --sidebar-active-color: #FDB813;
  --sidebar-text: rgba(168,180,204,0.85);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background);
  color: var(--on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-container); }

/* ---- Material Symbols ---- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  font-size: 22px;
}
.material-symbols-outlined.text-sm { font-size: 18px; }
.material-symbols-outlined.text-xs { font-size: 16px; }
.material-symbols-outlined.text-xl { font-size: 28px; }
.material-symbols-outlined.text-2xl { font-size: 36px; }
.material-symbols-outlined.text-3xl { font-size: 48px; }

/* ---- Layout Shell ---- */
#app { min-height: 100vh; }

.erp-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 256px;
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background-color: var(--primary);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  z-index: 50;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  padding: 0 24px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}

.sidebar-logo img {
  height: 36px;
  width: auto;
}

.sidebar-logo-text h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--on-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar-logo-text p {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--on-primary-container);
  text-transform: uppercase;
  opacity: 0.7;
}

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

.nav-section-title {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-primary-container);
  opacity: 0.5;
  padding: 16px 16px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 2px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s ease;
  text-decoration: none;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  color: #fff;
  background: rgba(253,184,19,0.08);
}

.nav-item.active {
  color: var(--sidebar-active-color);
  background: var(--sidebar-active-bg);
  border-left: 3px solid var(--sidebar-active-color);
  padding-left: 13px;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--status-error);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 16px;
}

.btn-new-booking {
  width: 100%;
  background: var(--brand-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s;
  margin-bottom: 8px;
}
.btn-new-booking:hover { opacity: 0.9; }

/* ---- Top Header ---- */
.top-header {
  position: fixed;
  top: 0; right: 0;
  width: calc(100% - 256px);
  height: 64px;
  background: var(--surface-white);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-search {
  position: relative;
  width: 320px;
}
.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}
.header-search input {
  width: 100%;
  background: var(--surface-container-low);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 8px 16px 8px 40px;
  font-size: 14px;
  color: var(--on-surface);
  outline: none;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.header-search input:focus {
  border-color: var(--secondary);
  background: white;
  box-shadow: 0 0 0 3px rgba(217,83,30,0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--border-subtle);
  cursor: pointer;
}

.header-user .user-info { text-align: right; }
.header-user .user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.header-user .user-role {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  background: var(--primary-container);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-fixed-dim);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.notification-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: var(--on-surface-variant);
  transition: background 0.15s;
  display: flex;
  align-items: center;
}
.notification-btn:hover { background: var(--surface-container-low); }
.notification-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--status-error);
  border-radius: 50%;
  border: 2px solid white;
}

/* ---- Main Content ---- */
.main-content {
  margin-left: 256px;
  padding-top: 64px;
  min-height: 100vh;
  background: var(--background);
}

.content-area {
  padding: 32px;
  max-width: 1440px;
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}
.page-title h2 {
  font-size: 32px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.page-title p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}
.page-actions { display: flex; gap: 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 4px 16px rgba(217,83,30,0.35); }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { background: var(--surface-container-low); }

.btn-gold {
  background: var(--brand-gradient-h);
  color: white;
  border: none;
}
.btn-gold:hover { opacity: 0.9; box-shadow: 0 4px 16px rgba(253,184,19,0.3); }

.btn-success {
  background: var(--status-success);
  color: white;
}
.btn-success:hover { opacity: 0.9; }

.btn-danger {
  background: transparent;
  color: var(--status-error);
  border: 1px solid #fca5a5;
}
.btn-danger:hover { background: var(--error-container); }

.btn-warning {
  background: transparent;
  color: var(--status-pending);
  border: 1px solid #fcd34d;
}
.btn-warning:hover { background: #fef3c7; }

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--surface-container-low); color: var(--primary); }

/* ---- Cards ---- */
.card {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}
.card-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.card-body { padding: 24px; }

.glass-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226,232,240,0.7);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ---- KPI Cards ---- */
.kpi-card {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-change.up { color: var(--status-success); }
.kpi-change.down { color: var(--status-error); }
.kpi-change.neutral { color: var(--text-muted); }

.kpi-progress {
  margin-top: 16px;
  height: 3px;
  background: var(--surface-container);
  border-radius: 999px;
  overflow: hidden;
}
.kpi-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 1s ease;
}

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead tr {
  background: var(--surface-container-low);
}

.data-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
  cursor: pointer;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-container-low); }

.data-table tbody td {
  padding: 14px 20px;
  color: var(--on-surface);
  vertical-align: middle;
}

.data-table tbody td.font-bold { font-weight: 600; }

/* ---- Status Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success { background: rgba(16,185,129,0.1); color: #047857; border-color: rgba(16,185,129,0.2); }
.badge-success .badge-dot { background: #10b981; }

.badge-pending { background: rgba(245,158,11,0.1); color: #92400e; border-color: rgba(245,158,11,0.2); }
.badge-pending .badge-dot { background: #f59e0b; }

.badge-error { background: rgba(239,68,68,0.1); color: #991b1b; border-color: rgba(239,68,68,0.2); }
.badge-error .badge-dot { background: #ef4444; }

.badge-info { background: rgba(167,209,239,0.2); color: #1e40af; border-color: rgba(167,209,239,0.4); }
.badge-info .badge-dot { background: var(--accent-sky); }

.badge-neutral { background: var(--surface-container); color: var(--on-surface-variant); border-color: var(--border-subtle); }
.badge-neutral .badge-dot { background: var(--outline); }

.badge-dark { background: var(--primary); color: white; }

.badge-gold { background: rgba(253,184,19,0.12); color: #8C1D18; border-color: rgba(217,83,30,0.25); }
.badge-gold .badge-dot { background: var(--gold-bright); }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 14px;
  color: var(--on-surface);
  background: white;
  outline: none;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3,6,18,0.06);
}
.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748B' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  appearance: none;
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.form-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; }

.upload-area {
  border: 2px dashed var(--border-subtle);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface-container-low);
}
.upload-area:hover {
  border-color: var(--primary);
  background: rgba(3,6,18,0.02);
}
.upload-area .material-symbols-outlined { font-size: 40px; color: var(--text-muted); margin-bottom: 8px; display: block; }
.upload-area p { font-size: 14px; color: var(--text-muted); }
.upload-area small { font-size: 11px; color: var(--outline); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3,6,18,0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--surface-container-low);
  position: sticky;
  top: 0;
  z-index: 1;
}
.modal-header h3 { font-size: 18px; font-weight: 600; color: var(--primary); }
.modal-header p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.modal-body { padding: 28px; }

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--surface-container-low);
  position: sticky;
  bottom: 0;
}

/* ---- Receipt Styles ---- */
.receipt-wrapper {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  max-width: 700px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
}

.receipt-header {
  background: var(--primary);
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.receipt-logo img { height: 44px; }

.receipt-meta { text-align: right; color: white; }
.receipt-meta .receipt-no { font-size: 12px; letter-spacing: 0.08em; opacity: 0.6; text-transform: uppercase; }
.receipt-meta .receipt-id { font-size: 20px; font-weight: 700; }
.receipt-meta .receipt-date { font-size: 12px; opacity: 0.7; margin-top: 4px; }

.receipt-thank-you {
  background: linear-gradient(135deg, var(--champagne-gold), #e8b84b);
  padding: 20px 32px;
  text-align: center;
  color: white;
}
.receipt-thank-you h2 { font-size: 22px; font-weight: 700; }
.receipt-thank-you p { font-size: 12px; opacity: 0.85; margin-top: 4px; }

.receipt-body { padding: 32px; }

.receipt-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.receipt-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.receipt-info-item label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.receipt-info-item p {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.receipt-amount-box {
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin: 24px 0;
}
.receipt-amount-box .label { font-size: 11px; opacity: 0.7; letter-spacing: 0.06em; text-transform: uppercase; }
.receipt-amount-box .amount { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0; }
.receipt-amount-box .mode { font-size: 12px; opacity: 0.6; }

.receipt-payment-grid {
  background: var(--surface-container-low);
  border-radius: 10px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.receipt-footer {
  padding: 24px 32px;
  background: var(--surface-container-low);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.receipt-qr canvas { border: 3px solid white; border-radius: 8px; }

.receipt-disclaimer {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 32px;
  border-top: 1px dashed var(--border-subtle);
}

/* ---- Auth Pages ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1F2A44 0%, #141c30 40%, #2a1810 70%, #1F2A44 100%);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253,184,19,0.07) 0%, transparent 70%);
  top: -250px; right: -250px;
}
.auth-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,83,30,0.06) 0%, transparent 70%);
  bottom: -200px; left: -150px;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 48px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.auth-logo img { height: 44px; }

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.role-btn {
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: white;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.role-btn .material-symbols-outlined { font-size: 20px; }
.role-btn:hover {
  border-color: var(--primary);
  background: rgba(31,42,68,0.05);
  color: var(--primary);
}
.role-btn.active {
  background: var(--brand-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(217,83,30,0.3);
}

/* ---- Tabs ---- */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 24px;
}

.tab-item {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--secondary); border-bottom-color: var(--secondary); }

/* ---- Charts ---- */
.chart-container {
  position: relative;
  width: 100%;
}

/* ---- EMI Timeline ---- */
.emi-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-subtle); }
.emi-row:last-child { border-bottom: none; }
.emi-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-container);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0;
}
.emi-number.paid { background: rgba(16,185,129,0.1); color: #047857; }
.emi-number.due { background: rgba(245,158,11,0.1); color: #92400e; }
.emi-number.overdue { background: rgba(239,68,68,0.1); color: #991b1b; }

/* ---- Inventory Grid ---- */
.plot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.plot-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
  padding: 4px;
}
.plot-cell:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.plot-cell.available { background: rgba(16,185,129,0.1); color: #047857; border-color: rgba(16,185,129,0.3); }
.plot-cell.booked { background: rgba(3,6,18,0.08); color: var(--primary); border-color: rgba(3,6,18,0.2); }
.plot-cell.reserved { background: rgba(245,158,11,0.1); color: #92400e; border-color: rgba(245,158,11,0.3); }
.plot-cell.sold { background: rgba(239,68,68,0.08); color: #991b1b; border-color: rgba(239,68,68,0.2); }
.plot-cell.provisional { background: rgba(167,209,239,0.2); color: #1e40af; border-color: rgba(167,209,239,0.4); }

/* ---- Dark sidebar dark card ---- */
.dark-card {
  background: var(--primary);
  color: white;
  border-radius: 16px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.dark-card::after {
  content: '';
  position: absolute;
  bottom: -24px; right: -24px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

/* ---- Notification items ---- */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.15s;
  cursor: pointer;
}
.notif-item:hover { background: var(--surface-container-low); }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ---- Progress bars ---- */
.progress-bar-wrap {
  height: 6px;
  background: var(--surface-container);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s ease;
}

/* ---- Breadcrumbs ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumb .sep { color: var(--outline); }
.breadcrumb .current { color: var(--primary); font-weight: 600; }

/* ---- Search bar in table ---- */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
  flex-wrap: wrap;
}

.table-search {
  position: relative;
  min-width: 240px;
}
.table-search .material-symbols-outlined {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
}
.table-search input {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13px;
  width: 100%;
  outline: none;
  font-family: 'Inter', sans-serif;
  color: var(--on-surface);
}
.table-search input:focus { border-color: var(--primary); }

.table-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: white;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.filter-chip:hover, .filter-chip.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(3,6,18,0.04);
}

/* ---- Divider ---- */
.divider { height: 1px; background: var(--border-subtle); margin: 24px 0; }
.divider-v { width: 1px; background: var(--border-subtle); align-self: stretch; }

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 24px; }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ---- Empty States ---- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state .material-symbols-outlined {
  font-size: 56px;
  color: var(--surface-container-high);
  display: block;
  margin-bottom: 16px;
}
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--on-surface); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ---- Tooltip ---- */
.tooltip-wrap { position: relative; }
.tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}
.tooltip-wrap:hover .tooltip-content { opacity: 1; }

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-left: 4px solid var(--status-success);
  min-width: 300px;
  animation: slideInRight 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.toast.error { border-left-color: var(--status-error); }
.toast.warning { border-left-color: var(--status-pending); }
.toast.info { border-left-color: var(--accent-sky); }

.toast p { font-size: 13px; font-weight: 500; color: var(--on-surface); }
.toast small { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Print styles ---- */
@media print {
  .sidebar, .top-header, .no-print, .mobile-fab, .sidebar-overlay { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .receipt-wrapper { box-shadow: none; max-width: 100%; }
}

/* ========================================
   RESPONSIVE SYSTEM — FULL COVERAGE
   Breakpoints:
     Desktop  : 1280px+
     Laptop   : 1024px – 1279px
     Tablet   : 768px  – 1023px
     Mobile L : 480px  – 767px
     Mobile S : 0px    – 479px
   ======================================== */

/* ---- Hamburger / Mobile Header Btn ---- */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--on-surface-variant);
  transition: background 0.15s;
  align-items: center;
  justify-content: center;
}
.hamburger-btn:hover { background: var(--surface-container-low); }

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3,6,18,0.5);
  backdrop-filter: blur(2px);
  z-index: 49;
  transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; }

/* ---- Mobile FAB (Quick Action) ---- */
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--champagne-gold);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(197,160,89,0.4);
  z-index: 45;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.mobile-fab:hover { transform: scale(1.08); }

/* ============================================================
   LAPTOP (1024px – 1279px) — Narrow sidebar, tighter spacing
   ============================================================ */
@media (min-width: 1024px) and (max-width: 1279px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; }
  .top-header { width: calc(100% - 220px); }
  .content-area { padding: 24px; }
  .kpi-value { font-size: 22px; }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .header-search { width: 240px; }
}

/* ============================================================
   TABLET (768px – 1023px) — Collapsed sidebar, drawer mode
   ============================================================ */
@media (max-width: 1023px) {
  /* Sidebar becomes a slide-in drawer */
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    z-index: 50;
    box-shadow: 4px 0 32px rgba(0,0,0,0.25);
  }
  .sidebar.open { transform: translateX(0); }

  /* Main content fills full width */
  .main-content { margin-left: 0; width: 100%; }
  .top-header { width: 100%; left: 0; padding: 0 20px; }

  /* Show hamburger */
  .hamburger-btn { display: flex; }

  /* Grid adjustments */
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-3 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-12 { gap: 16px; }
  .col-4, .col-5 { grid-column: span 6; }
  .col-6, .col-7, .col-8 { grid-column: span 12; }

  /* Content spacing */
  .content-area { padding: 20px; }
  .page-header { margin-bottom: 20px; }
  .kpi-value { font-size: 22px; }
  .kpi-card { padding: 18px; }

  /* Span adjustments in grid-12 for tablet */
  .grid-12 > [style*="grid-column:span 4"] { grid-column: span 6 !important; }
  .grid-12 > [style*="grid-column: span 4"] { grid-column: span 6 !important; }
  .grid-12 > [style*="grid-column:span 8"] { grid-column: span 12 !important; }
  .grid-12 > [style*="grid-column: span 8"] { grid-column: span 12 !important; }

  /* Modals full-screen on tablet */
  .modal-xl, .modal-lg { max-width: 95vw; }
  .modal-overlay { padding: 16px; }

  /* Table scroll */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table thead th, .data-table tbody td { padding: 12px 14px; }

  /* Header search narrower */
  .header-search { width: 200px; }
  .header-user .user-info { display: none; }

  /* Show overlay when sidebar open */
  .sidebar-overlay.active { display: block; }
}

/* ============================================================
   MOBILE (max-width: 767px) — Full mobile layout
   ============================================================ */
@media (max-width: 767px) {
  /* ---- Layout ---- */
  .content-area { padding: 14px; }
  .main-content { padding-top: 60px; }
  .top-header { height: 60px; padding: 0 14px; }

  /* ---- Typography Scale ---- */
  .page-title { font-size: 20px !important; }
  h1.page-title, .page-title h1 { font-size: 20px !important; }
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 10px; }
  .kpi-card { padding: 16px; border-radius: 12px; }

  /* ---- Page header stacks ---- */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-actions { flex-wrap: wrap; gap: 8px; }
  .page-actions .btn { flex: 1 1 auto; min-width: 0; justify-content: center; }

  /* ---- All grids collapse to 1 col ---- */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 12px; }
  .grid-12 { grid-template-columns: 1fr; gap: 12px; }
  .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 { grid-column: span 12; }

  /* ---- Form grids collapse ---- */
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; gap: 14px; }

  /* ---- Auth ---- */
  .auth-card { padding: 24px 20px; border-radius: 16px; margin: 0 12px; }
  .auth-title { font-size: 20px; }
  .role-selector { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .role-btn { padding: 8px 4px; font-size: 9px; }
  .role-btn .material-symbols-outlined { font-size: 18px; }

  /* ---- Tables ---- */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
  .data-table { min-width: 600px; }
  .data-table thead th, .data-table tbody td { padding: 10px 12px; font-size: 12px; }
  .table-toolbar { padding: 12px 14px; flex-direction: column; align-items: stretch; gap: 8px; }
  .table-search { min-width: 0; width: 100%; }
  .table-filters { flex-wrap: wrap; }

  /* ---- Cards ---- */
  .card-header { padding: 14px 16px; }
  .card-header h3 { font-size: 14px; }
  .card-body { padding: 16px; }
  .glass-card { border-radius: 12px; }

  /* ---- Header ---- */
  .header-search { display: none; }
  .header-user .user-info { display: none; }
  .header-right { gap: 8px; }

  /* ---- Modals full-screen on mobile ---- */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal, .modal-lg, .modal-xl {
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
  }
  .modal-header { padding: 18px 20px; }
  .modal-header h3 { font-size: 16px; }
  .modal-body { padding: 20px; }
  .modal-footer { padding: 14px 20px; flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { flex: 1 1 auto; justify-content: center; }

  /* ---- Receipt ---- */
  .receipt-header { padding: 20px; flex-direction: column; gap: 12px; text-align: center; }
  .receipt-meta { text-align: center; }
  .receipt-body { padding: 18px; }
  .receipt-info-grid { grid-template-columns: 1fr; gap: 10px; }
  .receipt-payment-grid { grid-template-columns: 1fr; gap: 10px; }
  .receipt-footer { padding: 16px; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
  .receipt-amount-box .amount { font-size: 28px; }
  .receipt-thank-you { padding: 14px 18px; }
  .receipt-thank-you h2 { font-size: 18px; }

  /* ---- Sidebar drawer width ---- */
  .sidebar { width: 100%; max-width: 300px; }

  /* ---- Tabs ---- */
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0; gap: 0; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-item { padding: 10px 14px; font-size: 12px; flex-shrink: 0; }

  /* ---- KPI grid 2-col on mobile ---- */
  .kpi-grid-4 { grid-template-columns: 1fr 1fr !important; }

  /* ---- Payment / Reports split panel: stack all grid-12 spans ---- */
  .payment-split { flex-direction: column !important; }
  .grid-12 > [style*="grid-column:span 4"],
  .grid-12 > [style*="grid-column:span 5"],
  .grid-12 > [style*="grid-column:span 8"],
  .grid-12 > [style*="grid-column:span 7"],
  .grid-12 > [style*="grid-column: span 4"],
  .grid-12 > [style*="grid-column: span 8"] {
    grid-column: span 12 !important;
  }

  /* ---- Plots grid ---- */
  .plot-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
  .plot-cell { font-size: 9px; border-radius: 6px; }

  /* ---- Toasts full width ---- */
  .toast-container { left: 12px; right: 12px; bottom: 16px; }
  .toast { min-width: 0; width: 100%; }

  /* ---- Mobile FAB ---- */
  .mobile-fab { display: flex; }

  /* ---- Breadcrumb wrap ---- */
  .breadcrumb { flex-wrap: wrap; }

  /* ---- Inline grid overrides for property detail bar ---- */
  [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ---- Dark card full width ---- */
  .dark-card { padding: 20px; border-radius: 12px; }

  /* ---- Buttons ---- */
  .btn { padding: 9px 14px; }
  .btn-sm { padding: 6px 10px; }
}

/* ============================================================
   MOBILE SMALL (max-width: 479px)
   ============================================================ */
@media (max-width: 479px) {
  .content-area { padding: 10px; }
  .top-header { padding: 0 10px; }
  .auth-card { padding: 20px 16px; margin: 0 8px; }
  .role-selector { grid-template-columns: 1fr 1fr; }
  .role-btn { font-size: 9px; }
  .kpi-value { font-size: 18px; }
  .page-header .btn span:not(.material-symbols-outlined) { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .receipt-amount-box .amount { font-size: 24px; }
  .modal-footer .btn span:not(.material-symbols-outlined) { display: none; }
}

/* ---- Animations ---- */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- Loading States ---- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-container-high) 50%, var(--surface-container) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Utility ---- */
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--status-success); }
.text-error { color: var(--status-error); }
.text-warning { color: var(--status-pending); }
.text-gold { color: var(--champagne-gold); }

.bg-primary { background: var(--primary); }
.bg-success { background: var(--status-success); }
.bg-error { background: var(--status-error); }
.bg-warning { background: var(--status-pending); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.04em; }
.tracking-wider { letter-spacing: 0.08em; }
.tabular-nums { font-variant-numeric: tabular-nums; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }

.rounded { border-radius: 4px; }
.rounded-md { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }
.rounded-full { border-radius: 999px; }

.border { border: 1px solid var(--border-subtle); }
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.shadow-md { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* ---- Inline icon alignment ---- */
.icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Hover row action buttons */
.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.data-table tbody tr:hover .row-actions { opacity: 1; }

/* ============================================================
   HR MODULE & INTEGRATIONS — ADDITIONAL STYLES
   ============================================================ */

/* Pulse animation for live indicators */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Live dot indicator */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #10B981;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}
.live-dot.red { background: #EF4444; animation-name: pulseRed; }
.live-dot.yellow { background: #F59E0B; }

/* ---- HR & Attendance Styles ---- */
.attendance-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
}
.att-P { background: #D1FAE5; color: #065F46; }
.att-A { background: #FEE2E2; color: #991B1B; }
.att-L { background: #FEF3C7; color: #92400E; }
.att-WO { background: #E2E8F0; color: #475569; }
.att-H { background: #DBEAFE; color: #1E3A8A; }
.att-HD { background: #EDE9FE; color: #5B21B6; }
.att-empty { background: #F8FAFC; color: #CBD5E1; }

/* Attendance summary row */
.att-summary {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px;
  background: #F8FAFC;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 12px;
}
.att-summary-item {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

/* ---- Salary Slip Document ---- */
.salary-slip-doc {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 32px;
  max-width: 720px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
}
.slip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.slip-company-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}
.slip-company-sub {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
}
.slip-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.slip-emp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  margin-bottom: 20px;
  padding: 16px;
  background: #F8FAFC;
  border-radius: 8px;
}
.slip-emp-row { display: flex; gap: 8px; font-size: 12px; }
.slip-emp-label { color: #64748B; min-width: 110px; }
.slip-emp-value { font-weight: 600; color: #0F172A; }
.slip-earnings-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}
.slip-earnings-table th {
  background: var(--primary);
  color: var(--gold-bright);
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.slip-earnings-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #F1F5F9;
}
.slip-earnings-table tr:last-child td {
  border-bottom: none;
  font-weight: 700;
  background: #F8FAFC;
}
.slip-net-pay {
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}
.slip-net-label { font-size: 12px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.1em; }
.slip-net-amount { font-size: 24px; font-weight: 800; color: var(--gold-bright); }
.slip-net-words { font-size: 11px; opacity: 0.6; margin-top: 2px; }
.slip-signature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed #E2E8F0;
}
.slip-sig-box {
  text-align: center;
  font-size: 11px;
  color: #64748B;
}
.slip-sig-line {
  border-bottom: 1px solid #CBD5E1;
  margin-bottom: 6px;
  height: 40px;
}

/* Print styles for salary slip */
@media print {
  .sidebar, .top-header, .mobile-fab, .page-actions,
  .btn, button, .modal-overlay, .toast-container,
  .hamburger-btn { display: none !important; }
  .salary-slip-doc {
    border: none;
    padding: 0;
    max-width: 100%;
    box-shadow: none;
  }
  body { background: #fff; }
  .slip-earnings-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slip-net-pay { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Offer Letter ---- */
.offer-letter-doc {
  background: #fff;
  padding: 40px;
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.7;
  color: #1E293B;
}
.offer-letter-header {
  text-align: center;
  border-bottom: 3px solid var(--gold-bright);
  padding-bottom: 20px;
  margin-bottom: 28px;
}
.offer-company-name {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.05em;
}
.offer-company-tagline { font-size: 11px; color: #64748B; margin-top: 2px; }
.offer-letter-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  margin: 20px 0 16px;
  text-align: center;
}
.offer-section { margin-bottom: 16px; }
.offer-section h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #475569; margin-bottom: 6px; letter-spacing: 0.05em; }
.offer-compensation-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}
.offer-compensation-table th {
  background: #F8FAFC;
  padding: 6px 12px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border: 1px solid #E2E8F0;
}
.offer-compensation-table td {
  padding: 6px 12px;
  border: 1px solid #E2E8F0;
}
.offer-signature-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #E2E8F0;
}
.offer-sig-label { font-size: 11px; color: #64748B; text-align: center; margin-top: 8px; }
.offer-sig-line { border-bottom: 1px solid #94A3B8; margin-bottom: 4px; height: 48px; }

/* ---- KRA Progress Bars ---- */
.kra-bar-wrap { background: #F1F5F9; border-radius: 20px; height: 8px; overflow: hidden; margin-top: 4px; }
.kra-bar-fill { height: 100%; border-radius: 20px; transition: width 0.6s ease; }
.kra-green .kra-bar-fill { background: linear-gradient(90deg, #10B981, #34D399); }
.kra-yellow .kra-bar-fill { background: linear-gradient(90deg, #F59E0B, #FCD34D); }
.kra-red .kra-bar-fill { background: linear-gradient(90deg, #EF4444, #F87171); }

/* ---- Meta Leads Flow Diagram ---- */
.meta-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 24px;
  background: linear-gradient(135deg, #F8FAFC, #EFF6FF);
  border-radius: 12px;
  border: 1px solid #DBEAFE;
}
.meta-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  min-width: 100px;
  text-align: center;
}
.meta-flow-step .step-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.meta-flow-arrow {
  font-size: 20px;
  color: #94A3B8;
  padding: 0 4px;
}
.meta-flow-step .step-label { font-size: 11px; font-weight: 600; color: #475569; }
.meta-flow-step .step-sub { font-size: 10px; color: #94A3B8; }

/* ---- XLS Upload Zone ---- */
.xls-drop-zone {
  border: 2px dashed #CBD5E1;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #F8FAFC;
}
.xls-drop-zone:hover, .xls-drop-zone.drag-over {
  border-color: var(--gold-bright);
  background: #FFFBF0;
}
.xls-drop-zone .drop-icon {
  font-size: 48px;
  color: #CBD5E1;
  margin-bottom: 12px;
}
.xls-drop-zone:hover .drop-icon { color: var(--gold-bright); }

/* ---- Column Mapping Table ---- */
.mapping-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mapping-table th { background: #F8FAFC; padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 2px solid #E2E8F0; }
.mapping-table td { padding: 8px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.mapping-table select { font-size: 12px; padding: 4px 8px; border: 1px solid #E2E8F0; border-radius: 6px; }

/* ---- WhatsApp Template Card ---- */
.wa-template-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow 0.2s;
}
.wa-template-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.wa-template-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
}
.wa-status-approved { background: #D1FAE5; color: #065F46; }
.wa-status-pending { background: #FEF3C7; color: #92400E; }
.wa-status-rejected { background: #FEE2E2; color: #991B1B; }

/* ---- Notification Rules ---- */
.notif-rule-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  gap: 12px;
  border: 1px solid #F1F5F9;
  transition: background 0.15s;
}
.notif-rule-row:hover { background: #F8FAFC; }
.notif-rule-row .rule-event {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  color: #1E293B;
}
.notif-rule-row .rule-channels {
  display: flex; gap: 4px;
}
.channel-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ch-inapp { background: #DBEAFE; color: #1E3A8A; }
.ch-whatsapp { background: #D1FAE5; color: #065F46; }
.ch-email { background: #EDE9FE; color: #5B21B6; }
.ch-sms { background: #FEF3C7; color: #92400E; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px; height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #CBD5E1;
  border-radius: 22px;
  transition: 0.3s;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: #10B981; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ---- Employee Card ---- */
.emp-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
  cursor: pointer;
}
.emp-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--gold-bright);
  transform: translateY(-2px);
}
.emp-avatar {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  color: var(--gold-bright);
  flex-shrink: 0;
}
.emp-name { font-size: 14px; font-weight: 700; color: #1E293B; }
.emp-designation { font-size: 12px; color: #64748B; margin-top: 2px; }
.emp-dept-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  margin-top: 4px; display: inline-block;
}

/* ---- Incentive Progress ---- */
.incentive-progress-wrap { margin-top: 8px; }
.incentive-pct { font-size: 11px; color: #64748B; margin-bottom: 4px; display: flex; justify-content: space-between; }

/* ---- Meta lead card ---- */
.meta-lead-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.2s;
  animation: fadeInUp 0.3s ease;
}
.meta-lead-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.meta-lead-source-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  white-space: nowrap;
}
.meta-fb { background: #DBEAFE; color: #1E3A8A; }
.meta-ig { background: #FCE7F3; color: #831843; }
.meta-wa { background: #D1FAE5; color: #065F46; }

/* ---- Sidebar HR section separator ---- */
.sidebar-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 16px 4px;
  margin-top: 4px;
}

/* ---- Stats grid for HR dashboard ---- */
.hr-stat-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hr-stat-value { font-size: 28px; font-weight: 800; color: var(--primary); }
.hr-stat-label { font-size: 12px; color: #64748B; font-weight: 500; }
.hr-stat-change { font-size: 11px; font-weight: 600; }
.hr-stat-up { color: #10B981; }
.hr-stat-down { color: #EF4444; }

/* ---- Responsive adjustments for HR pages ---- */
@media (max-width: 768px) {
  .salary-slip-doc { padding: 20px 16px; }
  .slip-emp-grid { grid-template-columns: 1fr; }
  .offer-letter-doc { padding: 20px 16px; }
  .offer-signature-section { grid-template-columns: 1fr; gap: 20px; }
  .slip-signature-row { grid-template-columns: 1fr; gap: 16px; }
  .meta-flow { gap: 4px; }
  .meta-flow-step { padding: 10px 12px; min-width: 70px; }
  .meta-flow-step .step-icon { width: 32px; height: 32px; font-size: 16px; }
}
@media (max-width: 480px) {
  .meta-flow-arrow { display: none; }
  .meta-flow { flex-direction: column; gap: 8px; }
}

/* ============================================================
   SECURITY & CAPTCHA STYLES
   ============================================================ */

/* Shake animation for wrong CAPTCHA */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
}
.shake { animation: shake 0.5s ease-in-out; border-color: #EF4444 !important; }

/* CAPTCHA canvas container */
#captcha-canvas {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: block;
  user-select: none;
  -webkit-user-select: none;
}

/* Password strength */
#pwd-strength-wrap { padding: 4px 0; }

/* Login form left-border accent inputs */
.form-control[style*="border-left"] {
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control[style*="border-left"]:focus {
  box-shadow: 0 0 0 3px rgba(217,83,30,0.12);
}

/* Security badge on login */
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* Session warning banner (above content) */
#session-warning-banner {
  animation: fadeInUp 0.3s ease;
}

/* Lockout countdown */
#lockout-timer {
  color: #FCA5A5;
  font-size: 16px;
}

/* CAPTCHA refresh button hover */
button[title="Refresh CAPTCHA"]:hover {
  background: var(--surface-container) !important;
  color: var(--secondary) !important;
  border-color: var(--secondary) !important;
}

/* Auth card brand accent line at top */
.auth-card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #8C1D18, #D9531E 40%, #FDB813);
  border-radius: 20px 20px 0 0;
  margin: -48px -48px 40px;
}
@media (max-width: 768px) {
  .auth-card::before { margin: -24px -20px 28px; }
}
@media (max-width: 480px) {
  .auth-card::before { margin: -20px -16px 24px; }
}

/* OTP input focus */
input[id^="otp-"]:focus {
  border-color: var(--secondary) !important;
  box-shadow: 0 0 0 3px rgba(217,83,30,0.15);
  outline: none;
}

/* Gradient text for auth-title */
.auth-title {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
