/* ==========================================
   Style CSS — Components & Views
   ========================================== */

/* ── Login View ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  animation: fadeSlideUp .5s ease both;
}

.login-header {
  padding: 36px 40px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-header img { height: 40px; width: auto; }

.login-header-text h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .03em;
}

.login-header-text .subtitle {
  font-size: .72rem;
  font-weight: 300;
  color: var(--ink-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 1px;
}

.login-body {
  padding: 32px 40px;
}

.login-body h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--ink-muted);
  font-size: .78rem;
  font-weight: 300;
}

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

.login-features {
  list-style: none;
  padding: 0;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.login-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.login-footer {
  padding: 14px 40px;
  background: var(--parchment);
  border-top: 1px solid var(--card-border);
  text-align: center;
  font-size: .72rem;
  color: var(--ink-muted);
  font-weight: 300;
  letter-spacing: .06em;
}

/* ── Form Styles ── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: var(--radius-lg);
  font-size: .9rem;
  font-family: var(--font-body);
  background: var(--parchment);
  color: var(--ink);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
  height: 42px;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder {
  color: var(--ink-muted);
  font-weight: 300;
}

.form-row-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-dim);
  cursor: pointer;
}

.form-link {
  font-size: .82rem;
  color: var(--gold-dim);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.form-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 28px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: .9rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: .02em;
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  width: 100%;
}

.btn-primary:hover { background: #2a2a2a; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #bbb; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.btn-gold:hover { background: var(--gold-dim); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(0,0,0,.1);
}

.btn-outline:hover { border-color: var(--gold-dim); color: var(--gold-dim); }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.btn-success:hover { background: #1f5f3d; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-danger:disabled { background: #bbb; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sm {
  padding: 7px 16px;
  font-size: .82rem;
}

/* ── Dropzone ── */
.dropzone {
  position: relative;
  border: 2px dashed rgba(0,0,0,.14);
  border-radius: var(--radius);
  padding: 40px 24px 32px;
  text-align: center;
  cursor: pointer;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  background: var(--parchment);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
}

.dropzone:hover {
  border-color: var(--gold-dim);
  background: var(--gold-glow);
}

.dropzone.dragover {
  border-color: var(--gold);
  background: var(--gold-glow);
  transform: scale(1.005);
  box-shadow: 0 0 0 4px var(--gold-glow), var(--shadow-md);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-glow);
  border-radius: 50%;
  transition: transform .3s ease;
}

.dropzone:hover .dropzone-icon { transform: translateY(-2px); }

.dropzone-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--gold-dim);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone-label { font-size: .95rem; color: var(--ink-soft); }
.dropzone-label strong { font-weight: 600; color: var(--ink); }
.dropzone-hint { font-size: .78rem; color: var(--ink-muted); font-weight: 300; }

/* ── File List ── */
.file-list { list-style: none; margin-top: 16px; }

.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: .85rem;
  border-radius: var(--radius-lg);
  background: var(--parchment);
  margin-bottom: 4px;
}

.file-list li .file-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.file-list li .file-icon svg { width: 16px; height: 16px; stroke: var(--gold-dim); fill: none; stroke-width: 1.8; }
.file-list li .file-name { flex: 1; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li .file-size { color: var(--ink-muted); font-size: .75rem; font-weight: 300; flex-shrink: 0; }

.file-remove {
  color: var(--ink-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-size: .75rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all .15s ease;
  font-family: var(--font-body);
}

.file-remove:hover { color: var(--danger); background: var(--danger-bg); }

.file-list li .file-status {
  font-size: .72rem;
  font-weight: 500;
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}
.file-list li .file-status.waiting { color: var(--ink-muted); }
.file-list li .file-status.uploading { color: var(--gold-dim); }
.file-list li .file-status.done { color: var(--success); }
.file-list li .file-status.error { color: var(--danger); }
.file-list li.uploading { background: var(--gold-glow); }
.file-list li.done { background: var(--success-bg); }
.file-list li.error { background: var(--danger-bg); }

.file-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transition: width .3s ease;
}
.file-list li { position: relative; overflow: hidden; }

/* ── Progress ── */
.progress-area { margin-top: var(--spacing-lg); display: none; }

.progress-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.progress-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--parchment-deep);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.progress-text { font-size: .9rem; color: var(--ink-soft); }
.error-text { color: var(--danger); font-weight: 600; }

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--parchment-deep);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width .5s cubic-bezier(.4,0,.2,1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
  animation: shimmer 1.8s ease infinite;
}

