/* =========================================================
   EMERALD COMMERCIAL ADMIN
   Central UI / UX Design System
   ========================================================= */

:root {
    --ec-primary: #2563eb;
    --ec-primary-hover: #1d4ed8;
    --ec-primary-soft: #eff6ff;

    --ec-success: #059669;
    --ec-success-soft: #ecfdf5;

    --ec-warning: #d97706;
    --ec-warning-soft: #fffbeb;

    --ec-danger: #dc2626;
    --ec-danger-hover: #b91c1c;
    --ec-danger-soft: #fef2f2;

    --ec-info: #0284c7;
    --ec-info-soft: #f0f9ff;

    --ec-sidebar: #0f172a;
    --ec-sidebar-hover: #1e293b;
    --ec-sidebar-active: #263449;

    --ec-bg: #f5f7fb;
    --ec-surface: #ffffff;
    --ec-border: #e2e8f0;
    --ec-border-soft: #edf1f5;

    --ec-text: #172033;
    --ec-text-secondary: #475569;
    --ec-muted: #64748b;
    --ec-placeholder: #94a3b8;

    --ec-radius-sm: 7px;
    --ec-radius: 10px;
    --ec-radius-lg: 14px;

    --ec-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --ec-shadow: 0 4px 14px rgba(15, 23, 42, .06);
    --ec-shadow-lg: 0 12px 30px rgba(15, 23, 42, .08);

    --ec-sidebar-width: 250px;
    --ec-topbar-height: 68px;
}

/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--ec-bg);
    color: var(--ec-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--ec-primary);
}

a:hover {
    color: var(--ec-primary-hover);
}

/* =========================================================
   APPLICATION SHELL
   ========================================================= */

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

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;

    width: var(--ec-sidebar-width);
    height: 100vh;

    padding: 24px 14px;

    overflow-y: auto;

    background: var(--ec-sidebar);
    color: #fff;

    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 20px;
}

.admin-main {
    min-height: 100vh;
    margin-left: var(--ec-sidebar-width);
    width: calc(100% - var(--ec-sidebar-width));
}

/* =========================================================
   BRAND
   ========================================================= */

.admin-brand {
    padding: 3px 12px 25px;
}

.admin-brand a {
    color: inherit;
    text-decoration: none;
}

.admin-brand-title {
    font-size: 21px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -.4px;
}

.admin-brand-subtitle {
    display: block;
    margin-top: 5px;
    color: #94a3b8;
    font-size: 12px;
}

/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */

.admin-nav {
    position: relative;
}

.admin-nav-section {
    margin: 20px 8px 8px;

    color: #64748b;

    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.admin-nav a {
    display: flex;
    align-items: center;

    min-height: 40px;
    margin-bottom: 3px;
    padding: 9px 12px;

    border-radius: 9px;

    color: #cbd5e1;
    text-decoration: none;

    font-size: 14px;

    transition:
        background .16s ease,
        color .16s ease,
        transform .16s ease;
}

.admin-nav a:hover {
    background: var(--ec-sidebar-hover);
    color: #fff;
}

.admin-nav a.active {
    background: var(--ec-sidebar-active);
    color: #fff;
    font-weight: 650;
}

.admin-nav a.disabled {
    color: #64748b;
    cursor: not-allowed;
}

.admin-nav a.disabled:hover {
    background: transparent;
    color: #64748b;
}

.nav-dot {
    flex: 0 0 6px;

    width: 6px;
    height: 6px;

    margin-right: 11px;

    border-radius: 50%;
    background: #64748b;
}

.admin-nav a.active .nav-dot {
    background: #60a5fa;
}

/* =========================================================
   TOPBAR
   ========================================================= */

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;

    min-height: var(--ec-topbar-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 30px;

    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--ec-border);

    backdrop-filter: blur(12px);
}

.topbar-title {
    color: var(--ec-text);
    font-size: 15px;
    font-weight: 650;
}

.topbar-subtitle {
    margin-top: 2px;
    color: var(--ec-muted);
    font-size: 12px;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */

.admin-content {
    width: 100%;
    max-width: 1600px;
    padding: 32px;
}

/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header,
.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
    margin-bottom: 26px;
}

.page-title,
.header h1 {
    margin: 0;

    color: var(--ec-text);

    font-size: 28px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -.55px;
}

