:root {
    --admin-blue: #173b4d;
    --admin-blue-dark: #0d2d3f;
    --admin-blue-soft: #25495b;
    --admin-gold: #cfad3f;
    --admin-bg: #f4f3ef;
    --admin-card: #ffffff;
    --admin-text: #203844;
    --admin-muted: #68767c;
    --admin-border: #dad9d3;
    --admin-shadow: 0 10px 26px rgba(14, 33, 43, .08);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-rendering: geometricPrecision;
}

body {
    margin: 0;
    background: var(--admin-bg);
    color: var(--admin-text);
    font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.admin-app {
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    width: 292px;
    flex-direction: column;
    border-right: 4px solid var(--admin-gold);
    background: var(--admin-blue);
    color: #fff;
    box-shadow: 18px 0 40px rgba(0, 0, 0, .12);
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 30px 26px 24px;
}

.admin-brand {
    color: var(--admin-gold);
    text-transform: uppercase;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 5px;
}

.admin-brand-sub {
    margin-top: 9px;
    color: rgba(255, 255, 255, .78);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.5px;
}

.sidebar-close {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 28px;
    line-height: 1;
}

.admin-nav {
    display: grid;
    gap: 10px;
    padding: 8px 16px;
}

.admin-nav-link {
    display: grid;
    grid-template-columns: 42px 1fr;
    min-height: 58px;
    align-items: center;
    border-radius: 14px;
    padding: 9px 14px;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .1px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.admin-nav-link:hover {
    transform: translateX(2px);
}

.admin-nav-link.logout {
    margin: auto 16px 18px;
    color: rgba(255, 255, 255, .65);
}

.nav-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: currentColor;
}

.nav-icon svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    shape-rendering: geometricPrecision;
}

.admin-content {
    min-height: 100vh;
    padding-left: 292px;
}

.mobile-admin-bar {
    display: none;
}

.admin-main {
    width: min(930px, calc(100% - 42px));
    margin: 0 auto;
    padding: 54px 0 90px;
}

.admin-card {
    margin-bottom: 28px;
    padding: 38px 54px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-card);
    box-shadow: var(--admin-shadow);
}

.admin-section-title {
    color: var(--admin-text);
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 5px;
}

.gold-line {
    height: 2px;
    margin: 14px 0 28px;
    background: var(--admin-gold);
}

.gold-line.short {
    width: 190px;
}

.quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 24px;
    color: var(--admin-muted);
    font-size: 18px;
}

.pill {
    min-height: 46px;
    border: 1px solid #cfcfca;
    border-radius: 11px;
    padding: 0 21px;
    background: #fff;
    color: var(--admin-muted);
    cursor: pointer;
}

.pill.active,
.pill:hover {
    border-color: var(--admin-blue);
    background: var(--admin-blue);
    color: #fff;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 19px;
}

.admin-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 9px;
    color: #58666d;
    font-size: 16px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 54px;
    border: 1.5px solid #d9d8d2;
    border-radius: 11px;
    padding: 14px 18px;
    background: #fff;
    color: #202b30;
    outline: none;
    box-shadow: none;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--admin-gold);
}

input::placeholder,
textarea::placeholder {
    color: #aeb4b7;
}

.item-head,
.item-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 100px 130px 122px 42px;
    gap: 12px;
    align-items: center;
}

.item-head {
    margin-bottom: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid #d8d8d3;
    color: #929892;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 3px;
}

.item-row {
    margin-bottom: 12px;
}

.row-total {
    color: #111;
    text-align: right;
    font-size: 16px;
}

.remove-item {
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #777;
    font-size: 20px;
    cursor: pointer;
}

.remove-item:hover {
    border-color: #e5c1c1;
    background: #fff5f5;
    color: #8e2020;
}

.add-item {
    width: 100%;
    margin-top: 10px;
    padding: 17px;
    border: 2px dashed #c9c9c5;
    border-radius: 12px;
    background: #fff;
    color: #6f7778;
    font-size: 17px;
    cursor: pointer;
}

.total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    color: #626f75;
    font-size: 17px;
}

.total-row strong {
    color: var(--admin-gold);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.6px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-top: 18px;
}

.admin-btn {
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 0 26px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.admin-btn.primary {
    background: var(--admin-blue);
}

.admin-btn.gold {
    background: var(--admin-gold);
    color: var(--admin-blue);
}

.admin-btn.light {
    border: 1.5px solid #d6d6d1;
    background: #fff;
    color: #222;
}

.admin-flash {
    margin-bottom: 22px;
    border-radius: 10px;
    padding: 14px 18px;
    background: #e9f4ec;
    color: #236333;
}

.admin-flash-error {
    background: #fff0f0;
    color: #8e2020;
}

.table-list {
    display: grid;
    gap: 12px;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 22px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #e5e4df;
}

.table-row strong,
.table-row span {
    display: block;
}

.table-row span {
    margin-top: 5px;
    color: #6a7478;
    font-size: 14px;
}

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

.row-actions a,
.row-actions button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--admin-blue);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.row-actions form {
    display: inline;
    margin: 0;
}

