:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #141518;
    --muted: #6b7280;
    --accent: #111214;
    --positive: #0f9d58;
    --border: #e5e7ef;
    --shadow: 0 16px 40px rgba(17, 18, 20, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background: var(--bg);
}

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

.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 32px 24px;
}

.brand-title {
    font-size: 24px;
    font-weight: 800;
}

.brand-subtitle {
    color: var(--muted);
    margin-top: 4px;
    font-size: 14px;
}

.menu {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    text-decoration: none;
    color: var(--text);
    padding: 12px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.menu-item:hover {
    background: #f0f2f7;
}

.menu-item.is-active {
    background: var(--accent);
    color: #fff;
}

.menu-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-icon svg {
    width: 20px;
    height: 20px;
}

.menu-divider {
    border-top: 1px solid var(--border);
    margin: 10px 0;
}

.logout button {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
    padding: 0;
}

.content {
    flex: 1;
    padding: 40px 48px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.card-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.card {
    background: var(--card);
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(17, 18, 20, 0.04);
}

.card-title {
    color: var(--muted);
    font-size: 14px;
}

.card-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 12px;
}

.card-note {
    color: var(--muted);
    margin-top: 6px;
}

.positive {
    color: var(--positive);
}

.split {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.panel {
    background: var(--card);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-top: 24px;
    box-shadow: 0 12px 32px rgba(17, 18, 20, 0.05);
}

.panel h2 {
    margin-top: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 13px;
    color: var(--muted);
}

.badge {
    padding: 4px 8px;
    background: #f2f3f5;
    border-radius: 999px;
    font-size: 12px;
}

.badge.dark {
    background: #111214;
    color: #fff;
}

.link {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}

.muted {
    color: var(--muted);
}

.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.auth-card {
    background: var(--card);
    padding: 32px;
    border-radius: 18px;
    border: 1px solid var(--border);
    width: 360px;
}

.auth-card h1 {
    margin-top: 0;
}

.auth-card form p {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-card input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.primary {
    margin-top: 16px;
    width: 100%;
    padding: 10px 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.empty-state {
    padding: 30px;
    background: var(--bg);
    border-radius: 16px;
    border: 1px dashed var(--border);
    text-align: center;
}

.empty-title {
    font-weight: 600;
}

.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.header-chip {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--muted);
}

.list-panel {
    margin-top: 24px;
    background: var(--card);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 18px;
    box-shadow: 0 12px 32px rgba(17, 18, 20, 0.05);
}

.list-panel h2 {
    margin: 0 0 16px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    margin-bottom: 12px;
}

.list-item:last-child {
    margin-bottom: 0;
}

.list-item-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.list-item-subtitle {
    color: var(--muted);
    font-size: 13px;
}

.list-item-value {
    font-size: 22px;
    font-weight: 700;
}

.insights {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.insight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--bg);
}

.insight span {
    color: var(--muted);
    font-size: 13px;
}

.menu-item.logout-button {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
}

.menu-item.logout-button:hover {
    background: #f7f7fa;
}

@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 24px 20px;
    }

    .menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .menu-item {
        flex: 1 1 200px;
    }

    .content {
        padding: 28px 20px 40px;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .split {
        grid-template-columns: 1fr;
    }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .table th,
    .table td {
        padding: 10px 6px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        padding: 20px 16px;
    }

    .menu-item {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .content {
        padding: 24px 16px 32px;
    }

    .page-header p {
        font-size: 14px;
    }

    .card {
        padding: 16px;
    }

    .panel,
    .list-panel {
        padding: 16px;
    }

    .table {
        min-width: 520px;
    }
}