.page-subtitle,
.subtitle,
.muted {
    margin-top: 7px;
    color: var(--ec-muted);
    font-size: 14px;
}

h1,
h2,
h3,
h4 {
    color: var(--ec-text);
}

h1 {
    line-height: 1.2;
}

h2 {
    margin: 0 0 18px;
    font-size: 17px;
    line-height: 1.3;
}

h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

/* =========================================================
   ACTIONS
   ========================================================= */

.actions,
.header-actions,
.buttons {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    padding: 9px 16px;

    border: 1px solid var(--ec-primary);
    border-radius: var(--ec-radius-sm);

    background: var(--ec-primary);
    color: #fff;

    text-decoration: none;
    font-size: 14px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease,
        transform .1s ease;
}

.button:hover,
.btn:hover {
    border-color: var(--ec-primary-hover);
    background: var(--ec-primary-hover);
    color: #fff;
    text-decoration: none;
}

.button:active,
.btn:active {
    transform: translateY(1px);
}

.button.secondary,
.btn.secondary,
.btn-secondary {
    border-color: var(--ec-border);
    background: #fff;
    color: var(--ec-text-secondary);
}

.button.secondary:hover,
.btn.secondary:hover,
.btn-secondary:hover {
    background: #f8fafc;
    color: var(--ec-text);
}

.button.danger,
.btn-danger {
    border-color: var(--ec-danger);
    background: var(--ec-danger);
    color: #fff;
}

.button.danger:hover,
.btn-danger:hover {
    border-color: var(--ec-danger-hover);
    background: var(--ec-danger-hover);
}

.button.success {
    border-color: var(--ec-success);
    background: var(--ec-success);
}

.button.small,
.btn-small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
}

/* =========================================================
   CARDS
   ========================================================= */

.card {
    margin-bottom: 20px;

    overflow: hidden;

    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius-lg);

    box-shadow: var(--ec-shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 18px 22px;

    border-bottom: 1px solid var(--ec-border-soft);
}

.card-header h2,
.card-header h3 {
    margin: 0;
}

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--ec-border-soft);
    background: #fafbfc;
}

/* Legacy cards */
.grid .card {
    height: fit-content;
}

/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    margin-bottom: 20px;
    padding: 13px 16px;

    border: 1px solid #bbf7d0;
    border-radius: var(--ec-radius);

    background: var(--ec-success-soft);
    color: #166534;
}

.alert-error,
.errors,
.error-box {
    margin-bottom: 20px;
    padding: 14px 16px;

    border: 1px solid #fecaca;
    border-radius: var(--ec-radius);

    background: var(--ec-danger-soft);
    color: #991b1b;
}

.alert-warning {
    border-color: #fde68a;
    background: var(--ec-warning-soft);
    color: #92400e;
}

.alert-info {
    border-color: #bae6fd;
    background: var(--ec-info-soft);
    color: #075985;
}

/* =========================================================
   STATS
   ========================================================= */

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

.stat-card {
    padding: 20px;

    background: #fff;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius-lg);

    box-shadow: var(--ec-shadow-sm);
}

.stat-label {
    margin-bottom: 8px;
    color: var(--ec-muted);
    font-size: 13px;
}

.stat-value {
    color: var(--ec-text);
    font-size: 28px;
    line-height: 1.1;
    font-weight: 750;
    letter-spacing: -.5px;
}

/* =========================================================
   TABLES
   ========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 680px;

    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 14px 16px;

    text-align: left;
    vertical-align: middle;

    border-bottom: 1px solid var(--ec-border-soft);

    font-size: 14px;
}

th {
    background: #fafbfc;
    color: var(--ec-muted);

    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .055em;
}

tbody tr {
    transition: background .12s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 24px;
    padding: 4px 9px;

    border-radius: 999px;

    background: #e2e8f0;
    color: #475569;

    font-size: 11px;
    line-height: 1;
    font-weight: 650;
    white-space: nowrap;
}

.badge-success,
.badge-green,
.badge.active {
    background: #dcfce7;
    color: #166534;
}

.badge-warning,
.badge-yellow {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger,
.badge-red,
.badge.off,
.badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray,
.badge-neutral {
    background: #e2e8f0;
    color: #475569;
}

/* =========================================================
   FORMS
   ========================================================= */

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

.form-group,
.field {
    min-width: 0;
}

