
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d3333;
  --surface: #0f3d3d;
  --surface2: #1a4444;
  --accent: #7bc144;
  --accent-hover: #6aad38;
  --text: #ffffff;
  --text-muted: #a0b8b8;
  --danger: #e53935;
  --border: #1e5555;
  --radius: 8px;
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Navbar ── */
.navbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.navbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 24px; }
.navbar-brand img { display: block; }
.navbar-links { display: flex; gap: 8px; flex: 1; justify-content: center; }
.nav-link { color: var(--text-muted); text-decoration: none; padding: 6px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; transition: color .2s, background .2s; }
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface2); }
.navbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-name { font-size: 14px; color: var(--text-muted); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: background .2s, opacity .2s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { color: var(--text); border-color: var(--text-muted); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.page-container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 700; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 14px; font-family: inherit; transition: border-color .2s; }
.form-input:focus { outline: none; border-color: var(--accent); }
select.form-input { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.field-error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.hidden-file-input { display: none; }

/* ── Login page ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-title { text-align: center; font-size: 20px; font-weight: 600; margin-bottom: 28px; color: var(--text-muted); }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 10px 14px; color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.empty-row { text-align: center; color: var(--text-muted); padding: 40px !important; }
.actions-cell { display: flex; gap: 8px; align-items: center; }

/* ── Badges ── */
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.role-admin { background: #1b4a1b; color: var(--accent); }
.role-mt { background: #1a2e4a; color: #60a5fa; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-completed { background: #1b4a1b; color: var(--accent); }
.status-failed { background: #4a1b1b; color: var(--danger); }
.status-pending, .status-processing { background: #3a3a1b; color: #f59e0b; }

/* ── Sno. column ── */
.sno-cell { color: var(--text-muted); font-size: 13px; }

/* ── Pagination ── */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 4px; flex-wrap: wrap; gap: 12px; }
.page-info { font-size: 13px; color: var(--text-muted); }
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text-muted); background: var(--surface2); border: 1px solid var(--border); cursor: pointer; transition: background .2s, color .2s; }
.page-btn:hover { background: var(--border); color: var(--text); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
.page-btn.disabled { opacity: .4; cursor: default; pointer-events: none; }
.page-ellipsis { color: var(--text-muted); padding: 0 4px; font-size: 14px; line-height: 34px; }

/* ── Icon buttons ── */
.icon-btn { background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px; border-radius: 4px; transition: opacity .2s; color: inherit; }
.icon-btn:hover { opacity: .7; }
.icon-btn.danger:hover { color: var(--danger); }

/* ── Avatar & dropdown ── */
.avatar-wrap { position: relative; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); border: none; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; letter-spacing: .5px; flex-shrink: 0; }
.avatar-btn:hover { background: var(--accent-hover); }
.avatar-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 175px; z-index: 300; box-shadow: 0 8px 24px rgba(0,0,0,.4); padding: 4px 0; }
.avatar-dropdown a { display: block; padding: 10px 16px; color: var(--text); text-decoration: none; font-size: 14px; }
.avatar-dropdown a:hover { background: var(--surface2); }
.avatar-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── Dashboard stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat-card { text-align: center; padding: 28px 16px; }
.stat-value { font-size: 40px; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: .5px; }
.chart-wrap { max-width: 380px; margin: 0 auto; padding: 16px 0; }

/* ── Clear filter link ── */
.clear-filter-link { font-size: 12px; color: var(--text-muted); text-decoration: underline; cursor: pointer; white-space: nowrap; }
.clear-filter-link:hover { color: var(--text); }

/* ── FAB ── */
.fab { position: fixed; bottom: 32px; right: 32px; width: 56px; height: 56px; background: var(--accent); color: #fff; border-radius: 50%; font-size: 28px; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.4); transition: background .2s, transform .2s; z-index: 50; }
.fab:hover { background: var(--accent-hover); transform: scale(1.08); }

/* ── Filter bar ── */
.filter-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-date-group { display: flex; flex-direction: column; gap: 4px; }
.filter-date-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 500; }
.filter-input { max-width: 220px; }
.filter-select { max-width: 160px; }

/* ── Drop zone ── */
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px 24px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: rgba(123,193,68,.05); }
.drop-zone-icon { font-size: 36px; margin-bottom: 10px; }
.drop-zone-text { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.drop-zone-sub { color: var(--accent); }
.file-info { margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 500; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 28px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-box.modal-lg { max-width: 1080px; }

/* ── Progress bar ── */
.progress-track { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 3px; transition: width .2s; }
.progress-label { font-size: 13px; color: var(--text-muted); text-align: center; }

/* ── Detail page ── */
.detail-meta { margin-bottom: 20px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.meta-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.meta-value { font-size: 15px; font-weight: 500; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); }

/* ── Audio player ── */
.audio-player { display: flex; flex-direction: column; gap: 12px; }
.audio-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.audio-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: var(--radius); cursor: pointer; font-size: 14px; transition: background .2s; }
.audio-btn:hover { background: var(--border); }
.audio-btn.primary { background: var(--accent); border-color: var(--accent); }
.audio-btn.primary:hover { background: var(--accent-hover); }
.audio-progress-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.audio-progress { width: 100%; accent-color: var(--accent); cursor: pointer; }
.audio-time { font-size: 12px; color: var(--text-muted); }
.speed-select { width: auto; min-width: 70px; padding: 6px 10px; }

/* ── Transcript — Inter font, NOT monospace ── */
.transcript-box { width: 100%; min-height: 180px; padding: 16px; background: #0a2828; border: 1px solid var(--border); border-radius: var(--radius); font-family: 'Inter', sans-serif !important; font-size: 15px; line-height: 1.8; color: var(--text); }
.transcript-box.editable { resize: vertical; }
.transcript-box.readonly { cursor: default; overflow-wrap: break-word; }
.transcript-heading { display: inline; font-weight: 700; color: var(--accent); font-size: 15px; letter-spacing: .3px; margin-right: 4px; }
.transcript-actions { margin-top: 12px; display: flex; gap: 10px; }
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; }
.tab-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 18px; border-radius: var(--radius); cursor: pointer; font-size: 14px; transition: all .2s; font-family: inherit; }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Spinner ── */
.processing-state { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px; color: var(--text-muted); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.failed-state { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
