/* ============================================================
   PRIME HOLDINGS — Rental Management System
   Brand: Blue #2b7bc8 | Orange #f5a623 | White #ffffff
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────────── */
/* 60-30-10 Rule:
   - 60% Background: --bg (#f0f4f9) and --white (#ffffff)
   - 30% Content:    --blue (#2b7bc8) for secondary actions, links, active states
   - 10% Accent:     --orange (#f5a623) for primary CTAs, important highlights
*/
:root {
    --blue:        #2b7bc8;
    --blue-dark:   #1e5fa0;
    --blue-light:  #e8f1fb;
    --orange:      #f5a623;
    --orange-dark: #d4890a;
    --orange-light:#fff8ec;
    --white:       #ffffff;
    --bg:          #f0f4f9;
    --sidebar-bg:  #0f2d52;
    --sidebar-w:   230px;
    --header-h:    56px;
    --text:        #1a2b3c;
    --text-muted:  #6b7a8d;
    --border:      #d8e3ee;
    --radius:      8px;
    --shadow:      0 2px 12px rgba(43,123,200,.12);
    --shadow-sm:   0 1px 4px rgba(0,0,0,.08);
    --skeleton-bg: #e2e8f0;
    --skeleton-highlight: #f1f5f9;
    --icon-size-sm: 16px;
    --icon-size-md: 20px;
    --icon-size-lg: 24px;
}

/* ── Icon Styling (Block-style) ───────────────────────────────── */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-size-md);
    height: var(--icon-size-md);
    font-size: var(--icon-size-md);
    line-height: 1;
}

.icon-sm {
    width: var(--icon-size-sm);
    height: var(--icon-size-sm);
    font-size: var(--icon-size-sm);
}

.icon-lg {
    width: var(--icon-size-lg);
    height: var(--icon-size-lg);
    font-size: var(--icon-size-lg);
}

/* Sidebar icon styling */
.sidebar-menu li i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 18px;
    line-height: 1;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Button icon styling */
.btn-primary i,
.btn-success i,
.btn-danger i,
.btn-edit i,
.btn-delete i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    width: 16px;
    height: 16px;
    font-size: 14px;
    line-height: 1;
}

/* ── Step Modal Components ────────────────────────────────────────────────────── */
.step-modal-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
}

.step-modal-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
    z-index: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.step-indicator.active .step-number {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
}

.step-indicator.completed .step-number {
    border-color: #27ae60;
    background: #d4edda;
    color: #27ae60;
}

.step-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}

.step-content {
    min-height: 200px;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

/* Next / Complete button inside step modals */
.btn-primary {
    display:inline-flex; align-items:center; gap:6px;
    padding:10px 22px; border:none; border-radius:8px;
    font-size:13px; font-weight:700; cursor:pointer;
    background:var(--orange); color:#fff;
    transition:background .15s, transform .1s, box-shadow .15s;
    box-shadow:0 2px 8px rgba(232,97,10,.25);
}
.btn-primary:hover:not(:disabled) {
    background:var(--orange-dark); transform:translateY(-1px);
    box-shadow:0 4px 14px rgba(232,97,10,.35);
}
.btn-primary:active:not(:disabled) { transform:translateY(0); }
.btn-primary:disabled { opacity:.5; cursor:not-allowed; box-shadow:none; }

.step-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
}

.step-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 0 14px;
    line-height: 1.45;
}

.step-hint i {
    color: var(--blue);
    margin-right: 6px;
}

/* Modern success modal (matches the provided image) */
.modern-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.modern-modal {
    background: #ffffff;
    border-radius: 24px;
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.success-badge {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #a8e6cf, #88d8b0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(168, 230, 207, 0.4);
}
.success-badge i {
    font-size: 56px;
    color: #1b5e20;
}
.modern-modal h3 {
    margin: 0 0 0.5rem;
    color: #1a2b3c;
    font-size: 1.5rem;
    font-weight: 700;
}
.modern-modal p {
    margin: 0 0 2rem;
    color: #6b7a8d;
    font-size: 0.95rem;
    line-height: 1.5;
}
.modern-modal-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: #1a2b3c;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.modern-modal-btn:hover {
    background: #0f1d2a;
    transform: translateY(-1px);
}
.modern-modal-btn:active {
    transform: translateY(0);
}

/* Optimized button styles for tenant input popups */
.tenant-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tenant-modal-btn-primary {
    background: #27ae60;
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}
.tenant-modal-btn-primary:hover {
    background: #219150;
    transform: translateY(-1px);
}
.tenant-modal-btn-secondary {
    background: #ecf0f1;
    color: #34495e;
}
.tenant-modal-btn-secondary:hover {
    background: #dfe6e9;
}
.tenant-modal-btn-danger {
    background: #e74c3c;
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.25);
}
.tenant-modal-btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* ── Responsive Styles ───────────────────────────────────────── */
@media (max-width: 1024px) {
    :root {
        --sidebar-w: 200px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-w: 60px;
    }
}

