/* ============================================
   Skybridge Settlement Pro Manager — 3-Theme System
   Ported from skybridge_data_view/static/style.css
   1. Corporate (clean light, default)
   2. Midnight  (dark glass)
   3. Warm      (earthy tones)
   ============================================ */

/* ============================================
   THEME 1 — CORPORATE (default)
   ============================================ */

:root, [data-theme="corporate"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-hover: #f1f5f9;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #3b82f6;
  --border-strong: #94a3b8;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;
  --accent-gradient-start: #3b82f6;
  --accent-gradient-end: #2563eb;

  --success: #10b981;
  --success-bg: #d1fae5;
  --success-border: #a7f3d0;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --error-border: #fecaca;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --info-border: #bfdbfe;

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

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -1px rgba(15,23,42,.04);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,.08), 0 4px 6px -2px rgba(15,23,42,.04);
  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,.08), 0 10px 10px -5px rgba(15,23,42,.04);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Fira Code", monospace;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  --header-height: 64px;
  --header-bg: rgba(255,255,255,.95);
  --card-bg: #ffffff;
  --input-bg: #ffffff;
  --button-shadow: 0 1px 2px rgba(15,23,42,.1);

  --table-header-bg: #f1f5f9;
  --table-row-hover: #f8fafc;
  --table-stripe: #fafbfc;
  --table-border: #e2e8f0;

  --glass-bg: rgba(255,255,255,.8);
  --glass-border: rgba(226,232,240,.8);
  --glass-blur: 8px;
}

/* ============================================
   THEME 2 — MIDNIGHT
   ============================================ */

[data-theme="midnight"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --surface: rgba(30,41,59,.6);
  --surface-elevated: rgba(30,41,59,.85);
  --surface-hover: rgba(51,65,85,.8);

  --border-light: rgba(148,163,184,.15);
  --border-medium: rgba(148,163,184,.25);
  --border-focus: #60a5fa;
  --border-strong: rgba(148,163,184,.4);

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --accent-primary: #60a5fa;
  --accent-hover: #3b82f6;
  --accent-light: rgba(96,165,250,.15);
  --accent-gradient-start: #60a5fa;
  --accent-gradient-end: #a78bfa;

  --success: #34d399;
  --success-bg: rgba(52,211,153,.15);
  --success-border: rgba(52,211,153,.3);
  --error: #f87171;
  --error-bg: rgba(248,113,113,.15);
  --error-border: rgba(248,113,113,.3);
  --warning: #fbbf24;
  --warning-bg: rgba(251,191,36,.15);
  --warning-border: rgba(251,191,36,.3);
  --info: #60a5fa;
  --info-bg: rgba(96,165,250,.15);
  --info-border: rgba(96,165,250,.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -1px rgba(0,0,0,.3);
  --shadow-lg: 0 0 20px rgba(96,165,250,.15), 0 10px 15px -3px rgba(0,0,0,.4);
  --shadow-xl: 0 0 30px rgba(96,165,250,.2), 0 20px 25px -5px rgba(0,0,0,.5);

  --header-height: 64px;
  --header-bg: rgba(15,23,42,.85);
  --card-bg: rgba(30,41,59,.5);
  --input-bg: rgba(15,23,42,.6);
  --button-shadow: 0 0 15px rgba(96,165,250,.3);

  --table-header-bg: rgba(30,41,59,.9);
  --table-row-hover: rgba(51,65,85,.5);
  --table-stripe: rgba(30,41,59,.3);
  --table-border: rgba(148,163,184,.12);

  --glass-bg: rgba(30,41,59,.4);
  --glass-border: rgba(148,163,184,.2);
  --glass-blur: 16px;
}

/* ============================================
   THEME 3 — WARM
   ============================================ */

[data-theme="warm"] {
  --bg-primary: #fefdfb;
  --bg-secondary: #faf7f2;
  --bg-tertiary: #f5efe6;
  --surface: #fefdfb;
  --surface-elevated: #ffffff;
  --surface-hover: #f5efe6;

  --border-light: #e8dfd3;
  --border-medium: #d4c5b0;
  --border-focus: #d97706;
  --border-strong: #b8a590;

  --text-primary: #292019;
  --text-secondary: #5c4f3d;
  --text-tertiary: #8b7e6a;
  --text-muted: #b0a28f;
  --text-inverse: #ffffff;

  --accent-primary: #d97706;
  --accent-hover: #b45309;
  --accent-light: #fffbeb;
  --accent-gradient-start: #d97706;
  --accent-gradient-end: #b45309;

  --success: #059669;
  --success-bg: #d1fae5;
  --success-border: #a7f3d0;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --error-border: #fecaca;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --info-border: #bae6fd;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(41,32,25,.07);
  --shadow-md: 0 4px 8px -1px rgba(41,32,25,.1), 0 2px 4px -1px rgba(41,32,25,.05);
  --shadow-lg: 0 10px 20px -3px rgba(41,32,25,.1), 0 4px 8px -2px rgba(41,32,25,.05);
  --shadow-xl: 0 20px 30px -5px rgba(41,32,25,.1), 0 10px 10px -5px rgba(41,32,25,.05);

  --header-height: 64px;
  --header-bg: rgba(254,253,251,.95);
  --card-bg: #fefdfb;
  --input-bg: #ffffff;
  --button-shadow: 0 1px 3px rgba(217,119,6,.2);

  --table-header-bg: #f5efe6;
  --table-row-hover: #faf7f2;
  --table-stripe: #fdfaf6;
  --table-border: #e8dfd3;

  --glass-bg: rgba(254,253,251,.8);
  --glass-border: rgba(232,223,211,.8);
  --glass-blur: 8px;
}

/* ============================================
   BASE
   ============================================ */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-base), color var(--transition-base);
}

