:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #eff6ff;
    --white: #ffffff;
    --bg: #f8fbff;
    --sidebar: #1e40af;
    --sidebar-dark: #1d4ed8;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbeafe;
    --shadow: 0 10px 30px rgba(37, 99, 235, 0.12);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, Arial, sans-serif;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: var(--white);
    position: fixed;
    inset: 0 auto 0 0;
    padding: 24px 18px;
    box-shadow: var(--shadow);
}

.brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.4px;
    margin-bottom: 24px;
    color: var(--white);
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 12px;
    color: #dbeafe;
    transition: 0.2s ease;
}

.nav a:hover,
.nav a.active {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
}

.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.title h1 {
    margin: 0;
    font-size: 28px;
    color: var(--blue-dark);
}

.title p {
    margin: 6px 0 0;
    color: var(--muted);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0 26px;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--blue);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: 22px;
    margin-bottom: 12px;
}

.stat {
    font-size: 30px;
    font-weight: 800;
    margin-top: 8px;
    color: var(--blue-dark);
}

.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.panel h2 {
    margin: 0 0 16px;
    color: var(--blue-dark);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 12px;
    border: 0;
    background: linear-gradient(180deg, var(--blue), var(--blue-dark));
    color: var(--white);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.btn.secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.table-wrap {
    overflow: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    background: var(--blue-soft);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--blue-dark);
}

tr:hover td {
    background: #f8fbff;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

label {
    font-weight: 600;
    color: var(--blue-dark);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    font: inherit;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.textarea {
    min-height: 110px;
    resize: vertical;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--blue-dark);
}

.muted {
    color: var(--muted);
}

.login-hero {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 16px;
    background: var(--blue-soft);
    border: 1px solid #dbeafe;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--blue-soft);
    color: var(--blue-dark);
}

@media (max-width: 1100px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .layout {
        display: block;
    }

    .card-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
}