/* 
 * LCMS — UI Design System v1.0 
 * Primary Color: #16a34a (Green)
 */

:root {
  /* Global Tokens */
  --primary: #16a34a;
  --primary-hover: #15803d;
  --primary-light: rgba(22, 163, 74, 0.08);
  --primary-mid: rgba(22, 163, 74, 0.15);

  --success: #059669;
  --success-light: rgba(5, 150, 105, 0.08);
  --danger: #dc2626;
  --danger-light: rgba(220, 38, 38, 0.08);
  --warning: #d97706;
  --warning-light: rgba(217, 119, 6, 0.08);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;

  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;

  --sidebar: 248px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);

  /* Light Theme (Default) */
  --bg: #ffffff;
  --bg2: #f9fafb;
  --bg3: #f3f4f6;
  --surface: #ffffff;
  --surface2: #f9fafb;
  --surface3: #f3f4f6;
  --border: #e5e7eb;
  --border2: #d1d5db;
  --text: #111827;
  --text2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;

  /* Sidebar Tokens */
  --sidebar-bg: var(--surface);
  --sidebar-text: var(--text);
  --sidebar-text-muted: var(--muted);
  --sidebar-border: var(--border);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --surface: #1e293b;
  --surface2: #273549;
  --surface3: #334155;
  --border: rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --text2: #cbd5e1;
  --muted: #94a3b8;
  --faint: #475569;

  /* Sidebar Overrides */
  --sidebar-bg: #0f172a;
  /* Deep dark for sidebar in dark mode */
  --sidebar-text: #ffffff;
  --sidebar-text-muted: rgba(255, 255, 255, 0.45);
  --sidebar-border: rgba(255, 255, 255, 0.08);
}

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

body,
h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text2);
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-base), color var(--t-base);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--t-fast);
}

/* Typography */
.text-xs {
  font-size: 11px;
}

.text-sm {
  font-size: 13px;
}

/* Logo & Branding */
.brand-logo {
  height: 32px;
  width: auto;
  transition: filter var(--t-base);
}

[data-theme="dark"] .brand-logo {
  /* Converts black logo to primary green (#16a34a) */
  filter: invert(35%) sepia(85%) saturate(1200%) hue-rotate(110deg) brightness(95%) contrast(101%);
}

.text-base {
  font-size: 15px;
}

.text-lg {
  font-size: 18px;
}

.text-xl {
  font-size: 22px;
}

.text-2xl {
  font-size: 28px;
}

.text-3xl {
  font-size: 36px;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* Layout Shells */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--t-base);
  align-self: start;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  /* Enable scrolling for the nav items */
  padding-bottom: var(--s8);
  /* Extra space at bottom */
}

