.admin-body {
    background: #f4f7fb;
}

.admin-container {
    width: min(1240px, calc(100% - 34px));
    margin-inline: auto;
}

.admin-login-shell {
    min-height: 100vh;
    padding: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #10182c, #12354a);
}

.admin-login-card {
    width: min(440px, 100%);
    padding: 30px;
    border-radius: 22px;
    background: white;
    box-shadow: 0 25px 70px rgba(0,0,0,.25);
}

.admin-logo {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: #05b985;
    font-size: 25px;
}

.admin-login-card h1 {
    margin-bottom: 5px;
}

.admin-login-card > p {
    margin-top: 0;
    color: #64748b;
}

.admin-login-form {
    display: grid;
    gap: 15px;
}

.admin-login-form label,
.dialog-content label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    font-weight: 750;
}

.admin-login-form input,
.dialog-content input,
.dialog-content textarea,
.dialog-content select {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    outline: 0;
}

.admin-login-form button,
.admin-primary-button,
.dialog-footer button:last-child {
    padding: 12px 17px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: #059669;
    font-weight: 800;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #dfe5ec;
    background: rgba(255,255,255,.96);
}

.admin-header-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-brand {
    color: #172036;
    font-weight: 850;
    text-decoration: none;
}

.logout-button {
    padding: 9px 13px;
    border: 0;
    border-radius: 9px;
    color: #475569;
    background: #edf1f5;
    font-weight: 750;
}

.admin-main {
    padding-block: 40px 80px;
}

.admin-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.admin-title-row > div > span {
    color: #078969;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .1em;
}

.admin-title-row h1,
.admin-title-row h2 {
    margin: 5px 0 0;
}

.admin-title-row h1 {
    font-size: 40px;
}

.admin-alert {
    margin: 20px 0;
    padding: 13px 15px;
    border-radius: 11px;
}

.admin-alert.success {
    color: #06634b;
    background: #e9fbf5;
    border: 1px solid #a9ead5;
}

.admin-alert.error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.admin-alert p {
    margin: 3px 0;
}

.admin-search {
    margin: 25px 0 18px;
}

.admin-search input {
    width: min(500px, 100%);
    padding: 12px 14px;
    border: 1px solid #dfe5ec;
    border-radius: 11px;
    outline: 0;
}

.admin-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}

.admin-product-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #dfe5ec;
    border-radius: 16px;
    background: white;
    box-shadow: 0 5px 15px rgba(15,23,42,.06);
}

.admin-product-card.is-hidden {
    opacity: .68;
    border-style: dashed;
}

.admin-product-head {
    min-height: 135px;
    padding: 15px;
    color: white;
    background: linear-gradient(
        145deg,
        var(--theme-a),
        var(--theme-b)
    );
}

.admin-product-head > span {
    font-size: 23px;
}

.admin-product-head > small {
    float: right;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.17);
}

.admin-product-head h2 {
    margin: 18px 0 2px;
    font-size: 20px;
}

.admin-product-head p {
    margin: 0;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.admin-product-body {
    padding: 13px;
}

.admin-product-body code {
    color: #64748b;
    font-size: 11px;
}

.admin-tier-list {
    margin-top: 10px;
    display: grid;
    gap: 5px;
}

.admin-tier-list > div {
    padding: 7px 8px;
    display: flex;
    justify-content: space-between;
    border-radius: 8px;
    background: #f7f9fc;
    font-size: 11px;
}

.admin-product-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.admin-product-actions form {
    margin: 0;
}

.admin-product-actions button {
    width: 100%;
    min-height: 37px;
    padding: 8px;
    border: 0;
    border-radius: 9px;
    font-weight: 800;
}

.edit-product-button {
    color: white;
    background: #111a30;
}

.toggle-button {
    color: #92400e;
    background: #fef3c7;
}

.delete-button {
    color: #b91c1c;
    background: #fee2e2;
}

.admin-product-actions form:last-child {
    grid-column: 1 / -1;
}

.orders-manager {
    margin-top: 65px;
}

.table-wrapper {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid #dfe5ec;
    border-radius: 15px;
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px;
    border-bottom: 1px solid #e8edf3;
    text-align: left;
    white-space: nowrap;
}

th {
    color: #64748b;
    background: #f8fafc;
    font-size: 12px;
}

td {
    font-size: 13px;
}

td small {
    display: block;
    color: #64748b;
}

.status-form {
    display: flex;
    gap: 6px;
}

.status-form select,
.status-form button {
    padding: 7px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
}

.status-form button {
    color: white;
    background: #078969;
}

.product-dialog {
    width: min(820px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    border: 0;
    border-radius: 18px;
}

.product-dialog::backdrop {
    background: rgba(9,15,28,.7);
}

.dialog-header,
.dialog-footer {
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dfe5ec;
}

.dialog-header h2 {
    margin: 0;
}

.dialog-header button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    font-size: 22px;
}

.dialog-content {
    padding: 20px;
    display: grid;
    gap: 17px;
}

.admin-field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.tier-manager {
    padding: 15px;
    border: 1px solid #dfe5ec;
    border-radius: 13px;
    background: #f8fafc;
}

.tier-manager-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tier-manager-heading h3 {
    margin: 0;
}

.tier-manager-heading button {
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    color: #047857;
    background: #dff8ef;
    font-weight: 800;
}

.tier-row {
    margin-top: 11px;
    display: grid;
    grid-template-columns: 1fr 1fr 38px;
    align-items: end;
    gap: 9px;
}

.remove-tier-button {
    height: 40px;
    border: 0;
    border-radius: 8px;
    color: #b91c1c;
    background: #fee2e2;
    font-size: 20px;
}

.dialog-footer {
    justify-content: flex-end;
    gap: 9px;
    border-top: 1px solid #dfe5ec;
    border-bottom: 0;
}

.dialog-footer button:first-child {
    padding: 11px 17px;
    border: 0;
    border-radius: 9px;
    color: #475569;
    background: #edf1f5;
}

@media (max-width: 1050px) {
    .admin-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 780px) {
    .admin-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .admin-container {
        width: calc(100% - 20px);
    }

    .admin-product-grid,
    .admin-field-grid {
        grid-template-columns: 1fr;
    }

    .admin-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-primary-button {
        width: 100%;
    }

    .tier-row {
        grid-template-columns: 1fr 1fr 38px;
    }

    .product-dialog {
        width: calc(100% - 10px);
    }
}