.progress-detail { font-size: .78rem; color: var(--ink-muted); font-weight: 300; }

/* ── Flatpickr overrides ── */
.flatpickr-calendar { font-family: var(--font-body); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--card-border); }
.flatpickr-day.selected { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.flatpickr-day.selected:hover { background: var(--gold-dim); border-color: var(--gold-dim); }
.flatpickr-day:hover { background: var(--gold-glow); border-color: var(--gold-glow); }
.flatpickr-months .flatpickr-month { height: 40px; }
.flatpickr-current-month { font-size: .9rem; }
.flatpickr-current-month .numInputWrapper { display: inline-flex; align-items: center; }
.flatpickr-roc-prefix, .flatpickr-roc-suffix { font-size: .85rem; color: var(--ink-soft); pointer-events: none; flex-shrink: 0; }
.flatpickr-roc-prefix { margin-right: 2px; }
.flatpickr-roc-suffix { margin-left: 2px; }

.progress-logs {
  margin-top: 12px;
  max-height: 160px;
  overflow-y: auto;
  background: var(--ink);
  color: #b8b8b8;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: .72rem;
  line-height: 1.6;
}

.progress-logs:empty { display: none; }

.progress-logs .log-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.progress-logs .log-line::before {
  content: '>';
  color: var(--gold-dim);
  margin-right: 8px;
  font-weight: 600;
}

.progress-logs::-webkit-scrollbar { width: 4px; }
.progress-logs::-webkit-scrollbar-track { background: transparent; }
.progress-logs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* ── Results ── */
.results-area { display: none; animation: fadeSlideUp .5s ease both; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--spacing-lg);
  padding: 20px var(--spacing-lg);
  background: var(--success-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(39,113,74,.1);
}

.result-summary { font-size: .88rem; color: var(--success); font-weight: 500; }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: .82rem;
}

th, td {
  padding: 9px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,.04);
}

th {
  background: var(--parchment);
  font-weight: 600;
  font-size: .75rem;
  color: var(--ink-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--gold-glow); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

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

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

.stat-label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

.stat-change {
  font-size: .75rem;
  font-weight: 500;
  margin-top: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Admin Users ── */
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-row-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--parchment-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 600;
}

.role-badge.admin {
  background: var(--gold-glow);
  color: var(--gold-dim);
  border: 1px solid rgba(237,195,72,.3);
}

.role-badge.user {
  background: var(--parchment-deep);
  color: var(--ink-muted);
  border: 1px solid var(--card-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--ink-muted); }

/* ── Alert Banner ── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: var(--spacing-lg);
  animation: fadeSlideDown .3s ease both;
}

.alert-banner.warning {
  background: var(--warning-bg);
  border: 1px solid rgba(184,134,11,.15);
  color: var(--warning);
}

.alert-banner.success {
  background: var(--success-bg);
  border: 1px solid rgba(39,113,74,.1);
  color: var(--success);
}

.alert-banner svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.alert-banner .alert-text {
  flex: 1;
  font-size: .88rem;
  font-weight: 500;
}

.alert-banner .alert-action {
  font-size: .82rem;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
}

/* ── Inline Alert Banner (login/verify forms) ── */
.alert-banner-inline {
  display: none;
  font-size: .85rem;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
}

.alert-banner-inline-error {
  display: block;
  color: var(--danger);
  background: var(--danger-bg);
}

.alert-banner-inline-success {
  display: block;
  color: var(--success);
  background: var(--success-bg);
}

/* ── Form Hint & Error ── */
.form-hint {
  font-size: .75rem;
  color: var(--ink-muted);
  font-weight: 300;
  margin-top: 4px;
}

.form-error {
  font-size: .75rem;
  color: var(--danger);
  font-weight: 500;
  margin-top: 4px;
  min-height: 1em;
}

/* ── Verified / Unverified Badges ── */
.verified-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(39,113,74,.15);
}