/* Custom Global Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 10px;
  transition: var(--t-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.main-area {
  background: var(--bg2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-body {
  padding: var(--s8);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  min-width: 0;
}

/* Sidebar Components */
.sidebar-brand {
  padding: var(--s6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  /* Don't shrink header */
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-main {
  color: var(--text);
}

.brand-accent {
  color: var(--primary);
}

.theme-btn {
  background: transparent;
  border: none;
  padding: var(--s2);
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--muted);
  transition: var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  background: var(--bg2);
  color: var(--primary);
}

.theme-btn svg {
  width: 20px;
  height: 20px;
}

[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

[data-theme="light"] .sun-icon {
  display: block;
}

[data-theme="light"] .moon-icon {
  display: none;
}

.nav-label {
  padding: var(--s4) var(--s6) var(--s2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s6);
  color: var(--sidebar-text-muted);
  font-weight: 500;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.sidebar-footer {
  margin-top: auto;
  padding: var(--s4);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  /* Don't shrink footer */
}

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2);
  border-radius: var(--r-md);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.user-plan {
  font-size: 11px;
  color: var(--muted);
}

/* Admin Shell */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  height: 100vh;
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  transition: var(--t-base);
  overflow: hidden;
}

.admin-sidebar .nav-item {
  color: var(--sidebar-text-muted);
}

.admin-sidebar .nav-item:hover,
.admin-sidebar .nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.admin-main {
  background: var(--bg2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-body {
  padding: var(--s8);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.alert-flash {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* =============================================
   AUTH SHELL — Two-column split (desktop first)
   ============================================= */
.auth-shell {
  display: grid;
  grid-template-columns: 5fr 6fr;
  min-height: 100vh;
  overflow: hidden;
}

/* ---- Left: Brand Panel ---- */
.auth-brand-panel {
  background: var(--primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s12) var(--s10);
  position: relative;
  overflow: hidden;
  /* CRITICAL: prevent content from escaping the column */
  min-width: 0;
  width: 100%;
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
}

.auth-brand-logo {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  margin-bottom: var(--s6);
}

.auth-brand-logo .brand-accent {
  color: rgba(255,255,255,0.55);
}

.auth-brand-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: var(--s3);
}

.auth-brand-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  line-height: 1.75;
  margin-bottom: var(--s8);
}

.auth-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s8);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.auth-feature-list li {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.auth-feature-list li i {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px var(--s4);
  border-radius: var(--r-full);
}

/* ---- Right: Form Panel ---- */
.auth-form-panel {
  /* Use the page background — clearly different from the card surface */
  background: var(--bg2);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s10) var(--s8);
  /* CRITICAL: contain the card, don't let it escape */
  min-width: 0;
  width: 100%;
  overflow-y: auto;
}

/* Auth Card */
.auth-card {
  background: var(--surface);
  width: 100%;
  max-width: 400px;
  padding: var(--s8);
  border-radius: var(--r-xl);
  /* Use a clear border that works in dark mode */
  border: 1px solid var(--border2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

[data-theme="dark"] .auth-card {
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* In-card logo: hidden on desktop (brand panel shows it), shown on mobile */
.auth-logo {
  text-align: center;
  margin-bottom: var(--s4);
  display: none;  /* hidden by default (desktop) */
}

.auth-logo .logo {
  font-size: 28px;
  font-weight: 800;
}

.auth-logo .tagline {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

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

.auth-subtitle {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: var(--s5);
}

/* ---- Verification Inputs ---- */
.verify-inputs {
  display: flex;
  gap: var(--s3);
  justify-content: center;
  margin: var(--s5) 0;
}

.verify-digit {
  width: 60px;
  height: 68px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  border: 2px solid var(--border2);
  border-radius: var(--r-lg);
  background: var(--bg2);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  outline: none;
  font-family: var(--font);
  caret-color: transparent;
}

.verify-digit:focus {
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--primary-light);
  transform: translateY(-2px);
}

.verify-digit.filled {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.verify-timer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg3);
  padding: 5px var(--s4);
  border-radius: var(--r-full);
  display: block;
  width: fit-content;
  margin: 0 auto var(--s4);
  border: 1px solid var(--border);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Responsive ---- */
/* Tablet (collapse to 1 column, hide brand panel) */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-brand-panel {
    display: none;
  }
  .auth-form-panel {
    background: var(--bg3);
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 28px 28px;
    padding: var(--s10) var(--s6);
  }
  /* Show in-card logo since brand panel is hidden */
  .auth-logo {
    display: block;
  }
}

/* Mobile */
@media (max-width: 560px) {
  .auth-form-panel {
    align-items: flex-start;
    padding: 40px var(--s4) var(--s10);
  }
  .auth-card {
    padding: var(--s6) var(--s4);
    border-radius: var(--r-lg);
    max-width: 100%;
    border-color: var(--border);
  }
  .auth-title { font-size: 20px; }
  .verify-digit { width: 52px; height: 60px; font-size: 22px; }
  .verify-inputs { gap: var(--s2); margin: var(--s4) 0; }
}

@media (max-width: 360px) {
  .verify-digit { width: 44px; height: 52px; font-size: 18px; }
}


/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 0.625rem 1.25rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--t-fast);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border2);
  color: var(--text2);
}

.btn-outline:hover {
  background: var(--bg2);
  border-color: var(--muted);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--bg3);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 12px;
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 16px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s6);
  box-shadow: var(--shadow);
  transition: var(--t-base);
}

.card:hover {
  border-color: var(--border2);
}

.stat-card {
  background: var(--surface);
  padding: var(--s6);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.stat-value.accent {
  color: var(--primary);
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--r-lg);
  padding: var(--s6);
  box-shadow: var(--shadow);
  transition: var(--t-base);
}

.note-card:hover {
  border-color: var(--border2);
  border-left-color: var(--primary) !important;
}

.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--s4);
  flex-wrap: wrap;
  gap: var(--s4);
}

.action-group {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.hide-mobile-text {
  display: inline;
}

.show-mobile-icon {
  display: none;
}

/* Tables */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--surface);
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table thead {
  background: var(--bg2);
}

