:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1c2333;
    --sidebar-fg: #c7cedb;
}

body {
    background: #f4f6f9;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    padding: 1rem 0.75rem;
    z-index: 1030;
    transition: transform .2s ease;
}
.sidebar .brand {
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    padding: .25rem .5rem;
}
.sidebar .brand-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #0d6efd;
    font-size: 1.1rem;
}
.sidebar .nav-link {
    color: var(--sidebar-fg);
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: 8px;
    margin-bottom: 2px;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: #0d6efd; color: #fff; }
.sidebar .nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-user {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: .75rem;
    color: #fff;
}
.avatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #3b4a66;
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    flex-shrink: 0;
}

.topbar {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid #e3e6ea;
    z-index: 1020;
}

.main-content {
    padding: 1.5rem;
}
body.with-sidebar .main-content {
    margin-left: var(--sidebar-width);
}
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.4); }
    body.with-sidebar .main-content { margin-left: 0; padding: 1rem; }
}

/* ---------- Auth page ---------- */
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1c2333 0%, #0d6efd 100%);
}
body.auth-page .main-content {
    width: 100%;
    max-width: 420px;
}

/* ---------- Generic ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.page-header h1 { font-size: 1.45rem; margin: 0; font-weight: 600; }
.card { border: 1px solid #e6e9ee; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; }
.table-sheet th a { color: inherit; text-decoration: none; }
.table-sheet th a:hover { text-decoration: underline; }
.table-sheet td { vertical-align: middle; }
.table-sheet .form-select-sm { min-width: 120px; }
.domain-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- Kanban ---------- */
.kanban {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
}
.kanban-column {
    flex: 0 0 280px;
    background: #e9edf2;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 170px);
}
.kanban-column-header {
    padding: .75rem .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid transparent;
}
.kanban-column[data-color="secondary"] .kanban-column-header { border-color: #6c757d; }
.kanban-column[data-color="info"]      .kanban-column-header { border-color: #0dcaf0; }
.kanban-column[data-color="success"]   .kanban-column-header { border-color: #198754; }
.kanban-column[data-color="warning"]   .kanban-column-header { border-color: #ffc107; }
.kanban-column[data-color="danger"]    .kanban-column-header { border-color: #dc3545; }
.kanban-column[data-color="dark"]      .kanban-column-header { border-color: #212529; }
.kanban-column[data-color="light"]     .kanban-column-header { border-color: #adb5bd; }
.kanban-cards {
    padding: .6rem;
    overflow-y: auto;
    min-height: 80px;
    flex: 1;
}
.kanban-column.drag-over .kanban-cards { background: rgba(13,110,253,.08); border-radius: 0 0 10px 10px; }
.kanban-card {
    background: #fff;
    border-radius: 8px;
    padding: .65rem .75rem;
    margin-bottom: .6rem;
    border: 1px solid #dde2e8;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
    cursor: default;
}
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.dragging { opacity: .5; }
.kanban-card .domain-name { font-size: .92rem; }
.kanban-card .meta { font-size: .78rem; color: #6c757d; }
.kanban-card .meta i { margin-right: .2rem; }
.kanban-empty { color: #9aa3ad; font-size: .85rem; text-align: center; padding: 1rem 0; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding-left: 1.75rem; padding-bottom: 1rem; border-left: 2px solid #e6e9ee; margin-left: .5rem; }
.timeline li::before {
    content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px;
    border-radius: 50%; background: #0d6efd; border: 2px solid #fff;
}
.timeline li:last-child { border-left-color: transparent; }
.timeline .time { font-size: .78rem; color: #6c757d; }

.filter-bar .form-control, .filter-bar .form-select { min-width: 140px; }
.sortable-ghost { opacity: .4; }
pre.transcript { font-size: .78rem; max-height: 260px; overflow: auto; background: #1c2333; color: #d8dee9; padding: .75rem; border-radius: 8px; }
.table-sheet td:first-child { white-space: nowrap; }