.unverified-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(184,134,11,.15);
}

/* ── User Row (Admin table) ── */
.user-row-name {
  font-weight: 500;
  color: var(--ink);
  font-size: .82rem;
}

.user-row-email {
  font-size: .72rem;
  color: var(--ink-muted);
  font-weight: 300;
}

.confirm-danger-text { color: var(--danger); font-weight: 500; }

.table-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--ink-muted);
  font-size: .88rem;
}

.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Button Icon ── */
.btn-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn .2s ease;
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeSlideUp .3s ease both;
}

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--ink);
}

.modal-body {
  padding: 24px;
}

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

/* ── Sidebar History Items ── */
.sidebar-history-empty {
  padding: 8px 16px;
  font-size: .75rem;
  color: var(--ink-muted);
  font-weight: 300;
}

.sidebar-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 16px;
  font-size: .78rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.sidebar-history-item:hover {
  background: var(--gold-glow);
}

.sidebar-history-item-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.sidebar-history-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
}

.sidebar-history-item-date {
  font-size: .72rem;
  color: var(--ink-muted);
  font-weight: 300;
  flex-shrink: 0;
}

.sidebar-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .02em;
  flex-shrink: 0;
}

.status-badge-done {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge-processing {
  background: var(--gold-glow);
  color: var(--gold-dim);
}

.status-badge-error {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ── Job Status Badges (Dashboard Table) ── */
.job-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 600;
}

.job-status-done {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(39,113,74,.15);
}

.job-status-processing {
  background: var(--gold-glow);
  color: var(--gold-dim);
  border: 1px solid rgba(237,195,72,.3);
}

.job-status-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(192,57,43,.15);
}

.job-action-text {
  font-size: .78rem;
  color: var(--ink-muted);
  font-weight: 400;
}

.job-action-error {
  color: var(--danger);
}

/* ── Transcript Form Layout ── */
.transcript-form-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.transcript-form-date {
  margin-bottom: 0;
}

.transcript-submit-btn {
  width: auto;
}

/* ── Results Table Headers ── */
.results-table-header {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
  margin-top: 4px;
}

.results-table-wrap {
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Folder Grid (Dashboard) ── */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

.folder-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  animation: fadeSlideUp .5s ease both;
}

.folder-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-glow);
}

.folder-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.folder-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold-dim);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.folder-card-body {
  flex: 1;
  min-width: 0;
}

.folder-card-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.folder-card-meta {
  font-size: .75rem;
  color: var(--ink-muted);
  font-weight: 300;
}

.folder-default-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: .68rem;
  font-weight: 600;
  background: var(--gold-glow);
  color: var(--gold-dim);
  border: 1px solid rgba(237,195,72,.3);
}

.folder-grid-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
}

.folder-grid-empty-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.folder-grid-empty-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--ink-muted);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.folder-grid-empty-text {
  font-size: .9rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 4px;
}

.folder-grid-empty-hint {
  font-size: .78rem;
  color: var(--ink-muted);
  font-weight: 300;
}

/* ── Folder Detail ── */
.folder-job-group {
  margin-bottom: var(--spacing-lg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.folder-job-group-highlight {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow), var(--shadow-sm);
  overflow: hidden;
  animation: fadeSlideUp .5s ease both;
}

.folder-job-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--spacing-lg);
  background: var(--parchment);
  border-bottom: 1px solid var(--card-border);
  font-size: .82rem;
}

.folder-job-date {
  font-weight: 600;
  color: var(--ink);
}

.folder-job-file-count {
  font-size: .75rem;
  color: var(--ink-muted);
  font-weight: 300;
}

.folder-job-counts {
  font-size: .75rem;
  color: var(--gold-dim);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.folder-job-resume-btn {
  margin-left: auto;
  margin-left: auto;
}

.folder-name-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: .68rem;
  font-weight: 600;
  background: var(--parchment-deep);
  color: var(--ink-soft);
  border: 1px solid var(--card-border);
}

.folder-file-list {
  padding: 0;
}

.folder-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--spacing-lg);
  border-bottom: 1px solid rgba(0,0,0,.03);
  font-size: .82rem;
  transition: background var(--transition-fast);
}

