
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #102a43;
    --blue: #2563eb;
    --red: #e63946;
    --bg: #f3f6fb;
    --text: #243447;
    --muted: #718096;
    --border: #e2e8f0;
    --white: #fff;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

button, input, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
}

.admin-layout {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 245px;
    flex-shrink: 0;
    background: var(--navy);
    color: white;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 27px;
    font-weight: 800;
    padding: 0 12px 30px;
}

.brand span {
    color: #ff6570;
}

.admin-label {
    font-size: 10px;
    letter-spacing: 1.2px;
    color: #9fb3c8;
    padding: 0 12px 15px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-link {
    display: block;
    text-decoration: none;
    color: #d7e1ec;
    padding: 13px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: #244765;
    color: white;
}

.nav-link.active {
    border-left: 3px solid #ff6570;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid #304b64;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Main */
.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    min-height: 82px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    gap: 15px;
}

.topbar h3 {
    color: var(--navy);
    font-size: 19px;
    margin-bottom: 4px;
}

.topbar small {
    color: var(--muted);
    font-size: 12px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: bold;
}

.menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--navy);
}

.page-content {
    padding: 30px;
    max-width: 1600px;
    margin: auto;
}

.page {
    display: none;
}

.page.active-page {
    display: block;
}

.welcome,
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 25px;
}

.welcome h2,
.page-heading h2 {
    color: var(--navy);
    font-size: 25px;
    margin-bottom: 6px;
}

.welcome p,
.page-heading p {
    color: var(--muted);
    font-size: 13px;
}

/* Buttons */
.btn {
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.2s;
}

.primary {
    background: var(--blue);
    color: white;
}

.primary:hover {
    background: #1d4ed8;
}

.outline {
    background: white;
    border-color: #cbd5e1;
    color: var(--navy);
}

.outline:hover {
    background: #eff6ff;
}

.light {
    background: #edf2f7;
    color: var(--text);
}

.danger {
    background: #fff1f2;
    color: #be123c;
}

.danger:hover {
    background: #ffe4e6;
}

/* Statistics */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.stat-card h2 {
    font-size: 32px;
    color: var(--navy);
    margin: 12px 0 7px;
}

.stat-card small {
    font-size: 11px;
    color: #718096;
}

/* Panels and tables */
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 25px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.panel-heading h3 {
    color: var(--navy);
    font-size: 17px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    background: #f8fafc;
    text-align: left;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

th, td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

td {
    font-size: 13px;
}

tbody tr:hover {
    background: #f8fafc;
}

.badge {
    display: inline-block;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
}

.published {
    background: #dcfce7;
    color: #166534;
}

.draft {
    background: #fef3c7;
    color: #92400e;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Forms */
.form-panel {
    max-width: 1000px;
}

.form-panel label,
.panel > label {
    display: block;
    color: #334155;
    font-weight: 600;
    margin: 18px 0 8px;
    font-size: 13px;
}

.form-panel label:first-child {
    margin-top: 0;
}

input, textarea, select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 12px;
    background: white;
    color: var(--text);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.toolbar input {
    max-width: 400px;
}

.toolbar select {
    max-width: 200px;
}

.inline-form {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.inline-form input {
    flex: 1;
}

.muted {
    color: var(--muted);
    font-size: 12px;
    margin-top: 15px;
    line-height: 1.6;
}

/* Media and roles */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.media-item {
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 6px;
    overflow: hidden;
}

.media-item img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
    margin-bottom: 10px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 25px;
}

.role-card {
    border: 1px solid var(--border);
    background: #f8fafc;
    padding: 20px;
    border-radius: 7px;
}

.role-card h3 {
    color: var(--navy);
    margin-bottom: 10px;
}

.role-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* Responsive */
@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.25s;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-btn {
        display: block;
    }

    .topbar {
        padding: 14px;
        justify-content: flex-start;
    }

    .admin-profile {
        margin-left: auto;
    }

    .admin-profile span {
        display: none;
    }

    .page-content {
        padding: 18px 12px;
    }

    .welcome,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats {
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card h2 {
        font-size: 27px;
    }

    .panel {
        padding: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .toolbar {
        flex-direction: column;
    }

    .toolbar input,
    .toolbar select {
        max-width: none;
    }

    .inline-form {
        flex-direction: column;
    }
}

@media (max-width: 380px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .welcome h2,
    .page-heading h2 {
        font-size: 22px;
    }
}





.login-card {
    max-width: 420px;
    margin: 9vh auto;
    padding: 32px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(16, 42, 67, .08);
}

.login-card h1 {
    color: #102a43;
    margin-bottom: 24px;
}

.login-card h1 span {
    color: #e63946;
}

.login-card h2 {
    margin-bottom: 20px;
}

.login-card label {
    display: block;
    margin: 16px 0 7px;
}

.login-card button {
    width: 100%;
    margin-top: 22px;
}

.error {
    background: #fff1f2;
    color: #be123c;
    padding: 12px;
    border-radius: 5px;
}




.notice {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    background: #dcfce7;
    color: #166534;
}
.actions form {
    display: inline-flex;
}