@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════
   PRACTICEBOOKS — DESIGN SYSTEM
   CSS Variables · Reset · Typography · Components · Utilities
═══════════════════════════════════════════════════════════════ */

:root {
  /* Brand Colors (Common) */
  --primary: #4F6AF5;
  --primary-hover: #3D57E0;
  --primary-light: rgba(79, 106, 245, 0.15);
  --accent: #22D3A0;
  --accent-hover: #1BB88C;
  --accent-light: rgba(34, 211, 160, 0.15);

  /* Status (Common) */
  --success: #22D3A0;
  --success-light: rgba(34, 211, 160, 0.12);
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  --info: #60A5FA;
  --info-light: rgba(96, 165, 250, 0.12);

  /* Gradients (Common) */
  --grad-primary: linear-gradient(135deg, #4F6AF5 0%, #22D3A0 100%);

  /* Radii & Spacing (Common) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Typography (Common) */
  /* 'Inter' is a local-install fallback only — it is no longer downloaded. */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Figures, account codes and references — anything that has to line up in a
     column. Windows lands on Cascadia Mono or Consolas, which sit far better
     beside Plus Jakarta Sans than 'Courier New' did. */
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, 'Cascadia Mono', Consolas,
               'Liberation Mono', Menlo, monospace;

  /* Printed statements and the on-screen report sheets that mirror them. These
     are documents, not app chrome, so they stay on a print-safe face that does
     not depend on a webfont having loaded — change this one line to
     var(--font-sans) if you would rather they matched the app. */
  --font-report: Arial, Helvetica, sans-serif;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 17px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 30px;
  --text-3xl: 36px;
  --text-4xl: 48px;

  /* Transitions & Ease (Common) */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;
}

/* ─── Dark Theme (Default) ─── */
:root,
[data-theme="dark"] {
  --bg-base: #0D0F1A;
  --bg-surface: #161828;
  --bg-card: #1C1F35;
  --bg-elevated: #222540;
  --bg-input: #12142A;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(79, 106, 245, 0.6);
  --text-primary: #E8EAF6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --text-inverse: #0D0F1A;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --grad-surface: linear-gradient(180deg, #161828 0%, #0D0F1A 100%);
  --grad-card: linear-gradient(145deg, #1C1F35 0%, #161828 100%);
  --shadow-primary: 0 4px 20px rgba(79, 106, 245, 0.35);

  /* "On tint" text — for colored text sitting on its own pale rgba background
     (status pills, DR/CR badges, account-type badges). Light pastel shades read
     fine here against the dark card surface. */
  --on-tint-success: #86EFAC;
  --on-tint-warning: #FCD34D;
  --on-tint-danger:  #FCA5A5;
  --on-tint-info:    #93C5FD;
  --on-tint-accent:  #6EE7C7;
  --on-tint-violet:  #C4B5FD;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --bg-base: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-elevated: #E2E8F0;
  --bg-input: #F8FAFC;
  --border: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(79, 106, 245, 0.5);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --grad-surface: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 100%);
  --grad-card: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
  --shadow-primary: 0 4px 15px rgba(79, 106, 245, 0.2);

  /* Same pastel shades are unreadable against a pale rgba background on a white
     card, so light mode gets darker, saturated versions of each status color. */
  --on-tint-success: #15803D;
  --on-tint-warning: #B45309;
  --on-tint-danger:  #B91C1C;
  --on-tint-info:    #1D4ED8;
  --on-tint-accent:  #0F766E;
  --on-tint-violet:  #6D28D9;
}

[data-theme="light"] body {
  -webkit-font-smoothing: auto;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}

/* Dark mode pattern overlay — sits on top but never blocks clicks.
   The white masi pattern is inverted + faint so it reads as texture on the dark bg. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("/assets/background.png");
  background-repeat: repeat;
  background-size: 500px;
  pointer-events: none;
  z-index: 9999;
  transition: opacity var(--dur-slow) var(--ease), filter var(--dur-slow) var(--ease);
  /* Dark mode: invert so the white pattern appears on the dark bg */
  opacity: 0.06;
  filter: invert(1);
}

/* Light mode: use the masi/tapa artwork "as is" as a professional full-page
   backdrop behind the content, instead of a faint overlay on top of it. */
[data-theme="light"] body::after {
  display: none;
}

[data-theme="light"] body {
  background-color: var(--bg-base);
  background-image: url("/assets/background.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}

/* Let the body backdrop show through the app frame; cards stay frosted-white on top. */
[data-theme="light"] .app-shell {
  background: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--accent);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: var(--font-sans);
}

input,
textarea,
select {
  font-family: var(--font-sans);
}

/* ─── Auth Layout ────────────────────────────────────────────────────────────── */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Left branding panel */
.auth-brand {
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-8) var(--space-10);
}

