:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-soft: #f8f9fc;
    --sidebar: #020b2b;
    --sidebar-border: #162041;
    --text: #111827;
    --muted: #6b7280;
    --line: #e7ebf0;
    --brand: #f7c600;
    --brand-ink: #0c0d0f;
    --danger: #e53e3e;
    --warning: #dd9b00;
    --success: #1da750;
    --progress: #2563eb;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 252px;
    background: var(--sidebar);
    color: #9fb0d2;
    border-right: 1px solid var(--sidebar-border);
    padding: 16px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.25s ease;
}

.sidebar-brand-wrap {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #ffffff;
    padding: 12px 10px;
    flex-wrap: nowrap;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--brand);
    color: #000;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.brand-text {
    font-size: 19px;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 28px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    padding: 12px 14px;
    color: #9fb0d2;
    font-weight: 600;
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: #111c40;
    color: #ffffff;
}

.nav-item.active {
    background: var(--brand);
    color: #0b0b0c;
}

.sidebar-session {
    margin-top: auto;
    background: #0f1a3a;
    border: 1px solid #1e2b54;
    border-radius: 12px;
    padding: 14px;
    position: relative;
}

.session-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #8498c3;
}

.session-value {
    margin-top: 8px;
    color: #fff;
    font-weight: 700;
}

.session-toggle {
    position: absolute;
    right: 10px;
    bottom: 12px;
    border: 0;
    background: transparent;
    color: #c2cee9;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-topbar {
    height: 78px;
    border-bottom: 1px solid #dce3ec;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.search-box {
    width: min(520px, 48vw);
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #f3f5f8;
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: #8994a8;
}

.search-box.narrow {
    width: min(420px, 100%);
}

.search-box input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding-left: 10px;
    color: #334155;
}

.search-box input:focus {
    background: transparent;
    box-shadow: none;
}

.icon-btn {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #667085;
    padding: 0;
}

.icon-btn i {
    width: 18px;
    height: 18px;
}

.mobile-sidebar-toggle {
    display: none;
}

.notif-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--brand);
    position: absolute;
    right: 12px;
    top: 11px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 14px;
    border-left: 1px solid var(--line);
}

.user-meta {
    display: grid;
    line-height: 1.1;
}

.user-meta strong {
    font-size: 16px;
    font-weight: 700;
}

.user-meta span {
    font-size: 12px;
    letter-spacing: 0.07em;
    color: #6b7280;
}

.user-avatar,
.mini-avatar,
.person-avatar,
.client-logo {
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #edf1f7;
    font-size: 13px;
}

.app-content {
    padding: 34px 28px;
}

.page-title {
    font-size: clamp(1.8rem, 2vw, 2.8rem);
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 1.35rem;
}

.page-subtitle i {
    width: 16px;
    height: 16px;
    vertical-align: -2px;
    margin-right: 4px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.kpi-card,
.panel,
.person-card,
.kanban-column,
.security-note {
    background: var(--surface);
    border: 1px solid #e3e8ef;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.kpi-card {
    padding: 22px;
}

.kpi-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 12px;
    color: #6f7d97;
    margin-bottom: 8px;
    font-weight: 700;
}