/* ============================================
   HEADER
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.header-left { display: flex; align-items: center; gap: 12px; }
.brand-logo { display: flex; align-items: center; }
.brand-logo svg { width: 32px; height: 32px; transition: transform var(--transition-fast); }
.brand-logo:hover svg { transform: scale(1.05); }

.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -.3px; line-height: 1.2;
}
.title {
  font-size: 12px; color: var(--text-tertiary); font-weight: 500;
  letter-spacing: .5px; text-transform: uppercase;
}

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

/* ============================================
   3-THEME SELECTOR
   ============================================ */

.theme-selector {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}
.theme-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: none; border-radius: var(--radius-full);
  background: transparent; color: var(--text-tertiary);
  font-size: 11px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all var(--transition-fast); white-space: nowrap;
}
.theme-btn:hover { color: var(--text-primary); background: var(--surface-hover); }
.theme-btn.active {
  background: var(--surface-elevated); color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.theme-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.corporate-dot { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.midnight-dot  { background: linear-gradient(135deg, #60a5fa, #a78bfa); }
.warm-dot      { background: linear-gradient(135deg, #d97706, #b45309); }

/* ============================================
   USER MENU
   ============================================ */

.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.user-menu-trigger:hover {
  background: var(--surface-hover);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  text-transform: uppercase; flex-shrink: 0;
}
.user-name {
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dropdown-arrow {
  font-size: 10px; color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}
.user-menu-trigger[aria-expanded="true"] .dropdown-arrow { transform: rotate(180deg); }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 240px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 8px 0;
  z-index: 101;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  animation: dropdownIn .2s ease;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.menu-header { padding: 8px 16px; margin-bottom: 4px; }
.menu-title {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 16px;
  background: none; border: none; color: var(--text-primary);
  font-size: 14px; font-family: inherit; cursor: pointer;
  transition: all var(--transition-fast); text-align: left;
}
.menu-item:hover { background: var(--surface-hover); }
.menu-icon { font-size: 16px; width: 20px; text-align: center; }
.menu-divider { height: 1px; background: var(--border-light); margin: 8px 0; }
.menu-item.menu-danger { color: var(--error); }
.menu-item.menu-danger:hover { background: var(--error-bg); }

/* ============================================
   CONTAINER
   ============================================ */

.container { max-width: 1400px; margin: 0 auto; padding: 24px; }
.container-wide { max-width: 1600px; margin: 0 auto; padding: 24px; }

/* ============================================
   TOP STEP NAV (horizontal tab-bar under header)
   ============================================ */

.step-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.step-nav::-webkit-scrollbar { height: 4px; }
.step-nav::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 2px; }

.step-nav-inner {
  display: flex;
  gap: 4px;
  max-width: 1600px;
  margin: 0 auto;
}

.step-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}
.step-nav a:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.step-nav a.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}
.step-nav a .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
}
.step-nav a.active .step-num {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

/* ============================================
   TAB BAR (within a view)
   ============================================ */

.tab-bar {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  padding: 12px 18px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px; font-family: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}
.tab::after {
  content: ""; position: absolute; bottom: -2px; left: 50%;
  width: 0; height: 2px;
  background: var(--accent-primary);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
}
.tab:hover { color: var(--text-primary); background: var(--surface-hover); }
.tab:hover::after { width: 30%; }
.tab.active { color: var(--accent-primary); }
.tab.active::after { width: 100%; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .3s ease; }

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

/* Sub-tab variant for within tab content (Part A / Part B etc) */
.subtab-bar {
  display: flex; gap: 2px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subtab-bar::-webkit-scrollbar { display: none; }
.subtab {
  padding: 8px 14px;
  background: none; border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px; font-family: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition-fast);
}
.subtab:hover { background: var(--surface-hover); color: var(--text-primary); }
.subtab.active {
  background: var(--surface-elevated);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   PAGE / STEP HEADER CARD
   ============================================ */

.page-header {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left h2 { margin: 0 0 4px 0; font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-header-left p { margin: 0; color: var(--text-tertiary); font-size: 13px; }

.env-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}
.env-pill button {
  padding: 6px 14px;
  border: none; background: transparent;
  font-size: 12px; font-weight: 600;
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.env-pill button:hover { color: var(--text-primary); }
.env-pill button.active {
  background: var(--surface-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.env-pill button.active.uat { color: var(--info); }
.env-pill button.active.production { color: var(--error); }

/* ============================================
   FILTER / SEARCH BAR
   ============================================ */

.filter-bar,
.search-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.search-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.search-group label {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .5px;
}
.search-group input,
.search-group select,
.search-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition-fast);
  width: 100%;
}
.search-group input:focus,
.search-group select:focus,
.search-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.search-group textarea { font-family: var(--font-mono); font-size: 12px; min-height: 80px; resize: vertical; }

.checkbox-group {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
  align-self: center;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.checkbox-group input[type="checkbox"] { accent-color: var(--accent-primary); cursor: pointer; }
.checkbox-group label { cursor: pointer; user-select: none; }

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary,
.btn-search {
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: var(--text-inverse);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: var(--button-shadow);
}
.btn-primary:hover,
.btn-search:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active,
.btn-search:active { transform: translateY(0); }
.btn-primary:disabled,
.btn-search:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-secondary:disabled { opacity: .6; cursor: not-allowed; }

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-danger:hover { background: var(--error); color: white; }

.btn-success {
  background: var(--success);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-success:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-action {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px; font-family: inherit; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-medium);
  transition: all var(--transition-fast);
  background: var(--surface);
  color: var(--text-primary);
}
.btn-action:hover { background: var(--surface-hover); }
.btn-action.danger { color: var(--error); border-color: var(--error-border); }
.btn-action.danger:hover { background: var(--error-bg); }

.btn-logout {
  background: var(--surface);
  color: var(--error);
  border: 1px solid var(--error-border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px; font-family: inherit; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-logout:hover { background: var(--error-bg); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ============================================
   FORMS
   ============================================ */

.form-grid {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group label {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition-fast);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-group .hint { font-size: 11px; color: var(--text-tertiary); }
.form-group textarea { font-family: var(--font-mono); font-size: 12px; min-height: 80px; resize: vertical; }

/* Chips input (for comma-separated lists) */
.chips-input {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  min-height: 42px;
  cursor: text;
  transition: all var(--transition-fast);
}
.chips-input:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.chips-input input {
  flex: 1; min-width: 80px;
  border: none; outline: none; background: transparent;
  color: var(--text-primary);
  font-size: 13px; font-family: inherit;
  padding: 4px 0;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500;
}
.chip button {
  background: none; border: none;
  color: var(--accent-primary);
  cursor: pointer; padding: 0; font-size: 14px; line-height: 1;
}
.chip button:hover { color: var(--error); }

/* File upload (drag/drop) */
.file-drop {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: var(--bg-tertiary);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.file-drop:hover,
.file-drop.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}
.file-drop .file-icon { font-size: 36px; margin-bottom: 8px; opacity: .8; }
.file-drop .file-text { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.file-drop .file-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.file-drop input[type="file"] { display: none; }
.file-selected {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 16px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: 13px;
  margin-top: 12px;
}
.file-selected .file-meta { display: flex; flex-direction: column; gap: 2px; }
.file-selected .file-name { font-weight: 600; word-break: break-all; }
.file-selected .file-size { font-size: 11px; opacity: .8; }

/* ============================================
   STATUS BANNERS
   ============================================ */

.status-banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .3s ease;
  margin-bottom: 16px;
}
.status-banner:empty { display: none; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.status-banner.error   { background: var(--error-bg);   border-color: var(--error-border);   color: var(--error); }
.status-banner.info    { background: var(--info-bg);    border-color: var(--info-border);    color: var(--info); }
.status-banner.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.status-banner.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }

/* ============================================
   SUMMARY CARDS
   ============================================ */

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.summary-card,
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.summary-card:hover,
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.summary-card .label,
.card-header {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px;
}
.summary-card .value,
.card-value {
  font-size: 24px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -.5px; line-height: 1.2;
}
.summary-card .sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.value.green, .card-value.success { color: var(--success); }
.value.amber, .card-value.warning { color: var(--warning); }
.value.red,   .card-value.error   { color: var(--error); }

/* Step cards on dashboard */
.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.step-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column; gap: 8px;
}
.step-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}
.step-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step-card-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 800;
}
.step-card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.step-card-desc { font-size: 13px; color: var(--text-tertiary); line-height: 1.5; }
.step-card-meta {
  display: flex; gap: 12px;
  margin-top: 4px;
  font-size: 11px; color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   SECTIONS / TABLES
   ============================================ */

.section {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.section h3,
.section h4 {
  margin: 0;
  font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.section h3 { font-size: 16px; }
.section h4 { font-size: 14px; }

.table-wrap {
  border: 1px solid var(--table-border);
  border-radius: var(--radius-md);
  overflow: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead { position: sticky; top: 0; z-index: 2; }
th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--table-header-bg);
  border-bottom: 2px solid var(--table-border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--table-border);
  transition: background var(--transition-fast);
  vertical-align: middle;
}
tbody tr:nth-child(even) td { background: var(--table-stripe); }
tbody tr:hover td { background: var(--table-row-hover); }
tbody tr:last-child td { border-bottom: none; }

.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .3px;
}
.badge-green  { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-blue   { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info-border); }
.badge-amber  { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-red    { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-border); }
.badge-gray   { background: var(--bg-tertiary); color: var(--text-tertiary); border: 1px solid var(--border-light); }

/* ============================================
   MODAL / CONFIRM OVERLAY
   ============================================ */

.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: backdropIn .3s ease;
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  position: relative;
  background: var(--surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideIn .3s ease;
  display: flex; flex-direction: column;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(.95) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}
.modal-icon {
  width: 40px; height: 40px;
  background: var(--warning-bg);
  color: var(--warning);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.modal-icon.danger { background: var(--error-bg); color: var(--error); }
.modal-icon.success { background: var(--success-bg); color: var(--success); }
.modal-icon.info { background: var(--info-bg); color: var(--info); }

.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; }
.modal-close {
  background: none; border: none;
  font-size: 22px;
  color: var(--text-tertiary);
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-family: inherit;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text-primary); }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; font-size: 14px; color: var(--text-secondary); }
.modal-body p { margin: 0 0 12px 0; }
.modal-body strong { color: var(--text-primary); }
.modal-body .yes-input {
  margin-top: 16px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-mono);
}

.modal-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

/* ============================================
   RAW JSON / CODE
   ============================================ */

.raw-response,
.raw-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-top: 12px;
}
.raw-toggle summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  user-select: none;
  list-style: none;
}
.raw-toggle summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  font-size: 9px;
  transition: transform var(--transition-fast);
}
.raw-toggle[open] summary::before { transform: rotate(90deg); }

.raw-response pre,
.raw-toggle pre {
  margin: 0;
  padding: 14px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-primary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
}
.raw-toggle:not([open]) pre { display: none; }

/* Log output (for run-test stdout etc) */
.log-output {
  background: #0a0e1a;
  color: #cbd5e1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
}
[data-theme="corporate"] .log-output,
[data-theme="warm"] .log-output { background: #1a1d2e; }

/* ============================================
   UTILITY
   ============================================ */

.hidden { display: none !important; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-end { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--text-tertiary); }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* JSON output block (used by views) */
.json-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow: auto;
  margin: 12px 0 0;
}

/* Generic results table style */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.results-table th,
.results-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
}
.results-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  position: sticky; top: 0;
}
.results-table tr:hover td { background: var(--surface-hover); }

/* Two-column responsive grid for forms */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* ============================================
   ROLE-AWARE COMPONENTS
   ============================================ */

.role-notice {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  margin: 0 0 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}
.role-notice strong { color: var(--text-primary); }

.role-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.role-pill.role-viewer   { background: rgba(59, 130, 246, 0.10); color: #3b82f6; border-color: rgba(59, 130, 246, 0.25); }
.role-pill.role-operator { background: rgba(16, 185, 129, 0.10); color: #10b981; border-color: rgba(16, 185, 129, 0.25); }
.role-pill.role-admin    { background: rgba(239, 68, 68, 0.10);  color: #ef4444; border-color: rgba(239, 68, 68, 0.25); }

.risk-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}
.risk-pill.risk-diagnostic { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.risk-pill.risk-dry_run    { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.risk-pill.risk-live       { background: rgba(239, 68, 68, 0.12);  color: #ef4444; }
.risk-pill.risk-restricted { background: rgba(168, 85, 247, 0.12); color: #a855f7; }

.integration-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
  margin-right: 4px;
}
.integration-pill.integration-zoho      { color: #0ea5e9; border-color: rgba(14, 165, 233, 0.25); }
.integration-pill.integration-s3        { color: #f59e0b; border-color: rgba(245, 158, 11, 0.25); }
.integration-pill.integration-snowflake { color: #29b5e8; border-color: rgba(41, 181, 232, 0.25); }
.integration-pill.integration-email     { color: #a855f7; border-color: rgba(168, 85, 247, 0.25); }

/* Live-aware buttons */
.live-run-btn[disabled],
button.live-run-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-disabled, var(--bg-tertiary));
  color: var(--text-tertiary);
  border-color: var(--border-light);
}
.live-run-btn .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.live-run-btn .dot-live { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.18); }

/* Summary-card tone variants used by dashboard + step result panels */
.summary-card.tone-good  { border-left: 3px solid #10b981; }
.summary-card.tone-warn  { border-left: 3px solid #f59e0b; }
.summary-card.tone-live  { border-left: 3px solid #ef4444; }
.summary-card.tone-info  { border-left: 3px solid #3b82f6; }

.summary-label {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.summary-value {
  font-size: 24px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.5px; line-height: 1.2;
}
.summary-hint {
  font-size: 12px; color: var(--text-tertiary); margin-top: 4px;
}

/* Step-tag (used in dashboard step cards) */
.step-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px;
  padding: 4px 8px;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  font-size: 12px; font-weight: 800; letter-spacing: 0.6px;
}
.step-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }

.meta-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
  margin-right: 4px;
}
.meta-pill.meta-live { background: rgba(239, 68, 68, 0.10); color: #ef4444; border-color: rgba(239, 68, 68, 0.25); }

/* JSON details (collapsible raw output) */
.json-details {
  margin-top: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  padding: 8px 12px;
}
.json-details > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  list-style: none;
  user-select: none;
  padding: 4px 0;
}
.json-details > summary::-webkit-details-marker { display: none; }
.json-details > summary::before {
  content: '▸ ';
  display: inline-block;
  margin-right: 4px;
  transition: transform var(--transition-fast);
}
.json-details[open] > summary::before { transform: rotate(90deg); }
.json-details .json-block {
  margin-top: 8px;
  background: var(--bg-secondary);
}

.table-area { margin-top: 12px; }

.hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-style: italic;
}

/* Form inputs / textareas — make them consistent */
.form-group textarea {
  width: 100%;
  resize: vertical;
  min-height: 56px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  background: var(--input-bg, var(--bg-secondary));
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
}
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Action row spacing */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Empty state */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-tertiary);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border-medium);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.center-load {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  gap: 14px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg-secondary);
}
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-xl);
}
.login-brand {
  text-align: center;
  margin-bottom: 24px;
}
.login-brand .login-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  font-size: 22px; font-weight: 800;
  margin-bottom: 14px;
}
.login-brand h1 { margin: 0 0 6px 0; font-size: 22px; font-weight: 700; color: var(--text-primary); }
.login-brand p { margin: 0; color: var(--text-tertiary); font-size: 13px; }

.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 14px; font-family: inherit;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}
.login-card input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.login-card button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px; font-family: inherit; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--button-shadow);
}
.login-card button[type="submit"]:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.login-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-top: 4px;
}
.login-error:empty { display: none; }