.data-table th {
  padding: var(--s4);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: var(--s4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: var(--bg2);
}

.row-tomorrow {
  background: var(--danger-light) !important;
}

.row-tomorrow:hover {
  background: rgba(220, 38, 38, 0.12) !important;
}

/* Badges */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-neutral {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Forms */
.form-group {
  margin-bottom: var(--s5);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: var(--s2);
}

.required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: var(--t-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: var(--s1);
}

.form-error {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: var(--s1);
  font-weight: 500;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Alerts */
.alert {
  padding: var(--s4) var(--s6);
  border-radius: var(--r-md);
  margin-bottom: var(--s4);
  font-weight: 500;
  font-size: 13px;
  border-left: 4px solid transparent;
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border-left-color: var(--success);
}

.alert-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-left-color: var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border-left-color: var(--warning);
}

.alert-info {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}

/* Utilities */
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.grid {
  display: grid;
}

.grid>* {
  min-width: 0;
}

/* CRITICAL: Prevents grid items from overflowing when they contain tables */
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.gap-1 {
  gap: var(--s1);
}

.gap-2 {
  gap: var(--s2);
}

.gap-3 {
  gap: var(--s3);
}

.gap-4 {
  gap: var(--s4);
}

.gap-6 {
  gap: var(--s6);
}

.gap-8 {
  gap: var(--s8);
}

.mb-1 {
  margin-bottom: var(--s1);
}

.mb-2 {
  margin-bottom: var(--s2);
}

.mb-4 {
  margin-bottom: var(--s4);
}

.mb-6 {
  margin-bottom: var(--s6);
}

.mb-8 {
  margin-bottom: var(--s8);
}

.mb-10 {
  margin-bottom: var(--s10);
}

.mt-1 {
  margin-top: var(--s1);
}

.mt-4 {
  margin-top: var(--s4);
}

.mt-8 {
  margin-top: var(--s8);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.p-4 {
  padding: var(--s4);
}

.p-6 {
  padding: var(--s6);
}

.p-8 {
  padding: var(--s8);
}

/* Visibility Utilities */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.text-muted {
  color: var(--muted);
}

.text-faint {
  color: var(--faint);
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.fade-in-1 {
  animation: fadeIn 0.4s ease 0.05s forwards;
  opacity: 0;
}

.fade-in-2 {
  animation: fadeIn 0.4s ease 0.1s forwards;
  opacity: 0;
}

.fade-in-3 {
  animation: fadeIn 0.4s ease 0.15s forwards;
  opacity: 0;
}

.fade-in-4 {
  animation: fadeIn 0.4s ease 0.2s forwards;
  opacity: 0;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--s4);
  visibility: hidden;
  opacity: 0;
  transition: var(--t-base);
}

.modal.active {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--surface);
  width: 100%;
  max-width: 500px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: var(--s4) var(--s6);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: var(--s6);
}

.modal-footer {
  padding: var(--s4) var(--s6);
  background: var(--bg2);
  display: flex;
  justify-content: flex-end;
  gap: var(--s3);
  border-top: 1px solid var(--border);
}

/* Locked Features */
.feature-locked {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--s12) var(--s8);
}

.feature-locked-icon {
  width: 64px;
  height: 64px;
  background: var(--bg3);
  color: var(--muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s6);
}

.feature-locked-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--s2);
}

.feature-locked-desc {
  max-width: 400px;
  color: var(--muted);
  margin-bottom: var(--s8);
  font-size: 14px;
}

/* Toggles */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  display: none;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--bg3);
  border-radius: 24px;
  position: relative;
  transition: var(--t-base);
  border: 1px solid var(--border);
}

.toggle-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: var(--text);
  border-radius: 50%;
  transition: var(--t-base);
}

.toggle input:checked+.toggle-track {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle input:checked+.toggle-track::after {
  left: 23px;
  background: white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animations */
.t-fast {
  transition: var(--t-fast);
}

.t-base {
  transition: var(--t-base);
}

/* Trial Banner */
.trial-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s3) var(--s6);
  font-size: 13px;
  gap: var(--s4);
  flex-wrap: wrap;
}

.trial-banner-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.trial-banner-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.trial-banner-info {
  background: var(--primary-light);
  color: var(--primary);
}

/* Progress Bar */
.progress-bar {
  height: 3px;
  background: var(--bg3);
  width: 100%;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.5s ease;
}

.rounded-full {
  border-radius: var(--r-full);
}

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

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 1000;
    transition: left var(--t-base);
    box-shadow: var(--shadow-md);
  }

  .app-shell.sidebar-open .sidebar {
    left: 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .hide-mobile {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .hide-mobile-text {
    display: none !important;
  }

  .show-mobile-icon {
    display: inline !important;
  }

  .note-card {
    padding: var(--s4);
  }

  .note-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s2);
  }

  .note-card-header .action-group {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: var(--s3);
    margin-top: var(--s2);
  }
}

/* Dropdowns */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  background: var(--surface);
  min-width: 220px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  z-index: 1000;
  padding: var(--s2) 0;
  overflow: hidden;
}

/* Bridge the gap so hover doesn't break */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
  background: transparent;
}

.dropdown.active .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: var(--s3) var(--s4);
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--t-fast);
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Dashboard Banner */
.dashboard-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s8);
  color: white;
  position: relative;
  overflow: hidden;
}

.banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s6);
  position: relative;
  z-index: 2;
}

.banner-text h3 {
  margin: 0 0 var(--s1);
  color: white;
}

.banner-text p {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
  .dashboard-banner {
    padding: var(--s6);
  }

  .banner-content {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .banner-action {
    width: 100%;
  }

  .banner-action .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ═══ RESPONSIVE ═══ */

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
  /* just below sidebar z-index of 1000 */
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
}

/* ── Tablet & Mobile (≤ 1024px) ────────────── */
@media (max-width: 1024px) {

  .app-shell,
  .admin-shell {
    display: block;
    /* single column */
  }

  /* Sidebar becomes a fixed overlay panel */
  .sidebar,
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
  }

  /* When open */
  .sidebar-open .sidebar,
  .sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  /* Main area takes full width */
  .main-area,
  .admin-main {
    margin-left: 0 !important;
    width: 100%;
  }

  .page-body,
  .admin-body {
    padding: var(--s4);
  }
}

@media (max-width: 480px) {

  .page-body,
  .admin-body {
    padding: var(--s3);
  }
}

/* Mobile Topbar */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 500;
}

.mobile-topbar-brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex: 1;
}

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: var(--s2);
  border-radius: var(--r-md);
  transition: background var(--t-fast);
}

.hamburger-btn:hover {
  background: var(--bg3);
}

.mobile-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

@media (max-width: 1024px) {
  .mobile-topbar {
    display: flex;
  }
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s4);
  margin-bottom: var(--s6);
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s3);
    margin-bottom: var(--s4);
  }

  .page-title {
    font-size: 18px;
  }

  .page-header .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s4);
  margin-bottom: var(--s6);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s3);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s2);
  }
}

/* Stat card mobile sizing */
@media (max-width: 480px) {
  .stat-card {
    padding: var(--s3);
  }

  .stat-card .stat-value {
    font-size: 22px;
  }

  .stat-card .stat-label {
    font-size: 11px;
  }

  .stat-card .stat-icon {
    font-size: 1.5rem;
  }
}

/* Tables */
/* Table container — always scrollable */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Prevent table from collapsing too narrow */
.data-table {
  width: 100%;
  min-width: 600px;
  /* forces scroll before this width */
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  /* prevent text wrapping in cells */
}

.data-table th {
  background: var(--bg2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* On very small screens, reduce font + padding */
@media (max-width: 480px) {
  .data-table {
    font-size: 12px;
    min-width: 500px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }
}

/* Hide lower-priority table columns on mobile */
@media (max-width: 768px) {
  .data-table .col-hide-tablet {
    display: none;
  }
}

@media (max-width: 480px) {
  .data-table .col-hide-mobile {
    display: none;
  }
}

/* Action Group */
.action-group {
  display: flex;
  gap: var(--s2);
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .action-group {
    flex-direction: column;
    gap: 4px;
  }

  .action-group .btn {
    width: 100%;
    justify-content: center;
    font-size: 11px;
    padding: 4px 8px;
  }
}

.show-mobile-icon {
  display: none;
}

.hide-mobile-text {
  display: inline;
}

@media (max-width: 480px) {
  .show-mobile-icon {
    display: inline;
  }

  .hide-mobile-text {
    display: none;
  }

  .action-group .btn {
    padding: 6px 8px;
  }
}

/* General grid responsiveness */
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-auto {
    grid-template-columns: 1fr;
  }
}

/* Card padding reduction on mobile */
@media (max-width: 480px) {
  .card {
    padding: var(--s4);
  }

  .card-sm {
    padding: var(--s3);
  }
}

/* Forms */
/* Form groups stack cleanly on mobile */
.form-group {
  margin-bottom: var(--s4);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Inputs full-width always */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  box-sizing: border-box;
}

/* Auth card on very small screens */
@media (max-width: 480px) {
  .auth-page {
    padding: var(--s4);
    align-items: flex-start;
    padding-top: var(--s10);
  }

  .auth-card {
    padding: var(--s5);
  }

  .auth-card .btn {
    width: 100%;
  }
}

/* Buttons */
/* Buttons never overflow their container */
.btn {
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {

  /* Full-width buttons in forms */
  .form-group .btn,
  .auth-card .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Trial Banner */
.trial-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s3) var(--s5);
  font-size: 13px;
  gap: var(--s3);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .trial-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s2);
    font-size: 12px;
    padding: var(--s3) var(--s4);
  }

  .trial-banner .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Dashboard Specific */
/* Dashboard two-column layout collapses */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Hearing list items */
.hearing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
  gap: var(--s3);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .hearing-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Notes Page */