/* Make dashboard cards responsive */
@media (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* modal responsive — handled in Modal redesign section */

/* Make table responsive */
@media (max-width: 640px) {
    .table-wrapper {
        overflow-x: auto;
    }
    .table-wrapper table {
        min-width: 600px;
    }
}

/* Make buttons responsive */
@media (max-width: 480px) {
    .btn-save, .btn-cancel, .btn-edit, .btn-delete, .btn-add {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Make form fields responsive */
@media (max-width: 480px) {
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ── Global Progress Bar ───────────────────────────────────────── */
#global-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--blue), #27ae60);
  z-index: 99999;
  box-shadow: 0 0 10px rgba(43, 123, 200, 0.7);
  transition: width 0.1s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

#global-progress.active {
  opacity: 1;
}

/* ── Skeleton Loaders (Enhanced) ───────────────────────────────── */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  50% {
    background-position: calc(100% + 200px) 0;
  }
  100% {
    background-position: -200px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-bg) 0px,
    var(--skeleton-highlight) 60px,
    var(--skeleton-bg) 120px
  );
  background-size: 300px 100%;
  animation: skeleton-loading 1.8s ease-in-out infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 45%;
}

.skeleton-text.medium {
  width: 70%;
}

.skeleton-card {
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-rect {
  width: 100%;
  height: 120px;
  border-radius: var(--radius);
}

.skeleton-dashboard-card {
  padding: 18px 16px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Optimistic UI indicators */
.optimistic-item {
  opacity: 0.7;
  border: 2px dashed var(--blue);
  border-radius: var(--radius);
  position: relative;
}

.optimistic-item::after {
  content: 'Saving...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Password Strength Indicator ─────────────────────────────────── */
.password-strength-container {
  margin-top: 8px;
  margin-bottom: 12px;
}

.password-strength-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.3s ease, background 0.3s ease;
}

.password-strength-text {
  font-size: 12px;
  color: var(--text-muted);
}

.password-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.password-requirement {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.password-requirement.valid {
  color: #27ae60;
}

.password-requirement .req-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  background: var(--border);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.password-requirement.valid .req-icon {
  background: #27ae60;
  color: white;
}


/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html{scroll-behavior:smooth;}
body { font-family:'Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,Arial,sans-serif; background:var(--bg); color:var(--text); font-size:14px; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
a { color:var(--blue); text-decoration:none; }

/* ── Splash Screen ───────────────────────────────────────────── */
#splash-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(145deg, #0f2d52 0%, #1a4a80 60%, #2b7bc8 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease-out;
}

.splash-container {
  text-align: center;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#splash-logo {
  width: 240px;
  height: 240px;
  margin-bottom: 32px;
  display: block;
  object-fit: contain;
  border-radius: 0;
}
  transform-origin: center center;
  will-change: transform, opacity;
}

/*
 * Heartbeat — mimics a real cardiac lub-dub:
 *   first beat  (big)  →  0 % – 18 %
 *   second beat (small) → 28 % – 42 %
 *   long diastole      → 42 % – 100 %
 */
@keyframes heartbeat {
  0%   { transform: scale(1);    }
  9%   { transform: scale(1.28); }   /* lub  */
  18%  { transform: scale(1);    }
  28%  { transform: scale(1.15); }   /* dub  */
  40%  { transform: scale(1);    }
  100% { transform: scale(1);    }   /* rest */
}

.heartbeat {
  animation: heartbeat 1.05s ease-in-out infinite;
}

/*
 * Doom-in exit — logo slams toward the viewer and disappears:
 *   short wind-up (tiny shrink) then explosive zoom + fade
 */
@keyframes doom-in {
  0%   { transform: scale(1);     opacity: 1; }
  15%  { transform: scale(0.88);  opacity: 1; }   /* wind-up */
  100% { transform: scale(6);     opacity: 0; }   /* crash   */
}

.doom-in {
  animation: doom-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* company name fades up slightly after logo appears */
.splash-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 4px;
  letter-spacing: 1px;
  opacity: 0;
  animation: splashFadeUp 0.55s ease 0.25s forwards;
}

.splash-subtitle {
  font-size: 0.95rem;
  color: #b0c8e8;
  margin-bottom: 32px;
  letter-spacing: 0.5px;
  opacity: 0;
  animation: splashFadeUp 0.55s ease 0.45s forwards;
}

@keyframes splashFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* spinner fades in last */
.loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--orange);
  border-radius: 50%;
  margin: 0 auto;
  opacity: 0;
  animation: splashSpin 0.85s linear infinite,
             splashFadeUp 0.4s ease 0.65s forwards;
}

@keyframes splashSpin {
  to { transform: rotate(360deg); }
}

/* ── Password toggle wrapper ─────────────────────────────────── */
.pw-wrap {
  position: relative;
  margin: 8px 0;
}

/* the input inside a pw-wrap must fill the width and leave room for the eye icon */
.pw-wrap input[type="password"],
.pw-wrap input[type="text"] {
  width: 100%;
  padding-right: 42px;   /* stop text going under the button */
  margin: 0;             /* pw-wrap owns the margin */
}

.pw-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  transition: color .15s;
  padding: 0;
}
.pw-toggle:hover { color: var(--blue); }
.pw-toggle:focus { outline: none; }
.auth-container {
  display:flex; justify-content:center; align-items:center;
  min-height:100vh;
  background: linear-gradient(145deg, var(--sidebar-bg) 0%, #1a4a80 60%, var(--blue) 100%);
}

.auth-card {
  background:var(--white); border-radius:16px;
  width:92%; max-width:520px;
  box-shadow:0 8px 40px rgba(0,0,0,.25);
  overflow:hidden;
}

/* logo banner at top of auth card */
.auth-logo-banner {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--blue) 100%);
  padding:28px 24px 20px;
  display:flex; 
  flex-direction:column; 
  align-items:center; 
  gap:10px;
}

.auth-logo-banner img { 
  width:96px; 
  height:96px; 
  object-fit:contain;
  border-radius: 0;
}

