:root {
    --alk: #5b47f5;
    --alk-dark: #4634d4;
    --alk-deep: #171a26;
    --alk-deep-2: #1f2333;
    --ink: #1c2030;
    --muted: #6b7280;
    --line: #e6e8ef;
    --bg: #f5f6fa;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--ink);
}

/* ---- Navegação lateral ---- */
.sidebar {
    min-height: 100vh;
    background-color: var(--alk-deep);
    padding-top: 1rem;
    flex-shrink: 0;
    width: 240px;
}

/* Permite que a coluna de conteúdo encolha e que o overflow-x das tabelas e
   dos blocos de código funcione, em vez de esticar a linha flex e comprimir
   a barra lateral. */
.flex-grow-1 { min-width: 0; }

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.72);
    padding: 0.62rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.93rem;
    border-left: 3px solid transparent;
}
.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.06);
}
.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(91, 71, 245, 0.22);
    border-left-color: var(--alk);
}
.sidebar .nav-link i { width: 18px; text-align: center; font-size: 1rem; }

.sidebar-section {
    color: rgba(255, 255, 255, 0.34);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1.1rem 1.15rem 0.35rem;
}

.sidebar-brand {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.25rem 1.15rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    letter-spacing: -0.01em;
}
.sidebar-brand small {
    display: block;
    font-size: 0.63rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.top-bar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 1.5rem;
}

/* ---- Cartões ---- */
.card { border: 1px solid var(--line); border-radius: 10px; }
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: 0.95rem;
}

.stat-card { border: none; border-radius: 10px; }
.stat-card .stat-value { font-size: 1.85rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: 0.82rem; opacity: 0.86; }

/* ---- Botões e cores da marca ---- */
.btn-alk { background-color: var(--alk); border-color: var(--alk); color: #fff; }
.btn-alk:hover, .btn-alk:focus { background-color: var(--alk-dark); border-color: var(--alk-dark); color: #fff; }
.btn-outline-alk { border-color: var(--alk); color: var(--alk); }
.btn-outline-alk:hover { background-color: var(--alk); color: #fff; }
.text-alk { color: var(--alk) !important; }
.bg-alk { background-color: var(--alk) !important; }
.bg-alk-deep { background-color: var(--alk-deep) !important; }

/* ---- Estados do vídeo ---- */
.status-badge { font-size: 0.72rem; padding: 0.3em 0.6em; font-weight: 600; }
.status-ready { background-color: #13795b; }
.status-processing { background-color: #b45309; }
.status-queued { background-color: #4b5563; }
.status-uploading { background-color: #1d4ed8; }
.status-awaiting_upload { background-color: #6b7280; }
.status-failed { background-color: #b91c1c; }
.status-deleting { background-color: #7c2d12; }

/* ---- Grade de vídeos ---- */
.video-card { transition: box-shadow .15s, transform .15s; cursor: pointer; height: 100%; }
.video-card:hover { box-shadow: 0 6px 18px rgba(20, 22, 35, .1); transform: translateY(-2px); }
.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #11131c center/cover no-repeat;
    border-radius: 9px 9px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-thumb .placeholder-icon { color: rgba(255,255,255,.28); font-size: 2rem; }
.video-duration {
    position: absolute; right: 6px; bottom: 6px;
    background: rgba(0,0,0,.78); color: #fff;
    font-size: .72rem; padding: 1px 6px; border-radius: 3px;
    font-variant-numeric: tabular-nums;
}
.video-title {
    font-size: .92rem; font-weight: 600; margin: 0 0 .2rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.3;
}
.video-meta { font-size: .78rem; color: var(--muted); }

/* Barra de progresso do transcode dentro do cartão */
.progress-thin { height: 4px; border-radius: 2px; }
.progress-thin .progress-bar { background-color: var(--alk); }

/* ---- Chaves e trechos de código ---- */
.api-key-text {
    font-family: 'Cascadia Code', Consolas, monospace;
    font-size: 0.8rem;
    word-break: break-all;
    background: #f2f3f8;
    padding: 0.5rem 0.65rem;
    border-radius: 5px;
    border: 1px solid var(--line);
}
pre.snippet {
    background: var(--alk-deep);
    color: #e4e6ef;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    overflow-x: auto;
    margin: 0;
}
pre.snippet .tk-str { color: #a5e075; }
pre.snippet .tk-key { color: #7fc7ff; }
pre.snippet .tk-cmt { color: #7a8194; }

/* ---- Medidores de cota ---- */
.quota-bar { height: 7px; border-radius: 4px; background: #e6e8ef; overflow: hidden; }
.quota-fill { height: 100%; background: var(--alk); transition: width .3s; }
.quota-fill.warn { background: #d97706; }
.quota-fill.danger { background: #dc2626; }

.table-sm td, .table-sm th { vertical-align: middle; }
.table > :not(caption) > * > * { padding: 0.55rem 0.6rem; }

/* Área de arrastar e soltar do upload */
.dropzone {
    border: 2px dashed #c9cddc;
    border-radius: 10px;
    padding: 2.4rem 1rem;
    text-align: center;
    background: #fafbfe;
    transition: border-color .15s, background .15s;
    cursor: pointer;
}
.dropzone.hover { border-color: var(--alk); background: #f3f1ff; }
.dropzone i { font-size: 2rem; color: var(--alk); }

/* Curva de retenção */
.retention-chart { display: flex; align-items: flex-end; gap: 1px; height: 130px; }
.retention-chart .bar {
    flex: 1;
    background: linear-gradient(to top, var(--alk), #8b7cf8);
    border-radius: 1px 1px 0 0;
    min-height: 1px;
}
