/* ============================================
   PRINTA — Fortune 50 Design System
   Inspired by Stripe, Linear, Vercel, Apple
   ============================================ */

/* Google Fonts — Inter (body) + Syne (display) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Syne:wght@700;800&display=swap');

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

:root {
  /* ── Surface Palette (Inks Lavender) ── */
  --bg-page: #F5F3FF;
  --bg-card: #FFFFFF;
  --bg-input: #F8F6FF;
  --bg-sidebar: #FFFFFF;
  --bg-hover: #F0EDFE;
  --bg-active: #EDE9FE;
  --bg-subtle: #FAF9FF;

  /* ── Text Palette ── */
  --text-primary: #1A1535;
  --text-secondary: #3D3660;
  --text-muted: #7C7599;
  --text-placeholder: #A8A0C0;

  /* ── Accent System (Inks Violet) ── */
  --accent: #6C47FF;
  --accent-hover: #5E3DE5;
  --accent-light: #F0EDFE;
  --accent-text: #5E3DE5;
  --accent-gradient: linear-gradient(135deg, #6C47FF 0%, #8B5CF6 100%);
  --accent-glow: rgba(108, 71, 255, 0.22);

  /* ── Semantic Colors ── */
  --success: #059669;
  --success-bg: #ECFDF5;
  --error: #DC2626;
  --error-bg: #FEF2F2;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --info: #0284C7;
  --info-bg: #F0F9FF;

  /* ── Borders (Lavender-Gray) ── */
  --border: #E8E5F0;
  --border-hover: #D5D0E8;
  --border-focus: #6C47FF;
  --border-subtle: #F0EDFE;

  /* ── Elevation System (Lavender ambient glow) ── */
  --shadow-xs: 0 1px 2px rgba(108, 71, 255, 0.03);
  --shadow-sm: 0 1px 3px rgba(108, 71, 255, 0.05), 0 1px 2px rgba(26, 21, 53, 0.03);
  --shadow-md: 0 4px 14px rgba(108, 71, 255, 0.06), 0 2px 4px rgba(26, 21, 53, 0.02);
  --shadow-lg: 0 12px 40px rgba(108, 71, 255, 0.08), 0 4px 12px rgba(26, 21, 53, 0.03);
  --shadow-xl: 0 20px 60px -12px rgba(108, 71, 255, 0.18), 0 8px 24px rgba(26, 21, 53, 0.05);
  --shadow-glow: 0 0 0 3px rgba(108, 71, 255, 0.18);
  --shadow-card: 0 2px 8px rgba(108, 71, 255, 0.04), 0 8px 24px rgba(108, 71, 255, 0.06);
  --shadow-card-hover: 0 8px 30px rgba(108, 71, 255, 0.10), 0 2px 8px rgba(108, 71, 255, 0.05);

  /* ── Radii (Softer / Rounder) ── */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* ── Layout ── */
  --sidebar-width: 260px;
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Brand Logo - Stacked */
.brand-logo-container {
  display: flex;
  flex-direction: column;
  line-height: 1;
  justify-content: center;
}
.brand-logo-main {
  font-family: 'Outfit', sans-serif !important;
  font-size: 2.2rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.05em !important;
  color: #1E1B4B; 
  text-transform: lowercase;
}
.brand-logo-sub {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase;
  color: #8B5CF6; 
  margin-top: 2px;
}

/* ── Brand Logo — Syne Display ───────────── */
.logo-text, .brand-logo-text {
  font-family: 'Syne', -apple-system, sans-serif !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.04em !important;
  background: linear-gradient(135deg, #1A1535 0%, #6C47FF 60%, #8B5CF6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.logo-icon { display: none !important; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 100vh;
  letter-spacing: -0.011em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

::selection {
  background: rgba(79, 70, 229, 0.15);
  color: var(--text-primary);
}

/* ── Typography ──────────────────────────── */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1875rem; }
h4 { font-size: 1rem; }

.text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Buttons — Stripe-level polish ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  position: relative;
  isolation: isolate;
}

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

.btn-primary {
  background: var(--accent-gradient);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 2px rgba(26, 21, 53, 0.06), 0 4px 14px rgba(108, 71, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(26, 21, 53, 0.08), 0 8px 24px rgba(108, 71, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(26, 21, 53, 0.06), 0 2px 8px rgba(108, 71, 255, 0.20);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(220, 38, 38, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(220, 38, 38, 0.28);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 48px;
  padding: 0 28px;
  font-size: 0.9375rem;
  border-radius: var(--radius-lg);
}

.btn-block { width: 100%; }

.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inputs — Linear-style controls ──────── */
.form-group { margin-bottom: 20px; }

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

.form-input,
.form-select {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  outline: none;
  box-shadow: var(--shadow-xs);
}

.form-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
}

.form-input::placeholder { color: var(--text-placeholder); }
.form-input:hover { border-color: var(--border-hover); }

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card);
}

.form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 4px;
  display: none;
}
.form-error.visible { display: block; }

