/* ============================================================================
   Voce — Style principal
   ============================================================================ */

/* --- Variables ----------------------------------------------------------- */
:root {
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --primary: #3D8E9E;
  --primary-light: #5AABB8;
  --primary-pale: #E0F4F6;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --border: #E0E0E0;
  --border-light: #F0F0F0;
  --warning: #FFA726;
  --success: #66BB6A;
  --error: #EF5350;
  --success-pale: #E8F5E9;
  --warning-pale: #FFF3E0;
  --error-pale: #FFEBEE;
  --primary-dark: #347a88;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --transition: all 0.15s ease;
  --max-width: 720px;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* --- 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);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Focus visible ------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Typography ---------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--primary-light); text-decoration: underline; }

/* --- Layout -------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.page {
  display: none;
  animation: fadeIn 0.25s ease;
}
.page.active { display: block; }

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

/* --- Header -------------------------------------------------------------- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}
.header-brand:hover { text-decoration: none; color: var(--text); }

.header-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary);
}

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

.header-user {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-pale);
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.header-link:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

/* --- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  min-height: 48px;
  line-height: 1;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-light); color: white; }

.btn-secondary {
  background: var(--primary-pale);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover:not(:disabled) { background: var(--primary); color: white; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-pale); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  min-height: 36px;
}
.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #D32F2F; }

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  min-height: 36px;
}

.btn-icon {
  padding: 8px;
  min-height: unset;
  border-radius: var(--radius-sm);
}

/* --- Forms --------------------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 122, 120, 0.12);
}
.form-input::placeholder { color: var(--text-muted); }

/* --- Messages ------------------------------------------------------------ */
.msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
  line-height: 1.5;
}
.msg.visible { display: block; }
.msg.error   { background: var(--error-pale); color: var(--error); }
.msg.success { background: var(--success-pale); color: #2E7D32; }
.msg.warning { background: var(--warning-pale); color: #E65100; }
.msg.info    { background: var(--primary-pale); color: var(--primary-dark); }

/* --- Badges -------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-pending    { background: var(--warning-pale); color: #E65100; }
.badge-processing { background: #E3F2FD; color: #1565C0; }
.badge-done       { background: var(--success-pale); color: #2E7D32; }
.badge-error      { background: var(--error-pale); color: var(--error); }
.badge-approved   { background: var(--success-pale); color: #2E7D32; }
.badge-suspended  { background: var(--error-pale); color: var(--error); }
.badge-admin      { background: #EDE7F6; color: #5E35B1; }

/* =========================================================================
   LANDING PAGE
   ========================================================================= */

.landing { padding: 60px 0 40px; }

.landing-hero {
  text-align: center;
  margin-bottom: 60px;
}

.landing-logo {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
}

.landing-hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.landing-hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Features */
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.feature-card {
  text-align: center;
  padding: 28px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  background: var(--primary-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Pricing */
.landing-pricing {
  text-align: center;
  padding: 36px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid var(--primary-pale);
  margin-bottom: 40px;
}

.pricing-amount {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.pricing-amount span {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
}

.pricing-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pricing-note {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* Landing buttons */
.landing-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 60px;
}

.landing-actions .btn {
  width: auto;
  min-width: 180px;
}

/* =========================================================================
   FOOTER
   ========================================================================= */

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  margin-top: 40px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--primary); }

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================================
   AUTH PAGES (login / register)
   ========================================================================= */

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px;
}

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

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo svg {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
}

.auth-logo h2 {
  color: var(--primary);
  font-size: 24px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-switch a, .auth-switch button {
  color: var(--primary);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
}
.auth-switch a:hover, .auth-switch button:hover {
  text-decoration: underline;
}

/* =========================================================================
   DASHBOARD
   ========================================================================= */

.dashboard {
  padding: 24px 0 40px;
}

/* --- Quota bar ----------------------------------------------------------- */
.quota-bar {
  margin-bottom: 20px;
}

.quota-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.quota-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.quota-fill.high { background: var(--warning); }
.quota-fill.full { background: var(--error); }

/* --- Recorder ------------------------------------------------------------ */
.record-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  z-index: 1;
  background: none;
  width: 100%;
  display: block;
  margin-top: 8px;
  font-family: inherit;
}
.record-zone:hover {
  border-color: var(--primary);
  background: var(--primary-pale);
}
.record-zone strong {
  display: block;
  font-size: 14px;
}
.recorder-active { margin-bottom: 12px; }
.recorder-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #FFF5F5;
  border-radius: var(--radius);
  border: 1px solid #EF5350;
}
.recorder-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #EF5350;
  flex-shrink: 0;
  animation: pulse 1.2s ease-in-out infinite;
}
.recorder-level-bar {
  flex: 1; height: 4px;
  background: rgba(239,83,80,0.15);
  border-radius: 2px; overflow: hidden;
}
.recorder-level {
  height: 100%; width: 0%;
  background: #EF5350;
  border-radius: 2px;
  transition: width 0.1s ease;
}
.recorder-timer {
  font-size: 16px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #EF5350; min-width: 45px; text-align: center;
}
.recorder-controls .btn-stop {
  padding: 8px 16px;
  background: var(--text); color: white;
  border: none; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; cursor: pointer;
}

