* {
    box-sizing: border-box;
}

.admin-sidebar-head {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    position: relative;
}

.admin-account {
    flex: 1;
    min-width: 0;
    position: relative;
    justify-content: space-between;
    display: flex;
}

.admin-account-toggle {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    gap: 6px;
    min-height: 36px;
    padding: 7px 9px;
    justify-content: space-between;
    flex: 1;
}

.admin-account-toggle span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-account-menu {
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 31, 46, .2);
    display: none;
    min-width: 140px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
}

.admin-account.open .admin-account-menu {
    display: block;
}

.admin-account-menu a {
    border-radius: 6px;
    color: #0a4f86;
    display: block;
    font-weight: 700;
    padding: 9px 10px;
}

.admin-account-menu a:hover {
    background: #eef5fb;
}

.admin-form select,
.admin-form textarea {
    background: #fff;
    border: 1px solid #c7d3df;
    border-radius: 8px;
    color: #17212b;
    font: inherit;
    min-height: 38px;
    outline: 0;
    padding: 8px 10px;
}

.admin-form textarea {
    line-height: 1.45;
    min-height: 150px;
    resize: vertical;
}

.admin-form select:focus,
.admin-form textarea:focus {
    border-color: #0b78d0;
    box-shadow: 0 0 0 3px rgba(11, 120, 208, .14);
}

.wide-form {
    width: 100%;
}

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

.span-2 {
    grid-column: 1 / -1;
}