.input-wrapper { position: relative; }

.input-wrapper .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
  transition: color var(--transition);
}
.input-wrapper .toggle-password:hover { color: var(--text-secondary); }

/* ── Cards — Premium depth & surface ─────── */
.card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 28px;
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-flat { box-shadow: none; border: 1px solid var(--border); }
.card-flat:hover { box-shadow: none; }

/* ── Stat / KPI Cards ────────────────────── */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card .stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Badges — with optional pulsing dot ──── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-accent { background: var(--accent-light); color: var(--accent-text); }
.badge-neutral { background: var(--bg-hover); color: var(--text-muted); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

/* Pulsing live dot for active statuses */
.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Tables — Clean alignment ────────────── */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.table thead th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-secondary);
}

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

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

.table .user-cell { display: flex; align-items: center; gap: 12px; }

.table .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.table .user-info .user-name { font-weight: 600; color: var(--text-primary); }
.table .user-info .user-email { font-size: 0.75rem; color: var(--text-muted); }
.table .actions { display: flex; align-items: center; gap: 6px; }

/* ── Select / Dropdown ───────────────────── */
.form-select {
  height: 32px;
  padding: 0 32px 0 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.form-select:hover { border-color: var(--border-hover); }
.form-select:focus { border-color: var(--border-focus); box-shadow: var(--shadow-glow); }

/* ── Toggle Switch ───────────────────────── */
.toggle { position: relative; width: 40px; height: 22px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--border-hover);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}
.toggle .slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* ── Layout: Auth Pages ──────────────────── */
.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-card .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.auth-card .logo-text {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-card h1 { margin-bottom: 4px; }

.auth-card .subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 28px;
}

.auth-card .footer-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 24px;
}

.auth-card .divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.auth-card .divider::before,
.auth-card .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Layout: Dashboard ───────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-header .logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.sidebar-nav .nav-section { margin-bottom: 8px; }

.sidebar-nav .nav-section-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-placeholder);
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

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

.nav-item.active {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
}

