:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #152033;
    --muted: #758195;
    --border: #e7eaf0;
    --sidebar: #0e1222;
    --sidebar-soft: #171c31;
    --blue: #2f80ed;
    --pink: #ff3f8e;
    --green: #20b26b;
    --yellow: #f4b740;
    --red: #e5484d;
    --purple: #9b51e0;
    --shadow: 0 14px 36px rgba(20, 32, 51, 0.08);
}

* {
    box-sizing: border-box;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

.sidebar {
    width: 275px;
    background: linear-gradient(180deg, var(--sidebar), #11172a);
    color: #fff;
    padding: 22px 18px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 18px;
}

.brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    padding: 5px;
}

.brand strong {
    display: block;
    font-size: 17px;
}

.brand span {
    color: #a8b0c5;
    font-size: 12px;
}

.menu {
    display: grid;
    gap: 7px;
}

.menu a {
    display: block;
    padding: 12px 14px;
    border-radius: 13px;
    color: #cbd2e4;
    font-size: 14px;
    transition: 0.2s;
}

.menu a:hover,
.menu a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(47,128,237,0.28), rgba(255,63,142,0.22));
}

.sidebar-footer {
    margin-top: 26px;
    padding: 16px;
    border-radius: 16px;
    background: var(--sidebar-soft);
}

.sidebar-footer small,
.sidebar-footer strong,
.sidebar-footer a {
    display: block;
}

.sidebar-footer small {
    color: #9ca6bc;
}

.sidebar-footer strong {
    margin: 4px 0 10px;
}

.sidebar-footer a {
    color: #ff8fbd;
    font-size: 14px;
}

.main {
    margin-left: 275px;
    width: calc(100% - 275px);
    padding: 28px;
}

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

.topbar h1 {
    margin: 0 0 5px;
    font-size: 28px;
}

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

.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

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

.search-form input {
    width: 275px;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(90deg, var(--blue), var(--pink));
}

.btn-soft {
    color: var(--blue);
    background: #edf4ff;
}

.btn-danger {
    color: #fff;
    background: var(--red);
}

.grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
}

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

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.stat-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.two-col {
    grid-template-columns: 1.5fr 1fr;
}

.table-card {
    overflow: hidden;
}

.table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.table-head h2 {
    margin: 0;
    font-size: 20px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    color: var(--muted);
    font-weight: 700;
    background: #fafbfe;
}

.badge {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success { color: #0f8a4f; background: #e9f8f0; }
.badge-primary { color: #1f66c2; background: #e9f2ff; }
.badge-warning { color: #a76c00; background: #fff6df; }
.badge-danger { color: #b4232a; background: #ffecef; }
.badge-purple { color: #7f39c6; background: #f3eaff; }
.badge-info { color: #136d8b; background: #e8f8ff; }
.badge-muted { color: #667085; background: #f2f4f7; }

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}

.form-section-title {
    margin: 0 0 16px;
    font-size: 18px;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.alert-success {
    color: #0f8a4f;
    background: #e9f8f0;
}

.alert-danger {
    color: #b4232a;
    background: #ffecef;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top left, rgba(47,128,237,0.25), transparent 32%),
                radial-gradient(circle at bottom right, rgba(255,63,142,0.22), transparent 30%),
                #0e1222;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.32);
}

.login-logo {
    display: block;
    width: 92px;
    height: auto;
    margin: 0 auto 18px;
}

.login-card h1 {
    text-align: center;
    margin: 0 0 7px;
}

.login-card p {
    text-align: center;
    color: var(--muted);
    margin: 0 0 24px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-bar input,
.filter-bar select {
    max-width: 220px;
}

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }
    .layout {
        display: block;
    }
    .main {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }
    .topbar {
        display: block;
    }
    .topbar-actions {
        margin-top: 14px;
        display: block;
    }
    .search-form input {
        width: 100%;
        margin-bottom: 10px;
    }
    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
}