.header-logo img {
  width:60px; 
  height:60px; 
  object-fit:contain;
  border-radius: 0;
}

.auth-logo-banner .brand-name {
  font-size:1.25rem; font-weight:800; color:var(--orange); letter-spacing:.5px;
  text-transform:uppercase;
}

.auth-logo-banner .brand-tagline {
  font-size:.78rem; color:#b0c8e8; letter-spacing:1px;
}

.auth-form-body { padding:28px 28px 24px; }

.auth-form-body h2 {
  font-size:1.1rem; color:var(--text); margin-bottom:6px; font-weight:700;
}

.auth-form-body p.auth-sub {
  font-size:.82rem; color:var(--text-muted); margin-bottom:20px;
}

.auth-card input, .auth-card select {
  width:100%; padding:11px 13px; margin:8px 0;
  border:1.5px solid var(--border); border-radius:6px;
  font-size:14px; background:var(--white); color:var(--text);
  transition:border .2s;
}

.auth-card input:focus, .auth-card select:focus {
  outline:none; border-color:var(--blue); box-shadow:0 0 0 4px rgba(43,123,200,.15);
}

.auth-card button#authBtn,
.auth-card button#flSetBtn,
.auth-card button[type=submit] {
  width:100%; padding:13px; margin-top:14px;
  background:linear-gradient(135deg,var(--orange),var(--orange-dark)); color:var(--white);
  border:none; border-radius:10px; font-size:15px; font-weight:800;
  cursor:pointer; letter-spacing:.3px;
  transition:all .2s;
  box-shadow:0 4px 12px rgba(232,97,10,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.auth-card button#authBtn:hover,
.auth-card button#flSetBtn:hover,
.auth-card button[type=submit]:hover { 
  background:linear-gradient(135deg,var(--orange-dark),#a03f06); 
  transform:translateY(-1px); 
  box-shadow:0 6px 18px rgba(232,97,10,.35);
}
.auth-card button#authBtn:active,
.auth-card button#flSetBtn:active,
.auth-card button[type=submit]:active { transform:translateY(0); }
.auth-card button#authBtn:disabled,
.auth-card button#flSetBtn:disabled,
.auth-card button[type=submit]:disabled { 
  background:linear-gradient(135deg,#cbd5e1,#94a3b8)!important; 
  cursor:not-allowed; 
  transform:none;
  box-shadow:none!important;
}

/* Accessibility: Focus styles */
*:focus-visible {
  outline:2px solid var(--orange);
  outline-offset:2px;
}

.auth-card .error {
  background:#fff0ee; border:1px solid #f5c0b0; color:#c0392b;
  padding:9px 12px; border-radius:6px; font-size:13px; margin-top:10px;
}

/* ── App Header ──────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(90deg, var(--sidebar-bg) 0%, #1e5085 100%);
  color:var(--white); padding:0 20px;
  height:var(--header-h);
  display:flex; justify-content:space-between; align-items:center;
  position:fixed; top:0; left:0; right:0; z-index:200;
  box-shadow:0 2px 10px rgba(0,0,0,.2);
}

.header-logo {
  display:flex; align-items:center; gap:10px;
}

.header-logo svg { width:36px; height:36px; flex-shrink:0; }

.header-brand { display:flex; flex-direction:column; line-height:1.15; }
.header-brand .brand-name { font-size:.95rem; font-weight:800; color:var(--orange); letter-spacing:.4px; text-transform:uppercase; }
.header-brand .brand-tagline { font-size:.65rem; color:#8ab0d8; letter-spacing:.8px; }

.header-right { display:flex; align-items:center; gap:12px; }

.header-user { font-size:.8rem; color:#b0c8e8; }
.header-user strong { color:var(--white); }
.header-role-badge {
  font-size:.68rem; padding:2px 8px; border-radius:10px; font-weight:600; letter-spacing:.3px;
}
.header-role-badge.superadmin { background:var(--orange); color:#fff; }
.header-role-badge.team { background:var(--blue); color:#fff; }

.logout-btn {
  background:rgba(255,255,255,.12); color:var(--white);
  border:1px solid rgba(255,255,255,.25); padding:6px 14px;
  border-radius:6px; cursor:pointer; font-size:12px; font-weight:600;
  transition:background .2s;
}
.logout-btn:hover { background:rgba(232,97,10,.7); border-color:var(--orange); }

/* ── Sidebar ─────────────────────────────────────────────────── */
.app-layout { display:flex; margin-top:var(--header-h); min-height:calc(100vh - var(--header-h)); }

.sidebar {
  width:var(--sidebar-w);
  background:var(--sidebar-bg);
  position:fixed; left:0; top:var(--header-h); bottom:0;
  overflow-y:auto; overflow-x:hidden;
  transition:transform .3s ease, width .25s ease;
  z-index:150;
  box-shadow:3px 0 15px rgba(0,0,0,.18);
}

.sidebar.collapsed { width:60px; }
.sidebar.collapsed .sidebar-menu li span,
.sidebar.collapsed .sidebar-section-label { display:none; }
.sidebar.collapsed .sidebar-menu li i { margin:0 auto; }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display:none;
  position:fixed;
  top:var(--header-h); left:0; right:0; bottom:0;
  background:rgba(0,0,0,.5);
  z-index:140;
  backdrop-filter:blur(2px);
  pointer-events:none;
  transition:opacity .28s;
  opacity:0;
}

.sidebar-overlay.active {
  display:block;
  pointer-events:auto;
  opacity:1;
}

/* Hamburger button (visible on mobile only) */
.sidebar-toggle {
    position:absolute; left:16px; top:50%; transform:translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor:pointer; display:none; align-items:center; justify-content:center;
    color:var(--white); font-size:22px; z-index:210;
    padding:10px 12px;
    transition: all .2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}
.sidebar-toggle:active {
    transform: translateY(-50%) scale(0.98);
}

/* Desktop toggle (original circular button) */
.sidebar-toggle-desktop {
    position:absolute; right:-13px; top:22px;
    background:var(--orange); border:2px solid var(--white);
    border-radius:50%; width:26px; height:26px;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    color:var(--white); font-size:11px; z-index:160;
    transition:background .2s;
}
.sidebar-toggle-desktop:hover { background:var(--orange-dark); }

/* Mobile-specific styles */
@media (max-width:768px) {
    .sidebar-toggle { display:flex; }
    .sidebar-toggle-desktop { display:none; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        width: 280px;
        box-shadow: 4px 0 24px rgba(0,0,0,.35);
        /* Always start off-screen on mobile */
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        z-index: 150;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Prevent collapsed class from interfering on mobile */
    .sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }
    .sidebar.collapsed.mobile-open {
        transform: translateX(0);
    }

    .main-content-area {
        margin-left: 0 !important;
    }

    .header-logo {
        margin-left: 58px;
    }
}

/* Desktop styles */
@media (min-width:769px) {
  .sidebar-overlay { display:none !important; }
}

.sidebar-section-label {
  font-size:.65rem; letter-spacing:1.2px; text-transform:uppercase;
  color:#4a6f9a; padding:16px 18px 4px; font-weight:700;
}

.sidebar-menu { list-style:none; padding:10px 0 20px; }

.sidebar-menu li {
  padding:11px 18px; cursor:pointer;
  display:flex; align-items:center; gap:11px;
  color:#8ab0d8; font-size:.86rem; font-weight:500;
  transition:all .18s; border-left:3px solid transparent;
  white-space:nowrap; overflow:hidden;
  position:relative;
}

.sidebar-menu li i { width:20px; font-size:1rem; text-align:center; flex-shrink:0; }

.sidebar-menu li:hover { background:rgba(43,123,200,.15); color:var(--white); border-left-color:var(--blue); }

.sidebar-menu li.active {
  background:rgba(43,123,200,.15);
  color:var(--white); border-left-color:var(--blue); font-weight:600;
}

.sidebar-menu li.active i { color:var(--blue); }

.main-content-area {
  flex:1; margin-left:var(--sidebar-w);
  padding:24px; transition:margin-left .25s ease;
  max-width:100%; overflow-x:hidden;
}

/* When sidebar is collapsed, push content to 60px */
.app-layout.sidebar-collapsed .main-content-area { margin-left:60px; }

/* Mobile: no left margin — sidebar overlays */
@media (max-width:768px) {
  .main-content-area { margin-left:0 !important; }
}

/* ── Page headings ───────────────────────────────────────────── */
.page-header {
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:12px; margin-bottom:22px;
}
.page-header h2 {
  font-size:1.25rem; font-weight:700; color:var(--text);
  display:flex; align-items:center; gap:8px;
}
.page-header h2 i { color:var(--blue); font-size:1.1rem; }

/* ── Cards (dashboard stats) ─────────────────────────────────── */
.cards {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:16px; margin-bottom:24px;
}

.card {
  background:var(--white); padding:18px 16px; border-radius:var(--radius);
  border:1px solid var(--border); box-shadow:var(--shadow-sm);
  transition:transform .2s, box-shadow .2s;
}

.card.clickable { cursor:pointer; }
.card.clickable:hover { transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--blue); }

.card h4 { font-size:.72rem; color:var(--text-muted); margin-bottom:8px; font-weight:600; letter-spacing:.4px; text-transform:uppercase; }
.card .value { font-size:1.6rem; font-weight:800; color:var(--text); }
.card .card-sub { font-size:.75rem; color:var(--text-muted); margin-top:5px; }

.card.card-blue  { border-top:3px solid var(--blue); }
.card.card-orange{ border-top:3px solid var(--orange); }
.card.card-green { border-top:3px solid #27ae60; }
.card.card-red   { border-top:3px solid #e74c3c; }

/* Glassmorphism variables and background */
body {
  background: linear-gradient(135deg, #f0f4f9 0%, #e0e9f3 100%);
  background-attachment: fixed;
}

/* dashboard container */
.dashboard-container { width: 100%; max-width: none; }
.dashboard-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px; margin-bottom:24px; }
.dashboard-card {
  background: var(--white);
  padding:18px 16px; border-radius:16px;
  border:1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor:pointer;
  transition:transform .2s, box-shadow .2s;
}
.dashboard-card:hover { 
  transform:translateY(-3px); 
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); 
}
.dashboard-card h4 { font-size:.72rem; color:var(--text-muted); margin-bottom:8px; letter-spacing:.3px; text-transform:uppercase; }
.dashboard-card .card-value { font-size:1.5rem; font-weight:800; }
.dashboard-card .card-sub { font-size:.75rem; color:var(--text-muted); margin-top:5px; }

/* chart section */
.chart-section { 
  background: var(--white);
  border-radius:16px; 
  padding:20px; 
  border:1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.chart-section h3 { font-size:.9rem; font-weight:700; color:var(--text); margin-bottom:16px; }
.chart-wrapper { height:280px; position:relative; }

.pie-container { display:flex; align-items:center; gap:12px; margin-top:8px; }
.pie-labels { font-size:.75rem; }
.pie-label { display:flex; align-items:center; gap:6px; margin-bottom:4px; }
.pie-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.pie-dot.green { background:#27ae60; }
.pie-dot.red   { background:#e74c3c; }
.pie-dot.grey  { background:#95a5a6; }
.pie-dot.blue  { background:var(--blue); }
.pie-totals { margin-top:6px; display:flex; flex-direction:column; gap:2px; color:var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-add {
  background:var(--orange); color:var(--white);
  border:none; padding:9px 18px; border-radius:6px;
  cursor:pointer; font-size:13px; font-weight:600;
  transition:background .18s, transform .1s;
  display:inline-flex; align-items:center; gap:6px;
}
.btn-add:hover { background:var(--orange-dark); transform:translateY(-1px); }

.btn-add.secondary {
  background:var(--blue); 
}
.btn-add.secondary:hover { background:var(--blue-dark); }

.btn-add.success { background:#27ae60; }
.btn-add.success:hover { background:#219150; }

.btn-add.danger { background:#e74c3c; }
.btn-add.danger:hover { background:#c0392b; }

.btn-add.outline {
  background:transparent; color:var(--blue);
  border:1.5px solid var(--blue);
}
.btn-add.outline:hover { background:var(--blue-light); transform:none; }

.btn-edit {
  background:var(--blue); color:var(--white);
  border:none; padding:4px 10px; border-radius:5px;
  cursor:pointer; font-size:11px; font-weight:600;
  transition:background .15s;
}
.btn-edit:hover { background:var(--blue-dark); }

/* btn-danger — defined in Modal redesign section below */

.btn-view {
  background:#27ae60; color:var(--white);
  border:none; padding:4px 10px; border-radius:5px;
  cursor:pointer; font-size:11px; font-weight:600;
  transition:background .15s;
}
.btn-view:hover { background:#219150; }

/* btn-save and btn-cancel are defined in the Modal redesign section below */

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrapper { 
  overflow-x:auto; 
  width:100%; 
  margin-top:16px; 
  border-radius:12px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

table {
  width:100%; 
  background:var(--white); 
  border-collapse:separate; 
  border-spacing:0;
  border-radius:12px; 
  overflow:hidden;
  border:none; 
  font-size:12px;
}

th, td { 
  padding:9px 11px; 
  text-align:left; 
  border-bottom:1px solid #f0f4f9; 
}

th {
  background:#f8fafc;
  color:#475569; 
  font-weight:700; 
  font-size:11px;
  letter-spacing:.4px; 
  text-transform:uppercase;
  position:sticky;
  top:0;
  z-index:10;
}

tr:hover td { 
  background:#f8fbff; 
}
tr:last-child td { 
  border-bottom:none; 
}
tr:hover {
  background:#f8fbff;
}

/* Status badges */
.badge {
  display:inline-block; padding:3px 8px; border-radius:12px;
  font-size:.65rem; font-weight:700; letter-spacing:.25px; text-transform:uppercase;
}
.badge-green  { background:#e6f8ee; color:#1a8244; }
.badge-red    { background:#fdecea; color:#c0392b; }
.badge-orange { background:#fff3e6; color:#d4890a; }
.badge-blue   { background:var(--blue-light); color:var(--blue-dark); }
.badge-grey   { background:#f0f0f0; color:#666; }

/* Filters bar */
.filters {
  display:flex; gap:10px; margin-bottom:16px;
  flex-wrap:wrap; align-items:flex-end;
}

.filter-input, .filter-select {
  padding:8px 11px; border:1.5px solid var(--border); border-radius:6px;
  font-size:13px; background:var(--white); color:var(--text);
  transition:border .2s; flex:1; min-width:130px;
}
.filter-input:focus, .filter-select:focus {
  outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(43,123,200,.1);
}

/* Empty state */
.empty-state {
  text-align:center; padding:48px 20px; color:var(--text-muted);
  font-size:.95rem; background:var(--white); border-radius:var(--radius);
  border:1px dashed var(--border);
}
.empty-state i { font-size:2.5rem; margin-bottom:12px; display:block; color:#c8d6e8; }

/* ── Modal ───────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════
   MODAL OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.modal {
  display:none; position:fixed;
  top:0; left:0; width:100%; height:100%;
  background:rgba(10,22,45,.6); backdrop-filter:blur(4px);
  justify-content:center; align-items:center; z-index:1000;
  padding:16px;
}

/* ── Modal card ──────────────────────────────────────────────── */
.modal-content {
  background:#fff;
  border-radius:16px;
  width:100%; max-width:520px; max-height:90vh; overflow-y:auto;
  box-shadow:0 24px 64px rgba(10,22,45,.28), 0 4px 16px rgba(10,22,45,.12);
  animation:modalIn .22s cubic-bezier(.34,1.3,.64,1);
  scrollbar-width:thin; scrollbar-color:var(--border) transparent;
  padding:28px 28px 24px;
}
.modal-content::-webkit-scrollbar { width:5px; }
.modal-content::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

@keyframes modalIn {
  from { opacity:0; transform:translateY(-20px) scale(.96); }
  to   { opacity:1; transform:none; }
}

/* ── Modal header ────────────────────────────────────────────── */
.modal-header {
  padding:0 0 16px;
  border-bottom:1px solid var(--border);
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:20px;
}
.modal-header h3, .modal-content h3 {
  font-size:1.05rem; font-weight:700; color:var(--text);
  margin:0 0 20px; display:flex; align-items:center; gap:8px;
}
.modal-header h3 { margin:0; }
.modal-close {
  background:none; border:none; cursor:pointer; color:var(--text-muted);
  width:30px; height:30px; border-radius:6px;
  display:flex; align-items:center; justify-content:center;
  font-size:1.1rem; transition:background .15s, color .15s;
}
.modal-close:hover { background:#f0f0f0; color:var(--text); }

.modal-body { padding:0; }

/* ── Form labels inside modals ───────────────────────────────── */
.modal-content label {
  display:flex; align-items:center; gap:5px;
  margin-top:16px; margin-bottom:6px;
  font-weight:600; font-size:.72rem; color:#5a6473;
  letter-spacing:.5px; text-transform:uppercase;
}
.modal-content label .req {
  color:var(--orange); font-size:.8rem; line-height:1;
}

/* ── Text / select / textarea inputs ────────────────────────── */
.modal-content input:not([type=file]),
.modal-content select,
.modal-content textarea {
  width:100%; padding:10px 13px;
  border:1.5px solid #dde3ec; border-radius:9px;
  font-size:13.5px; background:#f8fafd; color:var(--text);
  transition:border .18s, box-shadow .18s, background .18s;
  outline:none;
  appearance:none; -webkit-appearance:none;
}
.modal-content input:not([type=file]):hover,
.modal-content select:hover,
.modal-content textarea:hover {
  border-color:#b0bcce; background:#fff;
}
.modal-content input:not([type=file]):focus,
.modal-content select:focus,
.modal-content textarea:focus {
  border-color:var(--blue); background:#fff;
  box-shadow:0 0 0 3.5px rgba(43,123,200,.13);
}
.modal-content textarea { min-height:80px; resize:vertical; line-height:1.5; }

/* select arrow */
.modal-content select {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a8d' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:36px;
}

/* ── File upload — custom styled ─────────────────────────────── */
.modal-content input[type=file] { display:none; }

.file-upload-label {
  display:flex; align-items:center; gap:10px;
  border:1.5px dashed #c5cfe0; border-radius:9px;
  padding:10px 14px; cursor:pointer;
  background:#f8fafd; transition:border .18s, background .18s;
  font-size:13px; color:#6b7a8d;
}
.file-upload-label:hover {
  border-color:var(--blue); background:#f0f6ff; color:var(--blue);
}
.file-upload-label .file-icon {
  width:32px; height:32px; border-radius:7px;
  background:rgba(43,123,200,.1); color:var(--blue);
  display:flex; align-items:center; justify-content:center;
  font-size:.95rem; flex-shrink:0; transition:background .18s;
}
.file-upload-label:hover .file-icon { background:rgba(43,123,200,.2); }
.file-upload-label .file-text { display:flex; flex-direction:column; gap:1px; min-width:0; }
.file-upload-label .file-text strong {
  font-size:12.5px; font-weight:600; color:var(--text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.file-upload-label .file-text span { font-size:11px; color:#9aa5b4; }
.file-upload-label .file-badge {
  margin-left:auto; font-size:10.5px; font-weight:700;
  padding:2px 8px; border-radius:20px;
  background:rgba(43,123,200,.12); color:var(--blue);
  white-space:nowrap; flex-shrink:0;
}

/* file chosen state */
.file-upload-label.has-file {
  border-style:solid; border-color:#27ae60; background:#f0fff5;
}
.file-upload-label.has-file .file-icon { background:rgba(39,174,96,.15); color:#27ae60; }
.file-upload-label.has-file .file-badge { background:rgba(39,174,96,.15); color:#27ae60; }

/* ── Modal action buttons ─────────────────────────────────────── */
.modal-buttons {
  display:flex; justify-content:flex-end; align-items:center; gap:10px;
  margin-top:24px; padding-top:18px; border-top:1px solid var(--border);
}

.btn-cancel {
  padding:9px 20px; border:1.5px solid #dde3ec; border-radius:8px;
  font-size:13px; font-weight:600; cursor:pointer; color:#5a6473;
  background:#fff; transition:all .15s;
}
.btn-cancel:hover { background:#f5f7fa; border-color:#b0bcce; color:var(--text); }

.btn-save, .btn-primary-modal {
  padding:9px 22px; border:none; border-radius:8px;
  font-size:13px; font-weight:700; cursor:pointer;
  background:var(--orange); color:#fff;
  transition:background .15s, transform .1s, box-shadow .15s;
  box-shadow:0 2px 8px rgba(232,97,10,.25);
}
.btn-save:hover, .btn-primary-modal:hover {
  background:var(--orange-dark); transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(232,97,10,.35);
}
.btn-save:active, .btn-primary-modal:active { transform:translateY(0); }

.btn-danger {
  padding:9px 22px; border:none; border-radius:8px;
  font-size:13px; font-weight:700; cursor:pointer;
  background:#e74c3c; color:#fff;
  transition:background .15s, transform .1s;
  box-shadow:0 2px 8px rgba(231,76,60,.2);
}
.btn-danger:hover { background:#c0392b; transform:translateY(-1px); }
.btn-danger:active { transform:translateY(0); }

/* temp-password display box */
.temp-pw-box {
  background:#f5f8ff; border:2px dashed var(--blue);
  border-radius:10px; padding:16px; margin-top:14px; text-align:center;
}
.temp-pw-box .pw-value {
  font-size:1.5rem; font-weight:800; letter-spacing:4px;
  color:var(--blue-dark); font-family:monospace; margin:6px 0;
}
.temp-pw-box small { color:var(--orange); font-size:.78rem; font-weight:600; }

/* ═══════════════════════════════════════════════════════════════
   ALERT / CONFIRM MODALS
   ═══════════════════════════════════════════════════════════════ */
.custom-modal-overlay {
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:rgba(10,22,45,.55); display:flex;
  justify-content:center; align-items:center; z-index:2000;
  backdrop-filter:blur(3px); padding:16px;
}

.custom-modal {
  background:#fff; border-radius:16px; padding:32px 28px 24px;
  width:100%; max-width:390px;
  box-shadow:0 24px 64px rgba(10,22,45,.28);
  animation:modalIn .22s cubic-bezier(.34,1.3,.64,1);
  text-align:center;
}

.custom-modal-header {
  display:flex; flex-direction:column; align-items:center;
  margin-bottom:14px; gap:12px;
}

.custom-modal-icon {
  width:56px; height:56px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:1.4rem; color:#fff;
  box-shadow:0 4px 16px rgba(0,0,0,.15);
}
.custom-modal-icon.success { background:linear-gradient(135deg,#27ae60,#2ecc71); }
.custom-modal-icon.error   { background:linear-gradient(135deg,#c0392b,#e74c3c); }
.custom-modal-icon.warning { background:linear-gradient(135deg,var(--orange-dark),var(--orange)); }
.custom-modal-icon.info    { background:linear-gradient(135deg,var(--blue-dark),var(--blue)); }
.custom-modal-icon.confirm { background:linear-gradient(135deg,var(--blue-dark),var(--blue)); }
.custom-modal-icon.danger  { background:linear-gradient(135deg,var(--orange-dark),var(--orange)); }

.custom-modal-title { font-size:1.1rem; font-weight:700; color:var(--text); }

.custom-modal-body {
  color:var(--text-muted); font-size:.9rem; line-height:1.6;
  margin-bottom:22px;
}

.custom-modal-footer { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; }

.custom-modal-btn {
  padding:10px 26px; border:none; border-radius:8px;
  font-size:13.5px; font-weight:700; cursor:pointer;
  transition:background .15s, transform .1s;
  min-width:100px;
}
.custom-modal-btn:active { transform:scale(.97); }
.custom-modal-btn.primary { background:var(--orange); color:#fff; box-shadow:0 2px 8px rgba(232,97,10,.3); }
.custom-modal-btn.primary:hover { background:var(--orange-dark); }
.custom-modal-btn.secondary { background:var(--blue); color:#fff; border:none; box-shadow:0 2px 8px rgba(43,123,200,.3); }
.custom-modal-btn.secondary:hover { background:var(--blue-dark); }
.custom-modal-btn.danger { background:#e74c3c; color:#fff; box-shadow:0 2px 8px rgba(231,76,60,.3); }
.custom-modal-btn.danger:hover { background:#c0392b; }

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════ */
.pagination {
  display:flex; justify-content:center; align-items:center;
  gap:6px; margin-top:20px; padding:12px 0;
}
.pagination button {
  background:#fff; border:1.5px solid var(--border);
  padding:7px 14px; border-radius:7px; cursor:pointer;
  font-size:13px; color:var(--text); font-weight:600; transition:all .15s;
}
.pagination button:hover:not(:disabled) {
  background:var(--blue); color:#fff; border-color:var(--blue);
}
.pagination button:disabled { opacity:.4; cursor:not-allowed; }
.pagination .page-info {
  padding:7px 14px; background:var(--blue-light); border-radius:7px;
  font-size:13px; color:var(--blue-dark); font-weight:600;
}

/* ═══════════════════════════════════════════════════════════════
   FORM GROUPS (content area forms)
   ═══════════════════════════════════════════════════════════════ */
.form-row { display:flex; gap:12px; flex-wrap:wrap; }
.form-row > * { flex:1; min-width:160px; }

.form-group { margin-bottom:16px; }
.form-group label {
  display:block; font-size:.72rem; font-weight:700;
  color:#5a6473; margin-bottom:6px;
  letter-spacing:.5px; text-transform:uppercase;
}
.form-group input,
.form-group select,
.form-group textarea {
  width:100%; padding:10px 13px;
  border:1.5px solid #dde3ec; border-radius:9px;
  font-size:13.5px; background:#f8fafd; color:var(--text);
  transition:border .18s, box-shadow .18s, background .18s;
  outline:none; appearance:none; -webkit-appearance:none;
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color:#b0bcce; background:#fff; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color:var(--blue); background:#fff;
  box-shadow:0 0 0 3.5px rgba(43,123,200,.13);
}

/* ── Number input: remove spinners ───────────────────────────── */
input[type=number] { -moz-appearance:textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }

/* ── Modal mobile responsive ─────────────────────────────────── */
@media (max-width: 600px) {
  .modal {
    padding:12px;
    align-items:center;      /* centered vertically — not bottom-sheet */
  }
  .modal-content {
    border-radius:16px;      /* full rounding on all four corners */
    max-height:90vh;
    padding:20px 16px 16px;
  }
  .modal-buttons { flex-wrap:wrap; }
  .modal-buttons .btn-cancel,
  .modal-buttons .btn-save,
  .modal-buttons .btn-danger { flex:1; min-width:120px; justify-content:center; }
}


/* ── Settings panel cards ────────────────────────────────────── */
.settings-card {
  background:var(--white); border-radius:var(--radius);
  border:1px solid var(--border); padding:20px; margin-bottom:16px;
  box-shadow:var(--shadow-sm);
}
.settings-card h3 { font-size:.95rem; font-weight:700; color:var(--text); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--border); }

/* ── Team Member rows ────────────────────────────────────────── */
.team-member-card {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius); padding:14px 18px; margin-bottom:10px;
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  box-shadow:var(--shadow-sm); transition:border .2s;
}
.team-member-card:hover { border-color:var(--blue); }

.team-member-avatar {
  width:40px; height:40px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,var(--blue),var(--blue-dark));
  display:flex; align-items:center; justify-content:center;
  color:var(--white); font-weight:800; font-size:1rem; text-transform:uppercase;
}

.team-member-info { flex:1; min-width:140px; }
.team-member-info .name { font-weight:700; color:var(--text); font-size:.95rem; }
.team-member-info .uname { font-size:.8rem; color:var(--text-muted); }

/* Audit log highlight */
.audit-unread { background:#fffbf0 !important; border-left:3px solid var(--orange); }

/* Activity log action chips */
.action-chip {
  display:inline-block; padding:2px 9px; border-radius:10px;
  font-size:.7rem; font-weight:700; letter-spacing:.3px; text-transform:uppercase;
}
.action-chip.create  { background:#e6f8ee; color:#1a8244; }
.action-chip.update  { background:var(--blue-light); color:var(--blue-dark); }
.action-chip.delete  { background:#fdecea; color:#c0392b; }
.action-chip.generate{ background:#f3e9ff; color:#6a1fa0; }
.action-chip.assign  { background:#fff3e6; color:#d4890a; }
.action-chip.login   { background:#e8f8f5; color:#1a6644; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width:768px) {
  :root { --sidebar-w:200px; }
  .main-content-area { padding:14px; }
  .cards, .dashboard-cards { grid-template-columns:1fr 1fr; }
  .header-brand .brand-tagline { display:none; }
}

@media (max-width:480px) {
  .cards, .dashboard-cards { grid-template-columns:1fr; }
  .auth-form-body { padding:20px 16px 18px; }
  .modal-content { width:96%; }
}

/* ── Print (receipts, reports) ───────────────────────────────── */
@media print {
  .app-header, .sidebar, .sidebar-toggle, .btn-add, .btn-edit, .btn-danger, .btn-cancel, .btn-save, .pagination { display:none !important; }
  .main-content-area { margin-left:0 !important; padding:0; }
  body { background:white; }
}

/* ── Offline Banner ──────────────────────────────────────────── */
#offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(231,76,60,.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ── Misc utilities ──────────────────────────────────────────── */
.text-blue   { color:var(--blue); }
.text-orange { color:var(--orange); }
.text-green  { color:#27ae60; }
.text-red    { color:#e74c3c; }
.text-muted  { color:var(--text-muted); }
.fw-bold { font-weight:700; }
.mt-8  { margin-top:8px; }
.mt-16 { margin-top:16px; }

/* ── Password Toggle ─────────────────────────────────────────── */
.pw-wrap { position:relative; }
.pw-wrap input { padding-right:40px !important; }
.pw-toggle { position:absolute; right:0; top:0; height:100%; width:38px; background:none; border:none; cursor:pointer; color:#6b7a8d; font-size:14px; display:flex; align-items:center; justify-content:center; padding:0; }
.pw-toggle:hover { color:#2b7bc8; }
.flex-gap { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

/* ── Add Team Member modal enhancements ──────────────────────── */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea,
.form-group.has-error .pw-wrap input {
  border-color:#e74c3c !important;
  background:#fff8f7;
  box-shadow:0 0 0 3px rgba(231,76,60,.12);
}
.field-error {
  display:none;
  font-size:12px;
  color:#e74c3c;
  margin-top:4px;
  padding-left:2px;
}

/* Info banner at top of modal */
.modal-info-banner {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12.5px;
  color:#4a6080;
  background:#eef4fb;
  border:1px solid #c7daf0;
  border-radius:8px;
  padding:9px 13px;
  margin-bottom:18px;
}
.modal-info-banner i { color:#3a7bd5; flex-shrink:0; }

/* Error banner below the form */
.modal-error-banner {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:#c0392b;
  background:#fdf2f2;
  border:1px solid #f5c6c6;
  border-radius:8px;
  padding:10px 14px;
  margin-top:10px;
}
.modal-error-banner i { flex-shrink:0; }

/* Success state that replaces the form */
.modal-success-state {
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  padding:12px 8px 4px;
}
.modal-success-state .success-icon {
  font-size:52px;
  color:#27ae60;
  line-height:1;
  margin-bottom:4px;
}
.modal-success-state h3 { color:var(--text); }
.modal-success-state p  { color:#4a6080; font-size:14px; margin:4px 0; }
.modal-success-state .success-note {
  font-size:12.5px;
  color:#f5a623;
  background:#fff5ee;
  border:1px solid #f9d0b0;
  border-radius:7px;
  padding:7px 12px;
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:7px;
}

/* ── Payment method info card ────────────────────────────────── */
.pm-info-row {
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:10px 12px;
  background:#f8fafd;
  border:1px solid #dde3ec;
  border-radius:8px;
}
.pm-lbl {
  font-size:.68rem;
  font-weight:700;
  color:#6b7a8d;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.pm-val {
  font-size:13.5px;
  color:#1a2b3c;
  font-weight:500;
}