.nav-item.active .nav-icon svg {
  stroke: #FFFFFF;
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-item .nav-icon svg { width: 18px; height: 18px; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.sidebar-user .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.sidebar-user .user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-user .user-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

.page-header {
  padding: 28px 32px 0;
}

.page-header h1 {
  margin-bottom: 4px;
  font-size: 1.75rem;
}

.page-header .page-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.page-body {
  padding: 24px 32px 40px;
}

/* ── Toolbar ─────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  height: 38px;
  padding: 0 14px 0 38px;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}

.toolbar .filter-select {
  height: 38px;
  padding: 0 32px 0 12px;
  font-size: 0.8125rem;
}

/* ── Pagination ──────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  transition: all var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

/* ── Modal — Vercel-style overlay ────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px) saturate(150%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  padding: 24px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--transition-slow);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

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

.modal-header h3 { font-size: 1.0625rem; }

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body { padding: 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── Toast — Refined notifications ───────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  min-width: 300px;
  max-width: 420px;
  animation: slideInRight 0.35s var(--transition);
  border-left: 3px solid var(--border);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

.toast.fade-out { animation: fadeOutRight 0.3s ease forwards; }

.toast .toast-icon { font-size: 1.1rem; flex-shrink: 0; display: flex; align-items: center; }
.toast .toast-message { flex: 1; }

.toast .toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  font-size: 1rem;
  transition: color var(--transition);
}
.toast .toast-close:hover { color: var(--text-primary); }

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

@keyframes fadeOutRight {
  to { transform: translateX(100%); opacity: 0; }
}

/* ── Stats Grid ──────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Empty State ─────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.35;
}

.empty-state h3 { color: var(--text-secondary); margin-bottom: 6px; }

.empty-state p {
  font-size: 0.8125rem;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Profile Layout ──────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.profile-section { margin-bottom: 0; }

.profile-section h2 {
  font-size: 1.0625rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Welcome Section ─────────────────────── */
.welcome-section { margin-bottom: 24px; }
.welcome-section h1 { margin-bottom: 4px; }

/* ── Loading ─────────────────────────────── */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.page-loader .spinner-lg {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Mobile Sidebar & Header ─────────────── */


.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
}

/* ── Confirm Dialog ──────────────────────── */
.confirm-dialog .modal { max-width: 400px; }

.confirm-dialog .confirm-message {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── User Dropdown Menu ──────────────────── */
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.user-menu-trigger:hover, .user-menu-trigger.active {
  background: var(--bg-hover);
  border-color: var(--border);
}

.user-menu-trigger .user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
}

.user-menu-trigger .user-menu-details {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.user-menu-trigger .user-menu-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-menu-trigger .user-menu-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 6px 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  pointer-events: none;
}

.user-menu-wrapper:hover .user-menu-dropdown,
.user-menu-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.user-menu-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  margin: 0 4px;
  width: calc(100% - 8px);
}

.user-menu-dropdown .dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.user-menu-dropdown .dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-menu-dropdown .dropdown-item.danger { color: var(--error); }
.user-menu-dropdown .dropdown-item.danger:hover { background: var(--error-bg); color: var(--error); }

/* ── Step 2 Print Options Layout ─────────── */
.step2-header-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.step2-header-container .back-btn {
  position: absolute;
  left: 0;
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border-subtle);
}
.step2-header-container .back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.step2-header-title {
  text-align: center;
}
.step2-header-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.step2-header-title p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.doc-summary-card {
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}

.option-strip {
  background: white;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}