.form-group.full,
.field.full,
.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 7px;

    color: var(--ec-text);
    font-size: 13px;
    font-weight: 650;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;

    min-height: 42px;
    padding: 9px 12px;

    border: 1px solid #cbd5e1;
    border-radius: var(--ec-radius-sm);

    background: #fff;
    color: var(--ec-text);

    outline: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

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

input::placeholder,
textarea::placeholder {
    color: var(--ec-placeholder);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: var(--ec-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: #f8fafc;
    color: var(--ec-muted);
    cursor: not-allowed;
}

.form-help,
.help,
.section-description {
    margin-top: 6px;
    color: var(--ec-muted);
    font-size: 12px;
    line-height: 1.5;
}

.required {
    color: var(--ec-danger);
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin: 0;
    padding: 9px 12px;

    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius-sm);

    background: #fff;

    font-weight: 500;
}

.check input[type="checkbox"],
.check input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ec-primary);
}

/* =========================================================
   FORM SECTIONS
   ========================================================= */

.section-title {
    margin: 4px 0 5px;

    color: var(--ec-text);

    font-size: 15px;
    font-weight: 700;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ec-border-soft);
}

/* =========================================================
   DETAIL / INFORMATION ROWS
   ========================================================= */

.row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 12px 0;

    border-bottom: 1px solid var(--ec-border-soft);
}

.row:last-child {
    border-bottom: 0;
}

.label {
    color: var(--ec-muted);
}

.value {
    color: var(--ec-text);
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.description {
    color: var(--ec-text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

.meta {
    margin: 18px 0;
    padding: 15px 16px;

    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);

    background: #f8fafc;
    color: var(--ec-text-secondary);
}

.price {
    color: var(--ec-text);
    font-size: 30px;
    line-height: 1.1;
    font-weight: 750;
}

.price small {
    color: var(--ec-muted);
    font-size: 14px;
    font-weight: 450;
}

/* =========================================================
   TOOLBARS / FILTERS
   ========================================================= */

.toolbar,
.filters {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
    flex-wrap: wrap;

    margin-bottom: 18px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.search {
    min-width: 240px;
}

/* =========================================================
   ACTION LINKS
   ========================================================= */

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

.row-actions a,
.product-list a {
    font-weight: 600;
}

/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--ec-muted);
}

.empty strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ec-text);
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    margin-top: 22px;
}

/* =========================================================
   DANGER ZONE
   ========================================================= */

.danger-zone {
    border-color: #fecaca;
}

.danger-zone .card-header {
    background: #fffafa;
}

.danger-zone h2,
.danger-zone h3 {
    color: #991b1b;
}

/* =========================================================
   PRODUCT / RELEASE DETAIL LAYOUT
   ========================================================= */

.detail-grid,
.release-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
}

.detail-section {
    margin-bottom: 20px;
}

/* =========================================================
   CODE / TECHNICAL VALUES
   ========================================================= */

.code,
.product-code,
.gateway-slug {
    display: inline-block;

    padding: 3px 7px;

    border-radius: 5px;

    background: #f1f5f9;
    color: #334155;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 12px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-grid,
    .release-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .form-grid,
    .grid {
        grid-template-columns: 1fr;
    }

    .form-group.full,
    .field.full,
    .full {
        grid-column: auto;
    }

    .admin-content {
        padding: 24px;
    }

    .page-header,
    .header {
        align-items: stretch;
        flex-direction: column;
    }

    .actions,
    .header-actions {
        width: 100%;
    }

    .button {
        min-height: 40px;
    }
}

