:root {
    --page: #f4f7fb;
    --surface: #ffffff;
    --ink: #172033;
    --muted: #64748b;
    --line: #d9e0ea;
    --blue: #2563eb;
    --green: #15803d;
    --red: #dc2626;
    --sidebar: #111827;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2,
h3,
.sidebar-brand {
    font-family: "DM Sans", system-ui, sans-serif;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}

.auth-card {
    width: min(430px, 100%);
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .09);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-card h1 {
    margin: 0 0 20px;
    font-size: 2.3rem;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    transition: grid-template-columns .2s ease;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px;
    color: #e5e7eb;
    background: var(--sidebar);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    font-weight: 700;
}

.brand-mark,
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #fff;
    border-radius: 999px;
    font-weight: 700;
}

.brand-mark {
    background: var(--blue);
}

.sidebar-menu {
    display: grid;
    gap: 6px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    color: #cbd5e1;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

.menu-icon {
    display: inline-flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 700;
}

.menu-label {
    white-space: nowrap;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.main-area {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1.15rem;
}

.topbar-title p,
.topbar-title h1 {
    margin: 0;
}

.topbar-title p {
    color: var(--muted);
    font-size: .82rem;
}

.topbar-title h1 {
    font-size: 1.35rem;
}

.user-menu {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.content {
    padding: 24px;
}

.card-panel {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

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

.metric-card {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric-card span {
    color: var(--muted);
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

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

.action-card {
    display: grid;
    gap: 8px;
    min-height: 132px;
    padding: 18px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
}

.action-card:hover {
    border-color: var(--blue);
    box-shadow: 0 14px 32px rgba(37, 99, 235, .12);
}

.action-card span {
    color: var(--blue);
    font-size: 1.1rem;
    font-weight: 700;
}

.action-card strong {
    color: var(--muted);
    font-weight: 500;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    transform: translateY(-50%);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.password-toggle.is-visible {
    color: var(--blue);
}

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

.full-span {
    grid-column: 1 / -1;
}

.sidebar-collapsed .dashboard-layout {
    grid-template-columns: 82px 1fr;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .menu-label {
    font-size: 0;
}

.sidebar-collapsed .sidebar-menu a {
    justify-content: center;
    padding: 0;
}

@media (max-width: 820px) {
    .dashboard-layout,
    .sidebar-collapsed .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 30;
        width: 260px;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

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

    .metric-grid,
    .action-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .user-name {
        display: none;
    }
}