.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(79, 106, 245, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(34, 211, 160, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 106, 245, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}

.brand-logo-icon {
  width: 48px;
  height: 48px;
  background: var(--grad-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-primary);
}

.brand-logo-icon svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.brand-logo-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.brand-firm {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brand-hero {
  position: relative;
  z-index: 1;
}

.brand-hero h1 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.brand-hero h1 span {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-hero p {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 420px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.brand-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-primary);
  flex-shrink: 0;
}

.brand-footer {
  position: relative;
  z-index: 1;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.brand-footer .footer-link {
  color: inherit;
  text-decoration: none;
}
.brand-footer .footer-link:hover {
  text-decoration: underline;
}

/* Animated floating shapes */
.brand-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.05;
  animation: float 8s ease-in-out infinite;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -80px;
  right: -60px;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  background: var(--accent);
  bottom: 100px;
  right: 40px;
  animation-delay: 3s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  background: var(--primary);
  bottom: -40px;
  left: 80px;
  animation-delay: 5s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px) scale(1);
  }

  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

/* Right form panel */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-8);
  background: var(--bg-base);
  position: relative;
}

.auth-form-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: var(--border);
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-card-header {
  margin-bottom: var(--space-5);
}

.auth-card-header h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.auth-card-header p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ─── Form Elements ───────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-4);
  position: relative;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  transition: color var(--dur-fast) var(--ease);
}

.form-group:focus-within .form-label {
  color: var(--primary);
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-input {
  width: 100%;
  height: 50px;
  background:var(--bg-elevated);
  border:1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  padding: 0 var(--space-5) 0 44px;
  transition: all var(--dur-base) var(--ease);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:hover {
  border-color:var(--border-focus);
  background: rgba(79, 106, 245, 0.04);
}

.form-input:focus {
  border-color: var(--primary);
  background: rgba(79, 106, 245, 0.06);
  box-shadow: 0 0 0 3px rgba(79, 106, 245, 0.15);
}

.form-input:focus~.input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

/* Password toggle button */
.btn-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  padding: var(--space-1);
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease);
}

.btn-eye:hover {
  color: var(--text-secondary);
}

.btn-eye svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Password Strength ─────────────────────────────────────────────────────── */
.password-strength {
  margin-top: var(--space-2);
}

.strength-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.strength-segment {
  flex: 1;
  height: 3px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  transition: background var(--dur-base) var(--ease);
}

.strength-segment.weak {
  background: var(--danger);
}

.strength-segment.fair {
  background: var(--warning);
}

.strength-segment.good {
  background: var(--info);
}

.strength-segment.strong {
  background: var(--success);
}

.strength-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
}

/* ─── Checkbox / Remember Me ─────────────────────────────────────────────────── */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.link-sm {
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}

.link-sm:hover {
  color: var(--accent);
}

/* ─── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--dur-fast) var(--ease);
}

.btn:hover::after {
  background: rgba(255, 255, 255, 0.06);
}

.btn:active::after {
  background: rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #4F6AF5 0%, #3D57E0 100%);
  color: #fff;
  font-size: var(--text-base);
  height: 50px;
  padding: 0 var(--space-6);
  box-shadow: 0 4px 15px rgba(79, 106, 245, 0.2);
  width: 100%;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(79, 106, 245, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  font-size: var(--text-sm);
  height: 40px;
  padding: 0 var(--space-4);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Button loading spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Alerts / Messages ──────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
  animation: slideIn var(--dur-base) var(--ease-out);
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-error {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #FCA5A5;
}

.alert-success {
  background: var(--success-light);
  border: 1px solid rgba(34, 211, 160, 0.25);
  color: #6EE7C7;
}

.alert-info {
  background: var(--info-light);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: #93C5FD;
}

.alert {
  display: none;
}

.alert.show {
  display: flex;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Divider ─────────────────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Auth Footer ─────────────────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 500;
}

.auth-footer a:hover {
  color: var(--accent);
}

/* ─── Success State ───────────────────────────────────────────────────────────── */
.success-state {
  text-align: center;
  padding: var(--space-8) 0;
  display: none;
}

.success-state.show {
  display: block;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success-light);
  border: 2px solid rgba(34, 211, 160, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  animation: popIn var(--dur-slow) var(--ease-out);
}

.success-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-state h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.success-state p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.success-state .email-highlight {
  color: var(--accent);
  font-weight: 600;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ─── Role Badges ─────────────────────────────────────────────────────────────── */
.role-badges {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  border: 1px solid;
}

.badge-admin {
  background: rgba(79, 106, 245, 0.1);
  border-color: rgba(79, 106, 245, 0.3);
  color: #A5B4FC;
}

.badge-acct {
  background: rgba(34, 211, 160, 0.1);
  border-color: rgba(34, 211, 160, 0.3);
  color: #6EE7C7;
}

.badge-auditor {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #FCD34D;
}

.badge-client {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
  color: #93C5FD;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-form-panel {
    padding: var(--space-8) var(--space-5);
  }

  .auth-form-panel::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .auth-card {
    max-width: 100%;
  }

  .auth-form-panel {
    padding: var(--space-6) var(--space-4);
  }
}