.row-actions .link-danger {
    color: #9a2d2d;
}

.action-btn {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(23, 59, 77, .18) !important;
    border-radius: 9px;
    padding: 0 12px !important;
    background: #fff !important;
    color: var(--admin-blue) !important;
    font-size: 13px !important;
    line-height: 1;
    text-decoration: none;
}

.action-btn:hover {
    background: #f4f3ef !important;
}

.action-btn-gold {
    border-color: rgba(207, 173, 63, .55) !important;
    background: rgba(207, 173, 63, .13) !important;
}

.action-btn-danger {
    border-color: rgba(154, 45, 45, .22) !important;
    color: #9a2d2d !important;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.admin-modal.is-open {
    display: flex;
}

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 23, 34, .58);
}

.admin-modal-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    border-radius: 18px;
    padding: 34px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.admin-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 38px;
    height: 38px;
    border: 1px solid #deddd8;
    border-radius: 10px;
    background: #fff;
    color: var(--admin-blue);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.modal-copy {
    margin: 0 0 22px;
    color: var(--admin-muted);
    font-size: 15px;
    line-height: 1.7;
}

.modal-actions {
    margin-top: 20px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    grid-column: 1 / -1;
}

.compact-form {
    align-items: end;
}

.admin-login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background: radial-gradient(circle at top, #24495b, #0d2d3f);
}

.login-card {
    width: min(420px, 100%);
    border-top: 4px solid var(--admin-gold);
    border-radius: 18px;
    padding: 38px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .25);
}

.login-card img {
    width: 118px;
    margin-bottom: 20px;
}

.login-kicker {
    margin: 0;
    color: var(--admin-gold);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 3px;
}

.login-card h1 {
    margin: 9px 0 26px;
    color: var(--admin-blue);
    font-size: 32px;
}

.login-card label {
    margin-top: 17px;
}

.login-card button {
    width: 100%;
    margin-top: 26px;
}

.back-link {
    display: block;
    margin-top: 19px;
    color: var(--admin-blue);
    text-align: center;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 1180px) {
    .admin-sidebar {
        width: 248px;
    }

    .admin-content {
        padding-left: 248px;
    }

    .admin-main {
        width: min(880px, calc(100% - 34px));
    }
}

@media (max-width: 980px) {
    .admin-sidebar {
        transform: translateX(-104%);
        transition: transform .24s ease;
    }

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

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: none;
        background: rgba(3, 18, 28, .48);
    }

    .admin-app.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .sidebar-close {
        display: block;
    }

    .admin-content {
        padding-left: 0;
    }

    .mobile-admin-bar {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        align-items: center;
        gap: 15px;
        min-height: 70px;
        padding: 12px 18px;
        border-bottom: 3px solid var(--admin-gold);
        background: var(--admin-blue);
        color: #fff;
    }

    .mobile-admin-bar strong,
    .mobile-admin-bar span {
        display: block;
    }

    .mobile-admin-bar strong {
        color: var(--admin-gold);
        letter-spacing: 3px;
    }

    .mobile-admin-bar span {
        color: rgba(255, 255, 255, .78);
        text-transform: uppercase;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 1.8px;
    }

    .sidebar-toggle {
        display: grid;
        gap: 5px;
        width: 44px;
        height: 44px;
        place-content: center;
        border: 1px solid rgba(255, 255, 255, .25);
        border-radius: 12px;
        background: rgba(255, 255, 255, .08);
    }

    .sidebar-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: #fff;
    }

    .admin-main {
        width: min(760px, calc(100% - 26px));
        padding: 24px 0 72px;
    }
}

@media (max-width: 720px) {
    .admin-card {
        margin-bottom: 20px;
        padding: 27px 20px;
        border-radius: 15px;
    }

    .admin-section-title {
        font-size: 14px;
        letter-spacing: 4px;
    }

    .gold-line {
        margin-bottom: 23px;
    }

    .quick-row {
        align-items: stretch;
        font-size: 16px;
    }

    .quick-row > span {
        width: 100%;
    }

    .pill {
        flex: 1 1 92px;
    }

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

    label {
        font-size: 15px;
    }

    input,
    select,
    textarea {
        min-height: 52px;
        padding: 13px 15px;
        font-size: 16px;
    }

    .item-head {
        display: none;
    }

    .item-row {
        grid-template-columns: 1fr 92px;
        gap: 10px;
        padding-bottom: 15px;
        border-bottom: 1px solid #e6e4df;
    }

    .item-row input:first-child,
    .row-total {
        grid-column: 1 / -1;
    }

    .row-total {
        text-align: left;
    }

    .remove-item {
        justify-self: end;
    }

    .total-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .total-row strong {
        font-size: 31px;
    }

    .admin-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-btn {
        width: 100%;
    }

    .table-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .admin-sidebar {
        width: min(310px, 88vw);
    }

    .admin-main {
        width: calc(100% - 18px);
    }

    .admin-card {
        padding: 24px 16px;
    }

    .item-row {
        grid-template-columns: 1fr;
    }

    .remove-item {
        justify-self: start;
    }
}