.note-card {
  background: var(--surface);
  padding: var(--s4);
  border-radius: var(--r-md);
  border-left: 4px solid var(--primary);
  margin-bottom: var(--s3);
}

.note-card-header {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  margin-bottom: var(--s4);
}

.note-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.note-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.note-content {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
  word-break: break-word;
}

/* Finance Page */
.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  margin-bottom: var(--s6);
}

@media (max-width: 768px) {
  .finance-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .finance-summary {
    grid-template-columns: 1fr;
  }
}

/* Billing Page */
.billing-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s5);
}

.payment-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

@media (max-width: 640px) {
  .payment-form-grid {
    grid-template-columns: 1fr;
  }

  .billing-plans {
    grid-template-columns: 1fr;
  }
}

/* Profile Page */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s6);
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

/* Search Page */
.search-input-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin-bottom: var(--s5);
}

@media (max-width: 640px) {
  .search-input-wrap {
    max-width: 100%;
  }

  .search-input-wrap .form-input {
    font-size: 16px;
  }

  /* prevent iOS zoom */
}

/* Modals on Mobile */
/* Modal responsive */
@media (max-width: 640px) {
  .modal {
    padding: var(--s3);
    align-items: flex-end;
    /* slide up from bottom on mobile */
  }

  .modal-content {
    max-width: 100%;
    width: 100%;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    /* bottom-sheet style */
    max-height: 85vh;
  }

  .modal-footer {
    flex-direction: column;
    gap: var(--s2);
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Action Groups & Table Alignment */
.action-group {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: nowrap;
}

.action-group form {
  display: inline-flex;
  margin: 0;
}

/* ═══════════════════════════════════════════════
   EMAIL VERIFICATION
   ═══════════════════════════════════════════════ */
.verify-inputs {
  display: flex;
  gap: var(--s3);
  justify-content: center;
  margin: var(--s5) 0;
}
.verify-digit {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--text);
  transition: all var(--t-fast);
  outline: none;
}
.verify-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
  transform: translateY(-2px);
}
.verify-timer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--s3);
  padding: var(--s2) var(--s4);
  background: var(--bg2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.verify-form { margin-top: var(--s4); }

@media (max-width: 480px) {
  .verify-digit { width: 44px; height: 52px; font-size: 22px; }
  .verify-inputs { gap: var(--s2); }
}/* ═══════════════════════════════════════════════
   MESSAGING & CHAT SYSTEM
   ═══════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════
   MESSAGING & CHAT SYSTEM
   ═══════════════════════════════════════════════ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 240px); /* Adjust to viewport */
  min-height: 500px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: var(--s4);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  background-color: var(--bg);
  background-image: 
    linear-gradient(var(--bg2) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg2) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Custom Scrollbar for Chat (Matches Sidebar) */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: var(--r-full);
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.message-wrapper {
  display: flex;
  width: 100%;
}
.msg-own { justify-content: flex-end; }
.msg-other { justify-content: flex-start; }

.message-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: var(--r-lg);
  position: relative;
}

/* Zero padding for image-only messages */
.message-bubble:has(.chat-attachment):not(:has(.message-text:not(:empty))) {
  padding: 4px;
  box-shadow: none !important;
}

/* Specific background for image-only (other person) */
.msg-other .message-bubble:has(.chat-attachment):not(:has(.message-text:not(:empty))) {
  background: rgba(0,0,0,0.05) !important;
  border: 1px solid var(--border);
}

[data-theme="dark"] .msg-other .message-bubble:has(.chat-attachment):not(:has(.message-text:not(:empty))) {
  background: rgba(255,255,255,0.05) !important;
}

.chat-attachment {
  display: block;
  overflow: hidden;
  border-radius: 6px;
}

.chat-img-thumb {
  max-width: 200px;
  max-height: 260px;
  width: auto;
  height: auto;
  border-radius: 6px;
  cursor: zoom-in;
  object-fit: cover;
  display: block;
}

@media (max-width: 480px) {
  .chat-img-thumb {
    max-width: 160px;
    max-height: 200px;
  }
}


.message-text + .chat-attachment {
  margin-top: 8px;
}

/* Chat Image Viewer */
#chatImageViewer { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.viewer-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); cursor: pointer; backdrop-filter: blur(8px); }
.viewer-content { position: relative; z-index: 10000; max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#viewerImage { max-width: 100%; max-height: 85vh; transition: transform 0.2s ease-out; object-fit: contain; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.viewer-close { position: absolute; top: -48px; right: 0; background: rgba(255,255,255,0.1); border: none; color: white; padding: 8px; border-radius: 50%; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.viewer-close:hover { background: var(--danger); }
.viewer-controls { position: absolute; bottom: -60px; display: flex; gap: 16px; background: rgba(255,255,255,0.1); padding: 10px 20px; border-radius: 30px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); }
.viewer-controls button { background: none; border: none; color: white; cursor: pointer; transition: color 0.2s; display: flex; align-items: center; justify-content: center; padding: 4px; }
.viewer-controls button:hover { color: var(--primary); }