/* --- Upload zone --------------------------------------------------------- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-pale);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  background: var(--primary-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-icon svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.upload-zone strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-zone p {
  font-size: 14px;
  color: var(--text-secondary);
}

.selected-file {
  margin-top: 12px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  display: none;
}
.selected-file.visible { display: flex; align-items: center; gap: 6px; }

.upload-progress {
  margin-top: 12px;
  display: none;
}
.upload-progress.visible { display: block; }

progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--border); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 3px; transition: width 0.3s; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 3px; }

/* --- Jobs list ----------------------------------------------------------- */
.jobs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.jobs-header h2 {
  font-size: 17px;
  color: var(--text);
}

.refresh-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.spinner.visible { display: block; }

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

.job-item {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}
.job-item.status-pending    { border-left-color: var(--warning); }
.job-item.status-processing { border-left-color: #1565C0; }
.job-item.status-done       { border-left-color: var(--success); }
.job-item.status-error      { border-left-color: var(--error); }

.job-item.clickable {
  cursor: pointer;
}
.job-item.clickable:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-pale);
}

.status-dot {
  display: none;
}

.status-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.badge-pending    { background: rgba(255,167,38,0.12); color: var(--warning); }
.badge-processing { background: rgba(21,101,192,0.12); color: #1565C0; }
.badge-done       { background: rgba(102,187,106,0.12); color: var(--success); }
.badge-error      { background: rgba(239,83,80,0.12); color: var(--error); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.job-info {
  flex: 1;
  min-width: 0;
}

.job-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.job-chevron {
  color: var(--border);
  font-size: 18px;
  flex-shrink: 0;
  transition: var(--transition);
}
.job-item.clickable .job-chevron { color: var(--text-secondary); }
.job-item.clickable:hover .job-chevron { color: var(--primary); }

/* --- SVG animations ------------------------------------------------------ */
.svg-anim {
  display: block;
  flex-shrink: 0;
}

.svg-waiting {
  width: 40px;
  height: 16px;
}

.svg-processing {
  width: 80px;
  height: 32px;
}

.svg-success {
  width: 24px;
  height: 24px;
}

.svg-upload {
  width: 32px;
  height: 32px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--border);
  margin-bottom: 12px;
}
.empty-state p {
  font-size: 15px;
}

/* =========================================================================
   RESULT MODAL (bottom-sheet style)
   ========================================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease-out;
}

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

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 12px;
}

.modal-close {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}
.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.modal-footer .btn-danger {
  background: transparent;
  color: #EF5350;
  border: 1px solid #EF535044;
}
.modal-footer .btn-danger:hover {
  background: #EF535011;
  border-color: #EF5350;
}
.modal-footer-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --- Speakers ------------------------------------------------------------ */
.speakers-section {
  margin-bottom: 20px;
  display: none;
}
.speakers-section.visible { display: block; }

.speakers-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.speaker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.speaker-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.speaker-label {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 80px;
}

.speaker-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
}
.speaker-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 122, 120, 0.12);
}

/* --- Transcript result --------------------------------------------------- */
.result-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.markdown-result {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
}

.markdown-result .speaker-name {
  font-weight: 700;
  color: var(--primary);
}

.markdown-result .timestamp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================================
   ADMIN
   ========================================================================= */

.admin-page {
  padding: 24px 0 40px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.admin-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}
.admin-tab:hover { color: var(--primary); }
.admin-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}
.admin-panel.active { display: block; }

/* Admin stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Admin pending banner */
.pending-banner {
  background: var(--warning-pale);
  border: 1px solid #FFE0B2;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pending-banner svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #E65100;
}

.pending-banner span {
  font-size: 14px;
  font-weight: 500;
  color: #E65100;
}

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

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

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

.admin-table .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Responsive table wrapper */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--surface);
}

/* Admin queue item */
.queue-item {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-item .job-meta span {
  display: inline-block;
  margin-right: 12px;
}

/* =========================================================================
   LEGAL PAGES
   ========================================================================= */

.legal-page {
  padding: 32px 0 40px;
}

.legal-page h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--primary);
}