.option-strip .strip-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 130px;
}
.option-strip .strip-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #F0EDFE;
  color: #6C47FF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option-strip .strip-icon svg {
  width: 16px;
  height: 16px;
}
.option-strip .strip-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.copies-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 42px;
  width: 140px;
}
.copies-control button {
  width: 42px;
  height: 100%;
  background: white;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.copies-control button:hover { background: var(--bg-hover); }
.copies-control input {
  flex: 1;
  height: 100%;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  width: 100%;
}
.copies-control input:focus { outline: none; }

/* ── Responsive — Mobile ─────────────────── */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .mobile-nav-logo { display: block !important; }
  .inks-top-nav { padding: 16px !important; }

  /* Compact option strips for mobile */
  .option-strip { padding: 8px 12px !important; gap: 8px !important; margin-bottom: 6px !important; }
  .option-strip .strip-icon { width: 30px !important; height: 30px !important; border-radius: 6px !important; }
  .option-strip .strip-icon svg { width: 14px !important; height: 14px !important; }
  .option-strip .strip-label { font-size: 0.8125rem !important; }
  .option-strip .strip-left { gap: 8px !important; min-width: auto !important; }


  .sidebar {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding-top: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .page-header { padding: 16px 16px 0 !important; width: 100% !important; box-sizing: border-box !important; }
  .page-body { padding: 16px !important; width: 100% !important; max-width: 100vw !important; overflow-x: hidden !important; box-sizing: border-box !important; }

  .card, .wizard-panel, .upload-zone {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  #recent-docs-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .upload-zone h3 {
    font-size: 0.875rem !important;
    word-break: break-word !important;
  }

  .options-grid,
  .profile-grid,
  .binding-options-grid {
    grid-template-columns: 1fr !important;
  }

  .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .table { min-width: 600px; }

  .modal {
    width: 92% !important;
    max-width: 100% !important;
    margin: 16px !important;
    padding: 20px !important;
  }

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

  .track-stepper {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 12px;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .wizard-steps { flex-wrap: wrap; gap: 12px; }
}

/* ── Utility ─────────────────────────────── */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-md { margin-bottom: 16px; }

/* ── Upload Zone (Inks Claymorphic) ──────── */
.upload-zone {
  border: 2px dashed #D5D0F8;
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  margin-bottom: 24px;
  position: relative;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: #F9F7FF;
  box-shadow: 0 0 0 4px rgba(108, 71, 255, 0.06);
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: #F0EDFE;
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(108, 71, 255, 0.12);
}

.upload-zone .upload-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #F0EDFE;
  color: var(--accent);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone .upload-icon svg {
  width: 28px;
  height: 28px;
}

.upload-zone.drag-over .upload-icon { background: var(--accent); color: #fff; }

.upload-zone h3 { font-size: 1rem; margin-bottom: 6px; color: var(--text-primary); }
.upload-zone p { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }
.upload-zone input[type="file"] { display: none; }

/* ── Upload Progress ─────────────────────── */
.upload-progress { margin-bottom: 24px; }

.upload-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.upload-progress-item .file-info { flex: 1; min-width: 0; }

.upload-progress-item .file-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-progress-item .progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.upload-progress-item .progress-bar .progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── File Type Icons ─────────────────────── */
.file-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.file-type-badge.pdf { background: #FEF2F2; color: #DC2626; }
.file-type-badge.doc, .file-type-badge.docx { background: #EFF6FF; color: #2563EB; }
.file-type-badge.png, .file-type-badge.jpg, .file-type-badge.jpeg { background: #F0FDF4; color: #16A34A; }

.doc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
}

.doc-icon.pdf { background: #FEF2F2; color: #DC2626; }
.doc-icon.image { background: #ECFDF3; color: #16A34A; }
.doc-icon.doc { background: #EBF3FE; color: #2563EB; }
.doc-icon.ppt, .doc-icon.pptx { background: #FFF6ED; color: #EA580C; }
.doc-icon.xls, .doc-icon.xlsx { background: #ECFDF3; color: #059669; }
.doc-icon.txt { background: #F0F9FF; color: #0284C7; }

/* ── Binding Selection Cards ─────────────── */
.binding-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.binding-card {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.binding-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.binding-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm);
}

.binding-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.binding-card .binding-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.binding-card .binding-price {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent-text);
  background: #FFFFFF;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.binding-card.selected .binding-price {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

.binding-card .binding-desc {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Wizard Panel Animations ─────────────── */
.wizard-panel {
  animation: fadeInUp 300ms var(--transition);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.preview-container-box {
  background: linear-gradient(135deg, #EDE9FE 0%, #F5F3FF 100%);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  box-shadow: inset 0 2px 4px rgba(108, 71, 255, 0.04);
}

/* ── Order Tracking Stepper ──────────────── */
.track-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
}

.track-step { text-align: center; position: relative; }

.track-step .step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  margin: 0 auto 8px;
  transition: all var(--transition);
}

.track-step.active .step-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.track-step.completed .step-circle {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.track-step .step-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.track-step.active .step-title { color: var(--accent); }
.track-step.completed .step-title { color: var(--success); }

.track-step .step-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Preview Modal ───────────────────────── */
.preview-modal .modal { max-width: 800px; max-height: 90vh; }

.preview-modal .preview-content {
  max-height: 60vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  border-radius: var(--radius-md);
  min-height: 200px;
}

.preview-modal .preview-content img { max-width: 100%; max-height: 60vh; object-fit: contain; }
.preview-modal .preview-content iframe { width: 100%; height: 60vh; border: none; border-radius: var(--radius-md); }

.preview-modal .preview-content .no-preview {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.preview-modal .preview-content .no-preview svg { margin-bottom: 12px; opacity: 0.5; }