.chat-pdf-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg3); border-radius: 8px; color: inherit; text-decoration: none; margin-top: 8px; font-weight: 500; font-size: 14px; transition: background 0.2s; border: 1px solid var(--border); }
.chat-pdf-link:hover { background: var(--border); }

[data-theme="dark"] .chat-img-thumb { border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .chat-pdf-link { background: rgba(255,255,255,0.05); }

.msg-own .message-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.msg-other .message-bubble {
  background: var(--surface2);
  color: var(--text);
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border);
}

.message-text {
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.message-meta {
  font-size: 10px;
  margin-top: var(--s2);
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
}

.msg-other .message-meta {
  justify-content: flex-start;
}

.read-status { 
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-input-area {
  padding: var(--s4) var(--s6);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: var(--s3);
  position: relative;
}

.chat-input-row .form-input {
  border-radius: var(--r-lg);
  padding: 12px var(--s4);
  resize: none;
  min-height: 48px;
  max-height: 150px;
  font-size: 14px;
  background: var(--bg2);
}

.chat-input-row .form-input:focus {
  background: var(--bg);
}

.btn-send {
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-lg);
  flex-shrink: 0;
}

.typing-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: var(--s2);
  padding-left: 2px;
}

.chat-closed-alert {
  padding: var(--s8);
  background: var(--bg2);
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
  .chat-container { height: calc(100vh - 180px); }
}

@media (max-width: 768px) {
  .chat-container { height: calc(100vh - 140px); border-radius: 0; margin: 0 -var(--s4); border-inline: none; }
  .message-bubble { max-width: 85%; }
}


.show-mobile-icon {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile-text {
    display: none;
  }

  .show-mobile-icon {
    display: inline-block;
  }

  /* Ensure table actions remain in row even on mobile */
  .action-group {
    justify-content: flex-start;
  }
}

/* =============================================
   PREMIUM AMBIENCE & PAGE-SPECIFIC STYLES
   ============================================= */

/* --- Common Effects & Utilities --- */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floating-bubble {
  position: absolute;
  border-radius: var(--r-full);
  background: var(--primary);
  opacity: 0.04;
  filter: blur(100px);
  animation: float-drift 25s infinite alternate ease-in-out;
}

.bubble-1 { width: 600px; height: 600px; top: -10%; left: -10%; animation-duration: 30s; }
.bubble-2 { width: 500px; height: 500px; bottom: 10%; right: -5%; opacity: 0.03; animation-duration: 25s; animation-delay: -5s; }
.bubble-3 { width: 400px; height: 400px; top: 40%; left: 50%; opacity: 0.02; animation-duration: 35s; animation-delay: -10s; }

.digital-glitter {
  background-image: radial-gradient(var(--primary) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.05;
}

@keyframes float-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 5%) scale(1.1); }
  100% { transform: translate(-2%, 8%) scale(0.95); }
}

@keyframes ambient-drift {
  0% { transform: translate(-10%, -10%) scale(1); }
  50% { transform: translate(10%, 5%) scale(1.1); }
  100% { transform: translate(-5%, 15%) scale(0.9); }
}

@keyframes pulse-slow {
  from { opacity: 0.3; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 0.7; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes glitter-move {
  from { background-position: 0 0; }
  to { background-position: 160px 160px; }
}

/* --- Hero & Landing Components --- */
.hero-section {
  padding: 8rem 2rem 6rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  max-width: 1000px;
  height: 600px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  z-index: -1;
  opacity: 0.15;
  filter: blur(100px);
  animation: pulse-slow 10s infinite alternate ease-in-out;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: var(--s6);
  box-shadow: var(--shadow);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 800px;
  margin: 0 auto var(--s6);
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto var(--s8);
}

.section {
  padding: 6rem 2rem;
}

.section-title {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: var(--s4);
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto var(--s12);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s8);
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s8);
  position: relative;
  overflow: hidden;
  transition: all var(--t-base);
  z-index: 1;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), var(--primary-light) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s4);
  transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  background: var(--primary);
  color: white;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--s3);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--s8);
  max-width: 1100px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s8);
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pricing-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-light), var(--shadow-md);
  position: relative;
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 16px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.pricing-price {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: var(--s4) 0;
  color: var(--text);
}

.pricing-period {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: var(--s6) 0 var(--s8);
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
  color: var(--text2);
}

