/*
 * NurLisan — application styles
 */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; font-size: 14px; }

/* ── App shell ── */
.app-body  { background: #0f0f0f; color: #e0e0e0; min-height: 100vh; }
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 220px; min-height: 100vh;
  background: #141414; border-right: 1px solid #222;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: 0.05em;
  border-bottom: 1px solid #222;
}
.sidebar-nav { list-style: none; padding: 12px 0; flex: 1; }
.sidebar-nav li { margin: 2px 8px; }
.nav-link {
  display: block; padding: 9px 14px; border-radius: 7px;
  color: #888; text-decoration: none; font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover  { background: #1e1e1e; color: #ddd; }
.nav-link.active { background: #1e3a5f; color: #93c5fd; font-weight: 600; }

/* ── Sub-nav group (Presentasi) ── */
.nav-group { margin: 2px 8px; }
.nav-group-label {
  display: block; padding: 9px 14px 3px;
  font-size: 0.7rem; color: #444; text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 600;
}
.nav-subnav { list-style: none; }
.nav-subnav li { margin: 1px 0; }
.nav-link--sub { padding-left: 26px; }
.nav-link.disabled {
  display: block; border-radius: 7px;
  font-size: 0.875rem; color: #2e2e2e; cursor: default;
  padding: 9px 14px;
}
.nav-link--sub.disabled { padding-left: 26px; }
.nav-live-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; margin-right: 7px; vertical-align: middle;
  animation: blink 1.5s ease-in-out infinite;
}

.sidebar-divider { height: 1px; background: #222; margin: 8px 20px; }
.sidebar-nav--super { padding: 4px 0 12px; }
.sidebar-nav--super .nav-link {
  color: #6366f1; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.sidebar-nav--super .nav-link:hover  { background: #1e1b3a; color: #a5b4fc; }
.sidebar-nav--super .nav-link.active { background: #1e1b3a; color: #a5b4fc; }

.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid #222;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-user { font-size: 0.82rem; color: #ccc; font-weight: 600; }
.sidebar-role { font-size: 0.75rem; color: #555; text-transform: capitalize; margin-bottom: 8px; }
.btn-logout {
  background: none; border: 1px solid #333; border-radius: 6px;
  color: #666; cursor: pointer; font-size: 0.8rem; padding: 6px; width: 100%;
  transition: border-color 0.15s, color 0.15s;
}
.btn-logout:hover { border-color: #555; color: #aaa; }

/* ── Main content ── */
.main-content { flex: 1; padding: 32px 36px; overflow-y: auto; }
.page-title   { font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.page-subtitle { font-size: 0.85rem; color: #555; margin-bottom: 24px; }

/* ── Flash messages ── */
.flash { border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: 0.875rem; }
.flash-notice { background: #0d2b1a; border: 1px solid #166534; color: #86efac; }
.flash-alert  { background: #2b0d0d; border: 1px solid #991b1b; color: #fca5a5; }

/* ── Stat cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px; padding: 20px; }
.stat-label { font-size: 0.72rem; color: #666; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: #fff; }

/* ── Live badge ── */
.badge-live {
  display: inline-flex; align-items: center; gap: 6px;
  background: #1a0a0a; border: 1px solid #991b1b;
  border-radius: 20px; padding: 3px 12px;
  font-size: 0.75rem; font-weight: 700; color: #ef4444; text-transform: uppercase;
}
.badge-live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444; animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Cards ── */
.card { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 0.78rem; font-weight: 600; color: #666; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Buttons ── */
.btn { display: inline-block; border-radius: 8px; padding: 9px 18px; font-size: 0.875rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: opacity 0.15s; }
.btn:hover     { opacity: 0.85; }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-danger    { background: #7f1d1d; color: #fca5a5; border: 1px solid #991b1b; }
.btn-ghost     { background: transparent; color: #aaa; border: 1px solid #333; }
.btn-tv        { background: #0f3460; color: #93c5fd; border: 1px solid #1e3a5f; }
.btn-sm        { padding: 6px 12px; font-size: 0.8rem; }
.btn-pause     { background: #1c1c1c; color: #facc15; border: 1px solid #3a3200; border-radius: 8px; padding: 9px 16px; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.btn-pause.paused { background: #14290a; color: #86efac; border-color: #166534; }

/* ── Forms ── */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; font-size: 0.78rem; color: #888; margin-bottom: 6px; }
.form-input  { width: 100%; background: #111; border: 1px solid #333; border-radius: 8px; color: #fff; font-size: 0.9rem; padding: 9px 13px; outline: none; }
.form-input:focus { border-color: #2563eb; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { text-align: left; padding: 8px 12px; color: #555; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #222; }
.data-table td { padding: 11px 12px; color: #ccc; border-bottom: 1px solid #1a1a1a; }
.data-table tr:hover td { background: #1c1c1c; }
.data-table a { color: #60a5fa; text-decoration: none; }
.data-table a:hover { text-decoration: underline; }

/* ── Auth page ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0a0a0a; }
.auth-box { background: #141414; border: 1px solid #222; border-radius: 14px; padding: 40px; width: 100%; max-width: 400px; }
.auth-title { font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 28px; text-align: center; }
.auth-box label { display: block; font-size: 0.78rem; color: #888; margin-bottom: 5px; margin-top: 14px; }
.auth-box input[type=email], .auth-box input[type=password] { width: 100%; background: #111; border: 1px solid #333; border-radius: 8px; color: #fff; font-size: 0.9rem; padding: 9px 13px; outline: none; }
.auth-box input:focus { border-color: #2563eb; }
.auth-box input[type=submit] { margin-top: 22px; width: 100%; background: #2563eb; color: #fff; border: none; border-radius: 8px; padding: 11px; font-size: 0.95rem; font-weight: 600; cursor: pointer; }

/* ── Recording / Live panel ── */
.live-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.live-timer  { font-size: 1.5rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; margin-left: auto; }
.recording-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; }
.dot        { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: blink 1.2s ease-in-out infinite; }
.dot.idle   { background: #555; animation: none; }
.dot.paused { background: #facc15; animation: none; }

/* ── Chunk entries ── */
.chunk-list  { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.chunk-entry { background: #111; border: 1px solid #222; border-radius: 10px; padding: 14px 16px; }
.chunk-entry.done  { border-color: #1e3a5f; }
.chunk-entry.error { border-color: #3b1a1a; }
.chunk-meta    { font-size: 0.72rem; color: #444; margin-bottom: 8px; display: flex; gap: 10px; }
.chunk-keyword { display: inline-block; background: #1e3a5f; border-radius: 5px; padding: 2px 8px; font-size: 0.8rem; color: #93c5fd; margin-bottom: 6px; }
.chunk-id    { color: #fff; font-size: 0.9rem; line-height: 1.5; margin-top: 4px; }
.chunk-ms    { font-size: 0.9rem; color: #a3baa3; margin-top: 4px; font-style: italic; }
.chunk-result { margin-top: 10px; padding-top: 10px; border-top: 1px solid #1a1a1a; }

/* ── Filter bar (kosa kata, presentasi) ── */
.filter-bar  { display: flex; flex-direction: column; gap: 12px; }
.filter-row  { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.filter-label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Sentence breakdown table (live_presentation operator view) ── */
.chunk-raw { font-size: 0.875rem; color: #5a6a7a; margin-bottom: 8px; font-style: italic; }
.sentence-table { display: flex; flex-direction: column; gap: 4px; }
.sentence-row {
  display: flex; gap: 8px; align-items: flex-start;
  background: #0d1117; border: 1px solid #1e2a38; border-radius: 6px; padding: 8px 10px;
}
.sentence-row.sentence-incomplete { border-color: #3a2a0a; background: #0f0c04; }
.sentence-num {
  min-width: 18px; font-size: 0.68rem; color: #2a4a6a; font-weight: 700;
  padding-top: 2px; text-align: right; flex-shrink: 0;
}
.sentence-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sentence-lisan { font-size: 0.78rem; color: #6b8aaa; font-style: italic; }
.sentence-id { font-size: 0.85rem; color: #c8d8e8; }
.sentence-pending { font-size: 0.78rem; color: #a0700a; font-style: italic; }

/* Stage timeline */
.chunk-stages  { display: flex; flex-direction: column; gap: 3px; }
.chunk-stage   { display: flex; justify-content: space-between; align-items: baseline;
                 font-size: 0.78rem; padding: 2px 0; color: #555; }
.chunk-stage.stage-active { color: #93c5fd; }
.chunk-stage.stage-done   { color: #444; }
.stage-elapsed { font-size: 0.7rem; color: #333; white-space: nowrap; margin-left: 8px; }
.stage-detail  { font-size: 0.75rem; color: #4b5563; font-style: italic;
                 display: block; margin-top: 1px; white-space: nowrap;
                 overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
