:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #15803d;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --sidebar: #0f172a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #dbeafe, #f8fafc);
}

.auth-card {
    width: min(100%, 420px);
    padding: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
}

.brand {
    margin-bottom: 24px;
    text-align: center;
}

.brand h1 {
    margin: 0 0 6px;
}

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

.form {
    display: grid;
    gap: 10px;
}

.form label {
    margin-top: 8px;
    font-weight: 600;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.form textarea {
    resize: vertical;
    font-family: monospace;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: 3px solid rgba(37, 99, 235, .15);
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-small {
    padding: 7px 10px;
    font-size: .85rem;
}

.btn-full {
    width: 100%;
    margin-top: 15px;
}

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

.alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 8px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

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

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    padding: 24px 15px;
    background: var(--sidebar);
    color: white;
}

.sidebar-logo {
    padding: 0 15px 25px;
    font-size: 20px;
    font-weight: 700;
}

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

.sidebar-nav a {
    padding: 12px 15px;
    border-radius: 8px;
    color: #cbd5e1;
}

.sidebar-nav a:hover {
    background: #1e293b;
    color: white;
}

.sidebar-nav .nav-danger {
    margin-top: 20px;
    color: #fca5a5;
}

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

.dashboard-header {
    min-height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px 28px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px;
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 24px;
}

.page-title h1 {
    margin: 0;
}

.page-title p {
    margin: 5px 0 0;
    color: var(--muted);
}

.card,
.stat-card {
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, .04);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
}

.stat-card strong {
    font-size: 32px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: .9rem;
}

.text-right {
    text-align: right;
}

.inline-form {
    display: inline;
}

.mobile-menu-toggle {
    display: none;
    margin-right: 8px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

@media (max-width: 800px) {
    .sidebar {
        position: fixed;
        z-index: 10;
        top: 0;
        bottom: 0;
        left: -260px;
        transition: left .2s ease;
    }

    .sidebar.is-open {
        left: 0;
    }

    .mobile-menu-toggle {
        display: inline-block;
    }

    .dashboard-header {
        padding: 14px 18px;
    }

    .dashboard-content {
        padding: 18px;
    }

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

    .page-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-user span {
        display: none;
    }
}
/* =========================
   MODERN UI V2
========================= */

:root {
    --radius: 14px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
    --shadow-hover: 0 15px 40px rgba(15, 23, 42, .15);
}

.card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: .25s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

table tbody tr {
    transition: .2s ease;
}

table tbody tr:hover {
    background: rgba(37,99,235,.04);
}

input,
select,
textarea {
    transition: .2s ease;
}

input:focus,
select:focus,
textarea:focus {
    transform: translateY(-1px);
}

.btn {
    transition: .2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

.page-title {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.page-title h1 {
    font-size: 1.8rem;
}

/* Badges */

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Scrollbar */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dark Mode */

body.dark-mode {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
}

body.dark-mode .dashboard-header,
body.dark-mode .card,
body.dark-mode .stat-card {
    background: var(--card);
    color: var(--text);
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #0f172a;
    color: white;
    border-color: #334155;
}

body.dark-mode table tbody tr:hover {
    background: rgba(255,255,255,.05);
}