.pricing-features svg {
  color: var(--primary);
  flex-shrink: 0;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s6);
  max-width: 1200px;
  margin: 0 auto;
}

.testimonial-card {
  background: var(--surface);
  padding: var(--s8);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.testimonial-card:hover {
  border-color: var(--primary);
  background: var(--bg);
}

.testimonial-quote {
  font-size: 1.1rem;
  color: var(--text);
  font-style: italic;
  margin-bottom: var(--s6);
  line-height: 1.6;
  position: relative;
}

.testimonial-quote::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: -10px;
  font-size: 4rem;
  color: var(--primary-light);
  font-family: serif;
  z-index: -1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid var(--primary);
}

/* --- Contact Page Components --- */
.contact-page-body {
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--s8) var(--s4);
  font-family: var(--font);
  color: var(--text);
}

.contact-card {
  background: var(--surface);
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  margin: auto;
}

.contact-info-panel i {
  color: white !important;
}

.contact-form-wrapper {
  padding: var(--s12) var(--s10);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.form-glow-effect {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, var(--primary) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.12;
  filter: blur(80px);
  animation: ambient-drift 20s infinite alternate ease-in-out;
}

.form-glow-effect-2 {
  position: absolute;
  top: -30%;
  right: -30%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle at 50% 50%, var(--primary) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.08;
  filter: blur(60px);
  animation: ambient-drift 25s infinite alternate-reverse ease-in-out;
}

.form-glitter {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 30%, var(--primary) 1px, transparent 1.5px),
    radial-gradient(circle at 80% 70%, var(--primary) 1.5px, transparent 2px),
    radial-gradient(circle at 50% 50%, var(--text) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.15;
  animation: glitter-move 30s infinite linear;
}

.contact-info-panel {
  background: var(--primary);
  color: white;
  padding: var(--s12) var(--s10);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.art-design {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.art-circle-1 {
  position: absolute;
  bottom: -50px;
  left: -50px;
  width: 250px;
  height: 250px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.0) 100%);
}

.art-circle-2 {
  position: absolute;
  bottom: 40px;
  left: 120px;
  width: 150px;
  height: 150px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.0) 100%);
}

.art-dots {
  position: absolute;
  bottom: 150px;
  left: 30px;
  width: 80px;
  height: 80px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.2) 2px, transparent 2px);
  background-size: 16px 16px;
}

.contact-info-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .contact-card {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column-reverse;
  }
  .contact-form-wrapper,
  .contact-info-panel {
    padding: var(--s8) var(--s6);
  }
  /* Form grid stack */
  .contact-form-wrapper form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* --- Banners (Trial, Brand, System) --- */
.trial-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s3) var(--s6);
  font-size: 13px;
  gap: var(--s4);
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.trial-banner-info { background: var(--primary-light); color: var(--primary); }
.trial-banner-warning { background: var(--warning-light); color: var(--warning); }
.trial-banner-danger { background: var(--danger-light); color: var(--danger); }

.brand-banner {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
  border-bottom: none;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.banner-icon-box {
  background: rgba(255,255,255,0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.banner-text {
  opacity: 0.9;
  font-size: 13px;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.banner-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.7;
  padding: var(--s1);
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.banner-close:hover { opacity: 1; }

@media (max-width: 640px) {
  .trial-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--s4) var(--s5);
  }
  .banner-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: var(--s2);
  }
  .banner-content {
    gap: var(--s3);
  }
}

/* --- Live Search Results --- */
.live-result-item:hover {
  background: var(--bg2) !important;
}

.live-result-item span {
  display: block;
}

.live-search-results-container {
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  z-index: 1000;
}

/* --- Public Content Layouts (Blog, Help, Case Studies) --- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--s10);
  max-width: 1200px;
  margin: var(--s12) auto;
  padding: 0 var(--s4);
}

.content-main {
  background: var(--surface);
  padding: var(--s10);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  min-width: 0;
  box-shadow: var(--shadow);
}

.content-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
  position: sticky;
  top: var(--s8);
  height: fit-content;
  align-self: start;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--surface);
  padding: var(--s6);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sidebar-widget h4 {
  margin-bottom: var(--s4);
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Article Styling */
.article-header {
  margin-bottom: var(--s10);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--s10);
}

.article-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: var(--s6);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--s4);
  color: var(--muted);
  font-size: 13px;
}

.article-content {
  line-height: 1.8;
  font-size: 16px;
  color: var(--text2);
}

.article-content h2, .article-content h3 {
  color: var(--text);
  margin: var(--s12) 0 var(--s4);
  font-weight: 700;
}

.article-content p {
  margin-bottom: var(--s6);
}

.article-content ul, .article-content ol {
  margin-bottom: var(--s6);
  padding-left: var(--s6);
}