.legal-page .legal-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.legal-page h2 {
  font-size: 18px;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.legal-page h3 {
  font-size: 15px;
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-page p, .legal-page li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.legal-page ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.legal-page li {
  margin-bottom: 4px;
}

.legal-page address {
  font-style: normal;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* =========================================================================
   TOAST
   ========================================================================= */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: white;
  z-index: 999;
  box-shadow: var(--shadow-md);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}
.toast.success { background: #2E7D32; }
.toast.error   { background: var(--error); }
.toast.hide    { opacity: 0; transform: translateX(-50%) translateY(10px); }

/* =========================================================================
   CONFIRM DIALOG
   ========================================================================= */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.confirm-dialog {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.2s ease;
}

.confirm-dialog h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.confirm-dialog p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-dialog .confirm-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  margin-bottom: 16px;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

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

/* Tablet */
@media (max-width: 900px) {
  .landing-features {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 600px) {
  :root {
    --max-width: 100%;
  }

  body {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .header {
    padding: 10px 16px;
  }

  .header-user {
    display: none;
  }

  .landing {
    padding: 40px 0 20px;
  }

  .landing-hero h1 {
    font-size: 26px;
  }

  .landing-hero p {
    font-size: 16px;
  }

  .landing-features {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .landing-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .landing-actions .btn {
    min-width: unset;
  }

  .pricing-amount {
    font-size: 36px;
  }

  .card {
    padding: 18px;
  }

  .auth-page {
    padding: 32px 16px;
  }

  .modal {
    max-height: 95vh;
    border-radius: 12px 12px 0 0;
  }

  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-tab {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

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

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 24px;
  }

  .admin-table {
    font-size: 13px;
  }

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

  .footer-links {
    gap: 6px 16px;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .header-title {
    font-size: 18px;
  }

  .landing-hero h1 {
    font-size: 22px;
  }
}

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

/* --- Tag chips ----------------------------------------------------------- */
.tag-chip {
  display: inline-block;
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.4;
}
.job-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* --- Tag filter bar ------------------------------------------------------ */
.tag-filter-bar { padding: 0 0 12px 0; }
.tag-filter-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; }
.tag-filter-chip {
  font-size: 11px; padding: 4px 12px; border-radius: 16px;
  border: 1px solid #ddd; cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.tag-filter-chip:hover { border-color: #aaa; }
.tag-filter-chip.active { background: #3D8E9E; color: #fff; border-color: transparent; }

/* --- Tag toggle in modal ------------------------------------------------- */
.tag-chip-toggle {
  display: inline-block; font-size: 11px; padding: 4px 10px;
  border-radius: 12px; border: 1px solid #ddd; cursor: pointer; transition: all 0.15s;
  margin: 2px;
}
.tag-chip-toggle:hover { border-color: #aaa; }
.tag-chip-toggle.active { color: #fff; border-color: transparent; }
.job-tags-edit { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }

/* --- Tag "+" button in modal --------------------------------------------- */
.tag-add-btn {
  font-size: 16px !important; font-weight: 600; line-height: 1;
  padding: 2px 10px !important; color: #888 !important; border-style: dashed !important;
}
.tag-add-btn:hover { color: #3D8E9E !important; border-color: #3D8E9E !important; }

/* --- Inline tag creation form -------------------------------------------- */
.tag-create-form {
  margin-top: 10px; padding: 12px; border: 1px solid #e0e0e0;
  border-radius: 10px; background: #fafafa;
}
.tag-name-input {
  width: 100%; padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 13px; margin-bottom: 8px; box-sizing: border-box;
}
.tag-name-input:focus { outline: none; border-color: #3D8E9E; }
.tag-color-picker { display: flex; gap: 8px; margin-bottom: 10px; }
.tag-color-dot {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.15s;
}
.tag-color-dot.selected { border-color: #333; box-shadow: 0 0 0 2px #fff inset; }
.tag-color-dot:hover { opacity: 0.85; }
.tag-form-actions { display: flex; gap: 8px; }
.btn-sm { font-size: 12px; padding: 4px 14px; }
.btn-outline { background: #fff; border: 1px solid #ccc; border-radius: 6px; cursor: pointer; }
.btn-outline:hover { border-color: #999; }

/* --- Tag management section (dashboard) ---------------------------------- */
.tag-manage-details { margin-bottom: 12px; }
.tag-manage-details summary {
  cursor: pointer; font-size: 13px; color: #3D8E9E; font-weight: 500;
  padding: 4px 0; user-select: none;
}
.tag-manage-details summary:hover { text-decoration: underline; }
.tag-manage-body { padding: 8px 0; }
.tag-manage-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.tag-manage-chip {
  display: inline-flex; align-items: center; gap: 4px;
  color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 12px;
}
.tag-delete-x {
  cursor: pointer; font-size: 14px; font-weight: 700; opacity: 0.7;
  margin-left: 2px; line-height: 1;
}
.tag-delete-x:hover { opacity: 1; }

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