.folder-file-row:last-child { border-bottom: none; }
.folder-file-row:hover { background: var(--gold-glow); }
.folder-file-row.selected { background: rgba(237,195,72,.1); }

.folder-file-check {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.folder-file-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-dim);
  cursor: pointer;
}

.folder-file-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.folder-file-icon-svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.folder-file-icon-pdf { stroke: var(--danger); }
.folder-file-icon-excel { stroke: var(--success); }

.folder-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
}

.folder-file-link {
  color: var(--ink);
  text-decoration: none;
  transition: color .2s ease;
}

.folder-file-link:hover {
  color: var(--gold-dim);
  text-decoration: underline;
}

.land-page-link {
  color: var(--ink);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: color .2s ease;
}

.land-page-link:hover {
  color: var(--gold-dim);
  text-decoration: underline;
}

.folder-file-size {
  font-size: .75rem;
  color: var(--ink-muted);
  font-weight: 300;
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.folder-file-type {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-muted);
  flex-shrink: 0;
  min-width: 40px;
}

.folder-file-author {
  font-size: .75rem;
  color: var(--ink-muted);
  font-weight: 300;
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

.folder-file-download {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: .72rem;
}

/* ── Folder Empty State ── */
.folder-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  text-align: center;
}

.folder-empty-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.folder-empty-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--ink-muted);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.folder-empty-text {
  font-size: .9rem;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ── Delete Confirmation Modal ── */
.delete-confirm-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--warning-bg);
  border: 1px solid rgba(184,134,11,.15);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  font-size: .88rem;
  color: var(--warning);
  line-height: 1.5;
}

.delete-confirm-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.delete-confirm-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--warning);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Sidebar Folder Items ── */
.sidebar-folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: .78rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.sidebar-folder-item:hover {
  background: var(--gold-glow);
}

.sidebar-folder-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-folder-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--gold-dim);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-folder-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-folder-default-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.sidebar-folder-item-count {
  font-size: .68rem;
  color: var(--ink-muted);
  font-weight: 500;
  background: var(--parchment-deep);
  padding: 1px 6px;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* ── Form Required ── */
.form-required {
  color: var(--danger);
  font-weight: 600;
}

/* ── Card Header with actions ── */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Transcript Form Folder Selector ── */
.transcript-form-folder {
  margin-bottom: 0;
}

.folder-create-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.folder-create-inline .form-input {
  flex: 1;
  min-width: 120px;
  width: auto;
}

.folder-create-inline .btn {
  flex-shrink: 0;
  width: auto;
  height: 42px;
  white-space: nowrap;
}

.folder-create-inline .input-error {
  border-color: var(--danger);
}

.folder-create-inline .input-error::placeholder {
  color: var(--danger);
}

/* ── Workspace Actions ── */
.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Router Error ── */
.router-error {
  padding: 20px;
  color: var(--danger);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Toast Notification ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  font-family: var(--font-body);
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: var(--success);
  color: #fff;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

/* ── Folder Card Dropdown ── */
.folder-card-menu-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: 1px;
  transition: background .2s ease;
}

.folder-card-menu-btn:hover {
  background: var(--parchment-deep);
  color: var(--ink-soft);
}

.folder-card.dropdown-open {
  z-index: 101;
}

.folder-card-dropdown {
  position: absolute;
  top: 36px;
  right: 8px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  min-width: 160px;
  z-index: 100;
  padding: 4px 0;
  animation: fadeSlideUp .15s ease both;
}

.folder-card-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: .82rem;
  font-family: var(--font-body);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s ease;
}

.folder-card-dropdown-item:hover {
  background: var(--gold-glow);
}

.folder-card-dropdown-item.disabled {
  color: var(--ink-muted);
  cursor: not-allowed;
}

.folder-card-dropdown-item.disabled:hover {
  background: none;
}

.folder-card-dropdown-item.danger {
  color: var(--danger);
}

.folder-card-dropdown-item.danger:hover {
  background: rgba(192, 57, 43, .08);
}

.folder-card-dropdown-item.danger.disabled {
  color: var(--ink-muted);
}

.folder-card-dropdown-item.danger.disabled:hover {
  background: none;
}