.login-body {
    align-items: center;
    background: linear-gradient(135deg, #0a4f86, #eef3f7);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 18px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 22px 60px rgba(9, 40, 67, .24);
    display: grid;
    gap: 14px;
    max-width: 420px;
    padding: 24px;
    width: 100%;
}

.login-brand {
    color: #17212b;
    margin-bottom: 4px;
}

.login-brand small {
    color: #667789;
}

@media (max-width: 720px) {
    .topbar-account {
        font-size: 13px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

body {
    background: #eef3f7;
    color: #17212b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.admin-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    background: #0a4f86;
    color: #fff;
    padding: 20px 16px;
}

.admin-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.admin-brand-mark {
    align-items: center;
    background: #fff;
    border: 3px solid #fff;
    border-radius: 10px;
    display: inline-flex;
    font-size: 25px;
    font-weight: 800;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.admin-brand-mark img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.admin-brand strong,
.admin-brand small {
    display: block;
}

.admin-brand span:last-child {
    min-width: 0;
}

.admin-brand strong,
.admin-brand small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-brand small {
    /* color: rgba(255, 255, 255, .76); */
    font-size: 12px;
    margin-top: 3px;
}

.admin-nav {
    display: grid;
    gap: 7px;
}

.admin-nav a {
    align-items: center;
    border-radius: 8px;
    color: rgba(255, 255, 255, .88);
    display: flex;
    font-weight: 700;
    gap: 10px;
    min-height: 42px;
    padding: 11px 12px;
}

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

.admin-main {
    min-width: 0;
    padding: 22px 24px 48px;
}

.admin-topbar {
    align-items: center;
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 31, 46, .05);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 16px 18px;
}

.admin-topbar p,
.admin-topbar h1 {
    margin: 0;
}

.topbar-title {
    min-width: 0;
}

.admin-topbar p {
    color: #667789;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-topbar h1 {
    font-size: 24px;
    line-height: 1.2;
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-left: auto;
}

.topbar-actions .btn {
    min-width: 0;
}

.sidebar-toggle {
    align-items: center;
    background: #eef5fb;
    border: 1px solid #cddbe8;
    border-radius: 8px;
    cursor: pointer;
    display: none;
    flex-direction: column;
    gap: 4px;
    height: 40px;
    justify-content: center;
    width: 42px;
}

.sidebar-toggle span {
    background: #0a4f86;
    border-radius: 999px;
    height: 2px;
    width: 20px;
}

.alert {
    border: 1px solid transparent;
    border-radius: 9px;
    margin: 0 0 16px;
    padding: 12px 14px;
}

.alert-success {
    background: #edf9f0;
    border-color: #a9dcb6;
    color: #1f743b;
}

.alert-error {
    background: #fff1f1;
    border-color: #f0b5b5;
    color: #8d2424;
}

.dashboard-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.metric-card,
.content-card {
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 31, 46, .05);
}

.metric-card {
    align-items: center;
    display: flex;
    gap: 14px;
    padding: 18px;
}

.metric-icon {
    align-items: center;
    background: #eaf5ff;
    border-radius: 10px;
    color: #0869b8;
    display: inline-flex;
    font-size: 24px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.metric-card p,
.metric-card strong {
    display: block;
    margin: 0;
}

.metric-card p {
    color: #667789;
}

.metric-card strong {
    font-size: 30px;
    line-height: 1.1;
}

.content-card {
    padding: 16px;
}

.content-card + .content-card {
    margin-top: 16px;
}

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

.section-heading h2,
.section-heading p {
    margin: 0;
}

.section-heading h2 {
    font-size: 21px;
}

.section-heading p {
    color: #667789;
    margin-top: 4px;
}

.btn {
    align-items: center;
    background: #096fc2;
    border: 1px solid #096fc2;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    white-space: nowrap;
}

.btn.secondary {
    background: #0a4f86;
    border-color: #0a4f86;
}

.btn.ghost {
    background: #fff;
    border-color: #cddbe8;
    color: #25445f;
}

.toolbar {
    align-items: center;
    background: #f7fafc;
    border: 1px solid #e3eaf1;
    border-radius: 9px;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(220px, 1fr) minmax(160px, 220px) 140px auto auto;
    margin-bottom: 14px;
    padding: 12px;
}

.toolbar label {
    color: #314253;
    font-weight: 700;
}

.toolbar input,
.toolbar select,
.admin-form input {
    background: #fff;
    border: 1px solid #c7d3df;
    border-radius: 8px;
    color: #17212b;
    min-height: 38px;
    outline: 0;
    padding: 8px 10px;
}

.toolbar input:focus,
.toolbar select:focus,
.admin-form input:focus {
    border-color: #0b78d0;
    box-shadow: 0 0 0 3px rgba(11, 120, 208, .14);
}

.admin-tabs {
    align-items: center;
    background: #f2f6fa;
    border: 1px solid #dce5ee;
    border-radius: 9px 9px 0 0;
    border-bottom-color: #c4d2df;
    display: flex;
    gap: 4px;
    margin: 0 0 0;
    padding: 8px 8px 0;
}

.admin-tabs a {
    align-items: center;
    background: #e8eff6;
    border: 1px solid #d7e1ea;
    border-bottom-color: #c4d2df;
    border-radius: 8px 8px 0 0;
    color: #385269;
    display: inline-flex;
    font-weight: 700;
    gap: 8px;
    min-height: 40px;
    padding: 10px 14px;
    position: relative;
    top: 1px;
    white-space: nowrap;
}

.admin-tabs a:hover {
    background: #f8fbfe;
    color: #0a4f86;
}

.admin-tabs a.active {
    background: #fff;
    border-color: #c4d2df;
    border-bottom-color: #fff;
    box-shadow: 0 -2px 8px rgba(15, 31, 46, .08);
    color: #096fc2;
    top: 0;
    z-index: 1;
}

.admin-tabs span {
    background: #f8fbfe;
    border-radius: 999px;
    color: #0a4f86;
    font-size: 12px;
    min-width: 24px;
    padding: 3px 7px;
    text-align: center;
}

.admin-tabs a.active span {
    background: #e8f3ff;
    color: #075d9d;
}

.admin-tabs + .table-wrap {
    border: 1px solid #c4d2df;
    border-top: 0;
    border-radius: 0 0 9px 9px;
    padding-top: 8px;
}

.admin-modal {
    display: none;
    inset: 0;
    padding: 18px;
    position: fixed;
    z-index: 100;
}

.admin-modal.open {
    align-items: center;
    display: flex;
    justify-content: center;
}

.admin-modal-backdrop {
    background: rgba(12, 24, 36, .52);
    inset: 0;
    position: absolute;
}

.admin-modal-panel {
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 10px;
    box-shadow: 0 22px 70px rgba(15, 31, 46, .28);
    max-height: calc(100vh - 36px);
    max-width: 680px;
    overflow: auto;
    padding: 18px;
    position: relative;
    width: min(100%, 680px);
    z-index: 1;
}

.admin-modal-panel.wide-modal {
    max-width: 920px;
    width: min(100%, 920px);
}

.admin-modal-head {
    align-items: flex-start;
    border-bottom: 1px solid #edf1f5;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 14px;
}

.admin-modal-head h2,
.admin-modal-head p {
    margin: 0;
}

.admin-modal-head h2 {
    font-size: 21px;
}

.admin-modal-head p {
    color: #667789;
    margin-top: 4px;
}

.modal-close {
    align-items: center;
    background: #eef5fb;
    border: 1px solid #cddbe8;
    border-radius: 7px;
    color: #25445f;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.package-choice-list {
    display: grid;
    gap: 10px;
}

.package-choice {
    align-items: center;
    background: #f8fbfe;
    border: 1px solid #dce5ee;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px;
}

.package-choice:has(input:checked) {
    background: #eef7ff;
    border-color: #096fc2;
    box-shadow: 0 0 0 3px rgba(9, 111, 194, .12);
}

.package-choice input {
    height: 18px;
    width: 18px;
}

.package-choice-body,
.package-choice-meta {
    display: grid;
    gap: 4px;
}

.package-choice-body {
    min-width: 0;
}

.package-choice-body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.package-choice-body span,
.package-choice-meta span {
    color: #667789;
    font-size: 13px;
}

.package-choice-meta {
    text-align: right;
    white-space: nowrap;
}

.admin-modal-actions {
    border-top: 1px solid #edf1f5;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 14px;
}

.related-choice-list {
    display: grid;
    gap: 10px;
    max-height: 58vh;
    overflow: auto;
    padding: 3px;
}

.related-choice {
    align-items: center;
    background: #f8fbfe;
    border: 1px solid #dce5ee;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px;
}

.related-choice:has(input:checked) {
    background: #eef7ff;
    border-color: #096fc2;
    box-shadow: 0 0 0 3px rgba(9, 111, 194, .12);
}

.related-choice input {
    height: 18px;
    width: 18px;
}

.related-choice-body,
.related-choice-meta {
    display: grid;
    gap: 4px;
}

.related-choice-body {
    min-width: 0;
}

.related-choice-body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-choice-body span,
.related-choice-meta span {
    color: #667789;
    font-size: 13px;
}

.related-choice-meta {
    text-align: right;
    white-space: nowrap;
}

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

.admin-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 840px;
    width: 100%;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #edf1f5;
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: #f1f5f9;
    color: #334455;
    font-size: 13px;
    white-space: nowrap;
}

.admin-table tr:hover td {
    background: #fbfdff;
}

.empty-cell {
    color: #667789;
    padding: 28px 10px !important;
    text-align: center !important;
}

.actions-cell {
    align-items: center;
    /* display: flex; */
    gap: 8px;
    white-space: nowrap;
    justify-content: flex-end;
}

.actions-cell form {
    display: inline;
}

.icon-btn {
    background: #eef5fb;
    border: 1px solid #cddbe8;
    border-radius: 7px;
    color: #0a4f86;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    min-height: 34px;
    padding: 7px 10px;
}

.icon-btn.danger {
    background: #fff3f3;
    border-color: #efc4c4;
    color: #a32222;
}

.pagination-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
}

.pagination-actions {
    align-items: center;
    display: flex;
    gap: 6px;
}

.pagination-actions a {
    align-items: center;
    background: #fff;
    border: 1px solid #d9e1ea;
    border-radius: 7px;
    color: #0a609e;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 36px;
    min-width: 38px;
    padding: 8px 10px;
}

.pagination-actions a.active {
    background: #0869b8;
    border-color: #0869b8;
    color: #fff;
}

.pagination-actions a.disabled {
    color: #b9c3cf;
    pointer-events: none;
}

.form-card {
    width: 100%;
}

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

.form-field {
    display: grid;
    gap: 7px;
}

.form-field label {
    color: #314253;
    font-weight: 700;
}

.form-actions {
    border-top: 1px solid #edf1f5;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 6px;
    padding-top: 16px;
}

@media (max-width: 980px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
        position: relative;
        z-index: 30;
    }

    .admin-shell.sidebar-open .admin-sidebar {
        display: block;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .admin-main {
        padding: 14px 12px 36px;
    }

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

@media (max-width: 720px) {
    .admin-topbar {
        align-items: stretch;
    }

    .topbar-title {
        flex: 1 1 180px;
    }

    .topbar-actions {
        justify-content: flex-start;
        margin-left: 0;
        width: 100%;
    }

    .topbar-actions .btn {
        flex: 1 1 auto;
    }

    .section-heading,
    .pagination-row {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .toolbar label,
    .toolbar input {
        grid-column: 1 / -1;
    }

    .toolbar .btn {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        overflow: visible;
    }

    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        border: 1px solid #dce5ee;
        border-radius: 9px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    .admin-table td {
        align-items: flex-start;
        display: grid;
        gap: 10px;
        grid-template-columns: 96px minmax(0, 1fr);
        padding: 10px 12px;
    }

    .admin-table td::before {
        color: #667789;
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .admin-table .empty-cell {
        display: block;
        text-align: left !important;
    }

    .actions-cell {
        display: flex !important;
        flex-wrap: wrap;
    }

    .actions-cell::before {
        width: 100%;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .btn {
        flex: 1;
    }

    .admin-modal {
        padding: 12px;
    }

    .admin-modal-panel {
        max-height: calc(100vh - 24px);
        padding: 14px;
    }

    .package-choice {
        align-items: flex-start;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .package-choice-meta {
        grid-column: 2;
        text-align: left;
    }

    .related-choice {
        align-items: flex-start;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .related-choice-meta {
        grid-column: 2;
        text-align: left;
    }

    .admin-modal-actions {
        justify-content: stretch;
    }

    .admin-modal-actions .btn {
        flex: 1;
    }
}