.article-content li {
  margin-bottom: var(--s2);
}

/* Recent Items in Sidebar */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.recent-item {
  text-decoration: none;
  display: block;
}

.recent-item h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
  transition: var(--t-fast);
}

.recent-item span {
  font-size: 12px;
  color: var(--muted);
}

.recent-item:hover h5 {
  color: var(--primary);
}

/* CTA Box */
.cta-box {
  background: var(--primary);
  color: white;
  padding: var(--s8);
  border-radius: var(--r-xl);
  text-align: center;
  box-shadow: 0 10px 25px -5px var(--primary-mid);
}

.cta-box h3 {
  margin-bottom: var(--s3);
  font-weight: 700;
}

.cta-box p {
  font-size: 14px;
  margin-bottom: var(--s6);
  opacity: 0.9;
  line-height: 1.5;
}

@media (max-width: 992px) {
  .content-grid {
    grid-template-columns: 1fr;
    margin: var(--s6) auto;
  }
  .content-sidebar {
    position: static;
  }
  .article-title {
    font-size: 32px;
  }
}

/* --- Post Cards & Grids --- */
.content-hero {
  text-align: center;
  padding: var(--s16) var(--s4) var(--s12);
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.content-hero h1 {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: var(--s4);
}

.content-hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--s8);
  max-width: 1200px;
  margin: var(--s12) auto;
  padding: 0 var(--s4);
}

.post-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.post-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.post-card-image {
  width: 100%;
  height: 220px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.post-badge {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: var(--s6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: var(--s3);
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 500;
}

.post-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--s3);
  line-height: 1.3;
}

.post-card p {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: var(--s6);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  margin-top: auto;
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-card-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: var(--s1);
}

@media (max-width: 768px) {
  .content-hero h1 { font-size: 36px; }
  .posts-grid { grid-template-columns: 1fr; }
}
/* -----------------------------------------------
   FORGOT PASSWORD & AUTH VALIDATION
----------------------------------------------- */

/* Password input wrapper with toggle button */
.input-password-wrap {
  position: relative;
}
.input-password-wrap .form-input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--t-fast);
}
.password-toggle:hover { color: var(--text); }

/* Forgot password link alignment */
.form-group-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: calc(var(--s2) * -1);
  margin-bottom: var(--s3);
}
.forgot-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

/* Password strength bar */
.strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 4px;
}
.strength-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.3s ease, background 0.3s ease;
  width: 0%;
}
.strength-label {
  font-size: 11px;
  font-weight: 600;
}

/* Password rules checklist */
.password-rules {
  list-style: none;
  padding: 0;
  margin: var(--s2) 0 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rule {
  font-size: 11px;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
  transition: color var(--t-fast);
}
.rule::before {
  content: '?';
  position: absolute;
  left: 0;
  font-size: 10px;
}
.rule--pass {
  color: var(--success);
}
.rule--pass::before { content: '?'; }
.rule--fail {
  color: var(--danger);
}
.rule--fail::before { content: '?'; }

/* Form error state */
.form-input--error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-light) !important;
}
.form-error {
  display: none;
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  min-height: 16px;
}

/* Responsive */
@media (max-width: 480px) {
  .password-rules { flex-direction: column; }
  .form-group-actions { margin-bottom: var(--s2); }
}

/* PWA Smart Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: var(--r-xl);
  padding: var(--s4);
  z-index: 9999;
  width: 95%;
  max-width: 400px;
  animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.pwa-install-icon img {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  object-fit: cover;
}

.pwa-install-text {
  flex: 1;
}

.pwa-install-text h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.pwa-install-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.pwa-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--faint);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

@keyframes pwaSlideUp {
  from { bottom: -100px; opacity: 0; }
  to { bottom: 20px; opacity: 1; }
}

/* PWA Sticky FAB */
.pwa-sticky-fab {
  position: fixed;
  left: 20px;
  bottom: 80px;
  width: 54px;
  height: 54px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
  cursor: pointer;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-sticky-fab.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.pwa-sticky-fab:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

.pwa-sticky-fab i, .pwa-sticky-fab svg {
  width: 24px;
  height: 24px;
}

.pwa-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
  animation: pwaPulse 2s infinite;
  z-index: -1;
}

@keyframes pwaPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* PWA Topbar Install Button (Desktop) */
.pwa-topbar-install {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--primary-light);
}

.pwa-topbar-install:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

/* Responsive Visibility */
@media (min-width: 1025px) {
  .pwa-sticky-fab { display: none !important; }
  .pwa-topbar-install.visible { display: flex !important; }
}

@media (max-width: 1024px) {
  .pwa-topbar-install { display: none !important; }
  .pwa-sticky-fab.visible { display: flex !important; }
}
