* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
}

.admin-menu-toggle {
    position: absolute;
    left: -9999px;
}

.admin-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #111827;
    color: #e5e7eb;
    padding: 20px 14px;
    position: relative;
    z-index: 30;
}

.admin-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-sidebar h1 {
    font-size: 18px;
    margin: 0 0 16px;
}

.admin-close-btn {
    display: none;
    font-size: 28px;
    line-height: 1;
    color: #d1d5db;
    cursor: pointer;
}

.admin-sidebar a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: #1f2937;
    color: #fff;
}

.admin-main {
    padding: 22px;
}

.admin-mobile-header {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.admin-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    font-size: 22px;
    cursor: pointer;
}

.admin-mobile-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.admin-overlay {
    display: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.topbar h2 {
    margin: 0;
    font-size: 22px;
}

.small-note {
    color: #6b7280;
    font-size: 13px;
}

.grid-cards {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
}

.card .label {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 8px;
}

.card .value {
    font-weight: 700;
    font-size: 24px;
}

.panel {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
    margin-bottom: 14px;
}

.panel h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    padding: 10px 8px;
    font-size: 13px;
    vertical-align: top;
}

th {
    background: #f9fafb;
    font-size: 12px;
    color: #374151;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    font-size: 12px;
    padding: 3px 8px;
    font-weight: 600;
}

.status-active,
.status-paid,
.status-delivered,
.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-pending,
.status-processing,
.status-shipped {
    background: #fef9c3;
    color: #854d0e;
}

.status-cancelled,
.status-suspended {
    background: #fee2e2;
    color: #991b1b;
}

form.inline {
    display: inline;
}

input,
select,
textarea,
button {
    font: inherit;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
}

textarea {
    min-height: 80px;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    padding: 7px 10px;
    font-size: 12px;
    color: #fff;
    background: #2563eb;
    text-decoration: none;
    display: inline-block;
}

.btn.secondary {
    background: #6b7280;
}

.btn.success {
    background: #16a34a;
}

.btn.warning {
    background: #d97706;
}

.btn.danger {
    background: #dc2626;
}

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.two-col {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.admin-version {
    margin-top: 16px;
    padding: 8px 10px;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 900px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(82vw, 300px);
        height: 100vh;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }

    .admin-close-btn,
    .admin-mobile-header {
        display: flex;
    }

    .admin-main {
        padding: 14px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    th,
    td {
        font-size: 12px;
        padding: 9px 6px;
    }

    .admin-overlay {
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, 0.5);
        z-index: 25;
    }

    .admin-menu-toggle:checked + .admin-shell .admin-sidebar {
        transform: translateX(0);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    }

    .admin-menu-toggle:checked + .admin-shell .admin-overlay {
        display: block;
    }
}

@media (max-width: 520px) {
    .grid-cards {
        grid-template-columns: 1fr;
    }

    .card .value {
        font-size: 22px;
    }
}
