body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f3f5f9;
    color: #202124;
}

body.sidebar-open {
    overflow: hidden;
}

a {
    color: #1a73e8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 40px;
}

.admin-shell {
    min-height: 100vh;
    display: flex;
    background: #f3f5f9;
}

.admin-page {
    flex: 1;
    max-width: none;
    margin: 0;
    padding: 32px 24px 40px 264px;
    box-sizing: border-box;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #d8dde6;
    padding: 24px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    z-index: 1200;
}

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

.sidebar-link {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: #202124;
    font-weight: 700;
    text-decoration: none;
    background: #f5f6f8;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #e8edf5;
    text-decoration: none;
}

.sidebar-link-danger {
    background: #d93025;
    color: #ffffff;
}

.sidebar-link-danger:hover {
    background: #b3261e;
    color: #ffffff;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: #111111;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    z-index: 1300;
}

.sidebar-overlay {
    display: none;
}

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

.brand {
    font-size: 28px;
    font-weight: 700;
}

.muted {
    color: #6f7278;
}

.card {
    background: #ffffff;
    border: 1px solid #d8dde6;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

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

.flash {
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 600;
    margin-bottom: 18px;
}

.flash-success {
    background: #e8f4ea;
    color: #1c6b2f;
    border: 1px solid #b9dec0;
}

.flash-error {
    background: #fdecea;
    color: #b9382d;
    border: 1px solid #efc0bb;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

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

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid #cfd5df;
    background: #ffffff;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 10px;
    border: 0;
    background: #1a73e8;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary {
    background: #e8edf5;
    color: #202124;
}

.btn-danger {
    background: #d64545;
}

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

.btn-row-nowrap {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.btn-row-nowrap .btn {
    white-space: nowrap;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-box {
    background: #ffffff;
    border: 1px solid #d8dde6;
    border-radius: 14px;
    padding: 18px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    margin-top: 8px;
}

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

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

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e6eaf0;
    vertical-align: top;
    white-space: nowrap;
}

th {
    color: #6f7278;
    font-size: 14px;
    white-space: nowrap;
}

.tag {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.tag-active {
    background: #e8f4ea;
    color: #1c6b2f;
}

.tag-inactive {
    background: #fdecea;
    color: #b9382d;
}

.login-shell {
    max-width: 420px;
    margin: 60px auto;
}

body.admin-login-page {
    min-height: 100vh;
}

body.admin-login-page .page {
    max-width: none;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

body.admin-login-page .login-shell {
    width: min(100%, 420px);
    max-width: 420px;
    margin: 0;
}

.login-card {
    width: 100%;
    padding: 28px 24px 24px;
    overflow: hidden;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 158px;
    margin-bottom: 20px;
    overflow: hidden;
}

.login-logo {
    max-width: 100%;
    max-height: 150px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.password-shell {
    position: relative;
}

.password-shell input {
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #202124;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}

.btn-login-dark {
    background: #111111;
    color: #ffffff;
}

.btn-login-dark:hover {
    background: #000000;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.page-header h2,
.page-header p {
    margin: 0;
}

.delete-modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1500;
}

.delete-modal.open {
    display: flex;
}

.delete-modal-card {
    width: min(100%, 420px);
    background: #ffffff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 40px rgba(17, 24, 39, 0.18);
}

@media (max-width: 900px) {
    .admin-page {
        padding: 88px 16px 28px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, 0.28);
        z-index: 1100;
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }
}