.kpi-value {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-danger {
    color: var(--danger);
}

.kpi-meta {
    color: #8a95a6;
    font-weight: 500;
    margin-bottom: 0;
}

.panel {
    padding: 0;
    overflow: hidden;
}

.panel-head {
    padding: 22px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
}

.chip {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    border-radius: 999px;
    background: #eef3f9;
    color: #67768f;
    font-size: 12px;
    letter-spacing: 0.08em;
    font-weight: 700;
    padding: 6px 10px;
    text-transform: uppercase;
}

.app-table {
    margin-bottom: 0;
}

.app-table thead th {
    border-bottom-width: 1px;
    border-color: var(--line);
    color: #6f7d97;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 12px;
    font-weight: 700;
    background: #f8fafc;
    padding: 14px 18px;
}

.app-table tbody td {
    padding: 18px;
    border-color: var(--line);
    font-size: 15px;
}

.table-person {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-avatar {
    width: 28px;
    height: 28px;
    background: #eef2f7;
    font-size: 12px;
}

.status-badge {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    text-transform: uppercase;
}

.status-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-review,
.status-warning {
    background: #fef3c7;
    color: #a16207;
}

.status-pending,
.status-neutral {
    background: #e5e7eb;
    color: #4b5563;
}

.status-done {
    background: #d1fae5;
    color: #047857;
}

.priority-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.priority-dot .dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #9ca3af;
}

.tone-high .dot {
    background: #ef4444;
}

.tone-medium .dot {
    background: #f59e0b;
}

.tone-low .dot {
    background: #9ca3af;
}

.btn-brand,
.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand);
    color: #0f1115;
    border: 1px solid #e4b700;
    font-weight: 700;
    border-radius: 12px;
    height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-light-outline {
    border: 1px solid #d8dee8;
    background: #fff;
    color: #273247;
    font-weight: 600;
    border-radius: 12px;
    height: 42px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-dark-pill {
    background: #090909;
    border: 0;
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
    min-height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-soft {
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
    min-height: 38px;
    font-weight: 600;
    color: #1f2937;
}

.segmented,
.view-switch {
    display: inline-flex;
    align-items: center;
    border-radius: 14px;
    padding: 4px;
    background: #e7ebf0;
}

.segmented button,
.view-switch button {
    border: 0;
    background: transparent;
    min-height: 36px;
    border-radius: 10px;
    padding: 0 16px;
    color: #5b6475;
    font-weight: 700;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.segmented button.active,
.view-switch button.active {
    background: #fff;
    color: #0f172a;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.person-card {
    padding: 22px;
}

.person-card h3 {
    margin: 12px 0 4px;
    font-size: 31px;
    font-weight: 800;
}

.person-avatar,
.client-logo {
    width: 52px;
    height: 52px;
    background: #e8edf5;
    color: #0f172a;
    font-size: 18px;
}

.muted {
    color: #596579;
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 0;
}

.badge-soft {
    background: #edf2f8;
    border-radius: 999px;
    padding: 3px 10px;
    font-weight: 700;
}

.progress {
    height: 8px;
    border-radius: 99px;
    background: #ecf0f5;
}

.progress-bar.high {
    background: #ef4444;
}

.progress-bar.medium {
    background: #f59e0b;
}

.progress-bar.low {
    background: #22c55e;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(280px, 1fr));
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.kanban-column {
    padding: 14px;
    background: #f8fafd;
    min-height: 540px;
}

.kanban-column > header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.kanban-column h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.state-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #9ca3af;
}

.state-dot.danger {
    background: #ef4444;
}

.state-dot.progress {
    background: #2563eb;
}

.state-dot.warning {
    background: #f59e0b;
}

.kanban-column .count {
    background: #edf2f7;
    border-radius: 999px;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
}

.task-card,
.task-empty {
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
}

.task-code {
    color: #71829b;
    font-weight: 700;
    font-size: 13px;
}

.task-card h4 {
    font-size: 23px;
    line-height: 1.3;
    margin: 10px 0 14px;
    font-weight: 800;
}

.task-meta small {
    text-transform: uppercase;
    color: #8b96a8;
    letter-spacing: 0.08em;
    font-size: 11px;
}

.task-meta strong {
    display: block;
    font-size: 14px;
    margin-top: 4px;
}

.task-meta p {
    margin: 8px 0 0;
    color: #738195;
    font-size: 13px;
}

.kanban-add {
    border: 0;
    width: 100%;
    border-radius: 10px;
    min-height: 38px;
    background: transparent;
    color: #738195;
    font-weight: 700;
}

.task-empty {
    border-style: dashed;
    color: #9aa5b8;
    text-transform: uppercase;
    text-align: center;
    min-height: 90px;
    display: grid;
    place-items: center;
    font-weight: 700;
}

@media (max-width: 1400px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .people-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .app-sidebar {
        position: fixed;
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .mobile-sidebar-toggle {
        display: grid;
    }

    .app-topbar {
        padding: 0 16px;
    }

    .search-box {
        width: min(460px, 54vw);
    }

    .app-content {
        padding: 22px 16px;
    }

    .user-meta {
        display: none;
    }
}

@media (max-width: 768px) {
    .kpi-grid,
    .people-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        width: 100%;
    }

    .topbar-left {
        flex: 1;
    }

    .app-table {
        min-width: 760px;
    }

    .page-subtitle {
        font-size: 1rem;
    }
}
