:root {
    --bg: #0b1220;
    --sidebar: #0f172a;
    --panel: #111827;
    --panel-soft: #1e293b;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --blue: #2563eb;
    --cyan: #0891b2;
    --green: #15803d;
    --orange: #b45309;
    --red: #991b1b;
    --purple: #6d28d9;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #1e293b 0, #0b1220 38%, #050816 100%);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

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

.sidebar {
    width: 230px;
    background: rgba(15, 23, 42, 0.96);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 22px;
}

.brand-icon {
    font-size: 24px;
}

.brand-title {
    font-size: 22px;
    font-weight: bold;
}

.brand-title span,
.login-card h1 span {
    color: #38bdf8;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    color: var(--text);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 15px;
}

.menu-item:hover {
    background: #1e293b;
}

.menu-item.active {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    font-weight: bold;
}

.sidebar-footer {
    margin-top: auto;
    color: var(--muted);
    font-size: 12px;
    padding: 12px 8px;
}

.footer-title {
    color: var(--text);
    font-weight: bold;
    margin-bottom: 4px;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 62px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(12px);
}

.global-search {
    flex: 1;
    max-width: 720px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
}

.global-search input {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--text);
    outline: none;
    font-size: 14px;
}

.user-box {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #334155;
    display: grid;
    place-items: center;
    font-weight: bold;
}

.user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-text small {
    color: var(--muted);
}

.logout {
    color: #bfdbfe;
    font-size: 13px;
    text-decoration: none;
}

.content {
    padding: 18px;
    overflow: auto;
}

h1 {
    margin: 0 0 18px;
    font-size: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat-card {
    border-radius: 10px;
    padding: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    min-height: 100px;
}

.stat-card.blue { background: linear-gradient(135deg, #1e3a8a, #1e293b); }
.stat-card.green { background: linear-gradient(135deg, #14532d, #1e293b); }
.stat-card.orange { background: linear-gradient(135deg, #7c2d12, #1e293b); }
.stat-card.red { background: linear-gradient(135deg, #7f1d1d, #1e293b); }
.stat-card.cyan { background: linear-gradient(135deg, #155e75, #1e293b); }
.stat-card.purple { background: linear-gradient(135deg, #4c1d95, #1e293b); }

.stat-title {
    color: #dbeafe;
    font-weight: bold;
    font-size: 14px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-top: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.panel {
    background: rgba(17, 24, 39, 0.88);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.20);
}

.panel h2 {
    margin-top: 0;
    font-size: 18px;
}

.task-row,
.activity {
    border-top: 1px solid var(--border);
    padding: 12px 0;
}

.task-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.task-row small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.badge {
    border-radius: 5px;
    padding: 4px 7px;
    font-size: 11px;
    font-weight: bold;
}

.badge.red { background: #991b1b; }
.badge.orange { background: #b45309; }

.search-row {
    display: grid;
    grid-template-columns: 1fr 160px 180px 130px;
    gap: 10px;
    margin: 15px 0;
}

.search-row input,
.search-row button {
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 10px;
    font-size: 14px;
}

.search-row input {
    background: #0f172a;
    color: var(--text);
}

.search-row button {
    background: var(--blue);
    color: #fff;
    border: 0;
    font-weight: bold;
}

.placeholder-table {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 100px 140px 180px 220px 140px 140px;
    min-width: 920px;
}

.table-header {
    background: #1e293b;
    font-weight: bold;
}

.table-header span,
.table-row span {
    padding: 11px;
    border-right: 1px solid var(--border);
}

.table-row {
    background: #0f172a;
}

.empty-panel {
    min-height: 220px;
}

/* Login */
.login-body {
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(420px, 100%);
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 28px 60px rgba(0,0,0,.35);
}

.login-logo {
    font-size: 42px;
}

.login-card h1 {
    font-size: 30px;
    margin-bottom: 4px;
}

.login-card p {
    color: var(--muted);
}

.login-card label {
    display: block;
    margin-top: 15px;
    margin-bottom: 6px;
    color: #cbd5e1;
    font-weight: bold;
}

.login-card input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #020617;
    color: var(--text);
    font-size: 16px;
}

.login-card button {
    width: 100%;
    margin-top: 18px;
    padding: 12px;
    border-radius: 8px;
    border: 0;
    background: var(--blue);
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

.login-error {
    background: #7f1d1d;
    color: #fecaca;
    padding: 10px;
    border-radius: 8px;
    margin: 12px 0;
}

.login-help {
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
}

/* Mobile */
@media (max-width: 820px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .menu {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .topbar {
        height: auto;
        flex-direction: column;
        align-items: stretch;
    }

    .user-box {
        margin-left: 0;
    }

    .stats-grid,
    .dashboard-grid,
    .search-row {
        grid-template-columns: 1fr;
    }
}