@media (max-width: 760px) {
    .admin-sidebar {
        position: fixed;

        width: 220px;

        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .admin-main {
        width: 100%;
        margin-left: 0;
    }

    .admin-topbar {
        padding: 0 18px;
    }

    .admin-content {
        padding: 18px;
    }

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

    .checks {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-form {
        width: 100%;
    }

    .search {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .admin-content {
        padding: 14px;
    }

    .page-title,
    .header h1 {
        font-size: 24px;
    }

    .actions,
    .buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .actions .button,
    .buttons .button,
    .actions .btn,
    .buttons .btn {
        width: 100%;
    }

    .card-body {
        padding: 17px;
    }

    .card-header {
        padding: 16px 17px;
    }

    .row {
        flex-direction: column;
        gap: 4px;
    }

    .value {
        text-align: left;
    }
}

/* =========================================================
   SMALL UTILITY CLASSES
   ========================================================= */

.mt-8 {
    margin-top: 8px;
}

.mt-18 {
    margin-top: 18px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-18 {
    padding: 18px;
}

.text-muted-small {
    color: #64748b;
    font-size: 12px;
}

.text-muted {
    color: #64748b;
}

.text-danger {
    color: #b42318;
}

.required {
    color: #dc2626;
}

.inline-form {
    display: inline;
}

.danger-action {
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    color: #b42318;
    font-weight: 600;
}

.form-check-input {
    width: auto !important;
}

.page-section {
    margin-top: 24px;
}

.card-narrow {
    max-width: 850px;
}

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


/* =========================================================
   FINAL ADMIN UI UTILITIES
   ========================================================= */

.text-muted-small {
    color: #64748b;
    font-size: 12px;
}

.text-muted {
    color: #64748b;
}

.text-soft {
    color: #98a2b3;
}

.text-danger {
    color: #b42318;
}

.required {
    color: #dc2626;
}

.p-18 {
    padding: 18px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-18 {
    margin-top: 18px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-20 {
    margin-bottom: 20px;
}

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

.section-title {
    margin: 0;
    font-size: 18px;
}

.section-description {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

.inline-form {
    display: inline;
}

.danger-action {
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    color: #b42318;
    font-weight: 600;
}

.form-checkbox {
    width: auto !important;
}

.options-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}

.release-info-grid {
    display: grid;
    gap: 10px;
}

.release-info-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.release-card {
    margin-bottom: 20px;
    max-width: 850px;
}


/* =========================================================
   ORDER / DETAIL UI
   ========================================================= */

.button-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card-header {
    padding: 20px 22px;
    border-bottom: 1px solid #eef2f6;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #172033;
}

.card-subtitle {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 22px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.detail-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.detail-muted {
    color: #64748b;
    font-size: 13px;
}

.break-word {
    overflow-wrap: anywhere;
}

.price-list {
    padding: 20px 22px;
}

.price-list > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f6;
}

.price-list > div:last-child {
    border-bottom: 0;
}

.price-total {
    margin-top: 6px;
    padding-top: 16px !important;
    font-size: 17px;
    font-weight: 700;
}

.billing-block,
.note-content {
    padding: 22px;
    line-height: 1.75;
    color: #475467;
}

.billing-block strong {
    display: block;
    color: #172033;
    margin-bottom: 5px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.error-list {
    margin: 8px 0 0 18px;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
        text-align: center;
    }
}


/* =========================================================
   AUTHENTICATION
   ========================================================= */

.auth-page {
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #f5f7fb;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 32px;
}

.auth-logo {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #111827;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.auth-title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

.auth-subtitle {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
}

.auth-heading {
    margin-bottom: 24px;
}

.auth-heading h1 {
    margin: 0;
    font-size: 25px;
    color: #111827;
}

.auth-heading p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 14px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 22px;
    color: #475569;
    font-size: 13px;
}

.auth-remember input {
    width: auto;
}

.auth-submit {
    width: 100%;
    min-height: 44px;
    justify-content: center;
}


/* =========================================================
   AUTH PAGE SHELL
   ========================================================= */

.auth-body {
    margin: 0;
    min-height: 100vh;
    background: #f5f7fb;
    color: #172033;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* =========================================================
   ADMIN ACCOUNT / LOGOUT
   ========================================================= */

.admin-sidebar-account {
    margin-top: auto;
    padding: 18px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.admin-account-label {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 5px;
}

.admin-account-name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.admin-account-email {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 2px;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-logout-button {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 7px;
    background: rgba(255, 255, 255, .05);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.admin-logout-button:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .20);
}


/* =========================================================
   RBAC MANAGEMENT
   ========================================================= */

.permission-groups {
    display: grid;
    gap: 18px;
}

.permission-group {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.permission-group-title {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
    text-transform: capitalize;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.permission-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.permission-item input {
    width: auto;
    margin-top: 3px;
}

.permission-item span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.permission-item small {
    color: #64748b;
    font-size: 11px;
}

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

.actions form {
    margin: 0;
}

.empty-state {
    padding: 35px;
    text-align: center;
    color: #64748b;
}

.text-muted-small {
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 700px) {
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-wrap: wrap;
    }
}