/* ─── Utility ─────────────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.mt-4 {
  margin-top: var(--space-4);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.text-center {
  text-align: center;
}

.text-sm {
  font-size: var(--text-sm);
}

.text-muted {
  color: var(--text-muted);
}

/* ─── Dashboard Form Controls ──────────────────────────────────────────────────
   (used outside the auth pages, e.g. company forms)                          */
.form-control {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  padding: 0 var(--space-4);
  transition: all var(--dur-base) var(--ease);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(79, 106, 245, 0.05);
  box-shadow: 0 0 0 3px rgba(79, 106, 245, 0.12);
}

.form-control.is-invalid {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.04);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid {
  border-color: var(--success);
}

select.form-control {
  cursor: pointer;
}

select.form-control option {
  background: var(--bg-card);
}

textarea.form-control {
  height: auto;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
}

/* Field error message */
.field-error {
  display: none;
  font-size: 11px;
  color: var(--danger);
  margin-top: 5px;
  padding-left: 2px;
}

.field-error.show {
  display: block;
}

/* ─── Alert Variants (for dashboard forms) ─────────────────────────────────── */
.alert-danger {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #FCA5A5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  animation: slideIn var(--dur-base) var(--ease-out);
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #FCD34D;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  animation: slideIn var(--dur-base) var(--ease-out);
}

/* Make the existing .alert-success always visible (not hidden by default in dashboards) */
.panel .alert-success,
.page-content .alert-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  animation: slideIn var(--dur-base) var(--ease-out);
}

/* ─── Print Styles ─────────────────────────────────────────────────────────── */
@media print {

  /* The masi/tapa backdrop is decorative screen chrome. On paper it prints as a
     grey wash (and blows up the PDF file size), so drop it from every export. */
  body::before,
  body::after {
    display: none !important;
    content: none !important;
  }

  html,
  body,
  .app-shell,
  .main-content,
  .page-content,
  .panel {
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
  }

  /* Global Hide for Print */
  .no-print,
  .sidebar,
  .topbar,
  .je-toolbar,
  .btn-modal-close,
  .modal-footer,
  #btn-add-line,
  .filter-tabs,
  .summary-cards,
  .greeting-banner,
  .stats-grid,
  .panel-header {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html,
  body,
  .app-shell,
  .main-content,
  .page-content {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    width: 100% !important;
    display: block !important;
    box-shadow: none !important;
  }

  .panel {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  /* Handle Individual Journal Entry Printing */
  #je-modal.show~.app-shell {
    display: none !important;
  }

  #je-modal.show {
    position: static !important;
    display: block !important;
    opacity: 1 !important;
    background: none !important;
    padding: 0 !important;
  }

  .je-modal {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  /* Tables */
  .journal-table,
  .alloc-table {
    border: 1px solid #333 !important;
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
  }

  .journal-table th,
  .journal-table td,
  .alloc-table th,
  .alloc-table td {
    border: 1px solid #333 !important;
    color: #000 !important;
    padding: 6px 8px !important;
    font-size: 10pt !important;
  }

  .journal-table thead th,
  .alloc-table thead th {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: bold !important;
  }

  /* Hide Status (10) and Actions (11) columns in the main journal list table */
  .journal-table th:nth-child(10),
  .journal-table td:nth-child(10),
  .journal-table th:nth-child(11),
  .journal-table td:nth-child(11) {
    display: none !important;
  }

  /* Form controls for Individual Entry */
  .form-control,
  select,
  textarea {
    border: none !important;
    background: none !important;
    padding: 2px 0 !important;
    color: #000 !important;
    appearance: none !important;
    font-size: 11pt !important;
  }

  label {
    color: #000 !important;
    font-weight: bold !important;
    font-size: 11pt !important;
  }

  .je-modal-header h3 {
    color: #000 !important;
    font-size: 18pt !important;
    margin: 0 0 1cm 0 !important;
    border-bottom: 2px solid #000 !important;
    padding-bottom: 5px !important;
  }
}

/* ─── Security Enhancements ─────────────────────────────────────────────────── */
.security-badges {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.security-badge svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}


.auth-card {
  position: relative;
  backdrop-filter: blur(16px);
  background: rgba(22, 24, 40, 0.7);
  border:1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  padding: 40px;
}

[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ─── UI Enhancements ───────────────────────────────────────────────────────── */

/* Enhanced Buttons */
.btn-primary {
  background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Secure Layout adjustments */
.security-badges {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

[data-theme="light"] .security-badges {
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.security-badge span {
  font-weight: 500;
  color: var(--text-primary);
}


/* Theme Toggle Button */
.theme-toggle-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:var(--bg-elevated);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-focus);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

[data-theme="light"] .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-toggle-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.5s ease;
}

.theme-toggle-btn:hover svg {
  transform: rotate(15deg);
}