.folder-card-name-input {
  font-size: .9rem;
  font-weight: 600;
  padding: 2px 8px;
  height: auto;
  width: 100%;
}

.modal-confirm-text {
  margin: 0;
  font-size: .9rem;
  color: var(--ink-soft);
}

/* ── PDF Viewer ── */
.pdf-viewer-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  max-width: none;
}

.pdf-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card);
  flex-shrink: 0;
}

.pdf-viewer-filename {
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.pdf-viewer-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.pdf-viewer-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pdf-viewer-nav-btn {
  padding: 4px 8px;
}

.pdf-viewer-page-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .82rem;
  color: var(--ink-soft);
  margin: 0 4px;
}

.pdf-viewer-page-input {
  width: 48px;
  padding: 3px 6px;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  font-size: .82rem;
  text-align: center;
  background: var(--parchment);
  color: var(--ink);
  -moz-appearance: textfield;
}

.pdf-viewer-page-input::-webkit-outer-spin-button,
.pdf-viewer-page-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pdf-viewer-page-input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.pdf-viewer-page-sep {
  color: var(--ink-muted);
}

.pdf-viewer-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--card-border);
}

.pdf-viewer-zoom-label {
  font-size: .82rem;
  color: var(--ink-soft);
  min-width: 40px;
  text-align: center;
}

.pdf-viewer-search-hint {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 24px;
  background: var(--gold-glow);
  border-bottom: 1px solid rgba(237, 195, 72, .3);
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.pdf-page-container {
  position: relative;
  box-shadow: var(--shadow-md);
}

.pdf-page-container canvas {
  display: block;
}

.pdf-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 0.3;
  line-height: 1;
}

.pdf-text-layer span {
  position: absolute;
  white-space: pre;
  color: transparent;
  pointer-events: all;
}

.pdf-text-layer span::selection {
  background: rgba(0, 0, 255, 0.3);
}

.pdf-highlight {
  background: rgba(255, 215, 0, 0.6);
  color: transparent;
  border-radius: 2px;
  padding: 2px 0;
}

.pdf-viewer-canvas-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  background: var(--parchment-deep);
  padding: 16px;
}

.pdf-viewer-canvas-wrap canvas {
  box-shadow: var(--shadow-md);
}

/* ── Super Admin ── */
.subscribe-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.subscribe-badge.contract {
  background: var(--gold-glow);
  color: var(--gold-dim);
  border: 1px solid rgba(237, 195, 72, .3);
}

.subscribe-badge.free {
  background: var(--parchment-deep);
  color: var(--ink-muted);
  border: 1px solid var(--card-border);
}

.usage-bar-wrap {
  width: 80px;
  height: 6px;
  background: var(--parchment-deep);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.usage-bar {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width .3s ease;
}

.usage-bar.warning {
  background: var(--gold);
}

.usage-bar.danger {
  background: var(--danger);
}

.usage-text {
  font-size: .75rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.org-row-name {
  font-weight: 600;
  color: var(--ink);
  font-size: .85rem;
}

.org-row-link {
  text-decoration: none;
  transition: color .2s ease;
}

.org-row-link:hover {
  color: var(--gold-dim);
  text-decoration: underline;
}

.org-row-taxid {
  font-size: .72rem;
  color: var(--ink-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .login-body { padding: 24px 20px; }
  .login-header { padding: 24px 20px 0; }
  .login-footer { padding: 12px 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal-card { max-width: calc(100% - 32px); margin: 16px; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .folder-file-row { gap: 8px; padding: 8px var(--spacing-md); }
  .folder-file-author { display: none; }
  .folder-file-type { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .folder-grid { grid-template-columns: 1fr; }
  .folder-file-size { display: none; }
  .folder-job-header { flex-wrap: wrap; }
}

/* ── Usage / Contract Block Screen ── */
.usage-block-body {
  text-align: center;
  padding: 48px 32px;
}

.usage-block-icon {
  margin-bottom: 16px;
}

.usage-block-title {
  color: var(--danger);
  font-family: var(--font-display);
  margin-bottom: 12px;
}

.usage-block-detail {
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.usage-block-hint {
  color: var(--ink-muted);
  font-size: .85rem;
}