.login-theme-row {
  display: flex; justify-content: center;
  margin-top: 18px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .header { padding: 0 14px; }
  .brand-text .title { display: none; }
  .user-name { display: none; }
  .theme-name { display: none; }
  .theme-btn { padding: 5px 8px; }
  .container, .container-wide { padding: 14px; }
  .step-nav { padding: 0 14px; }
  .filter-bar, .search-bar { flex-direction: column; align-items: stretch; }
  .search-group { width: 100%; }
  .summary-cards { grid-template-columns: 1fr 1fr; }
  th, td { padding: 9px 10px; }
  table { font-size: 12px; }
  .modal-content { max-height: 95vh; }
}

@media (max-width: 480px) {
  .tab { padding: 10px 12px; font-size: 12px; }
  .summary-cards { grid-template-columns: 1fr; }
  .summary-card .value, .card-value { font-size: 20px; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================
   THEME-SPECIFIC ENHANCEMENTS
   ============================================ */

[data-theme="corporate"] .section,
[data-theme="warm"] .section {
  border-left: 3px solid var(--accent-primary);
}

[data-theme="midnight"] .card,
[data-theme="midnight"] .summary-card,
[data-theme="midnight"] .section,
[data-theme="midnight"] .filter-bar,
[data-theme="midnight"] .search-bar,
[data-theme="midnight"] .page-header,
[data-theme="midnight"] .step-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
[data-theme="midnight"] .header { background: var(--glass-bg); }
[data-theme="midnight"] .user-menu-dropdown,
[data-theme="midnight"] .modal-content {
  background: rgba(30,41,59,.92);
  backdrop-filter: blur(calc(var(--glass-blur) * 2));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) * 2));
}
[data-theme="midnight"] .btn-primary,
[data-theme="midnight"] .btn-search { box-shadow: 0 0 20px rgba(96,165,250,.35); }
[data-theme="midnight"] .btn-primary:hover,
[data-theme="midnight"] .btn-search:hover { box-shadow: 0 0 30px rgba(96,165,250,.5); }

[data-theme="warm"] .summary-card:hover,
[data-theme="warm"] .card:hover,
[data-theme="warm"] .step-card:hover { border-color: var(--accent-primary); }
