:root {
    --brand: #ff6b1a;
    --brand-soft: #fff0e8;
    --ink: #17182a;
    --muted: #778094;
    --page: #f4f6fa;
    --surface: #ffffff;
    --line: #e6ebf2;
    --sidebar: #111224;
}

html, body {
    min-height: 100%;
}

body {
    background: var(--page);
    color: var(--ink);
    font-family: Arial, "Segoe UI", sans-serif;
}

.text-orange {
    color: var(--brand) !important;
}

.btn-orange {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #eb5f12;
    --bs-btn-hover-border-color: #eb5f12;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(3px);
    font-weight: 700;
}

.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 276px;
    background: var(--sidebar);
    color: #fff;
    flex-direction: column;
    padding: 22px 16px;
    z-index: 1020;
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 8px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.brand-icon {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
}

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

.sidebar-brand small {
    color: rgba(255, 255, 255, .58);
}

.sidebar-nav {
    display: grid;
    gap: 6px;
    padding-top: 18px;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    border-radius: 8px;
    padding: 11px 12px;
    font-weight: 700;
}

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

.sidebar-nav.mobile a {
    color: var(--ink);
}

.sidebar-nav.mobile a:hover {
    background: var(--brand-soft);
}

.main-shell {
    min-height: 100vh;
}

@media (min-width: 992px) {
    .main-shell {
        margin-inline-start: 276px;
    }
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.topbar strong,
.topbar small {
    display: block;
}

.topbar strong {
    font-size: 20px;
}

.topbar small {
    color: var(--muted);
}

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

.topbar-actions .form-select {
    width: 82px;
}

.content-wrap {
    padding: 24px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 82% 12%, rgba(255, 107, 26, .18), transparent 30%),
        linear-gradient(135deg, #111224 0%, #202237 62%, #2f314c 100%);
}

.login-panel {
    width: min(100%, 430px);
    background: #fff;
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 22px 70px rgba(6, 8, 24, .32);
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
    font-size: 24px;
    margin-bottom: 20px;
}

.login-panel h1,
.page-heading h1 {
    font-size: 26px;
    font-weight: 900;
    margin: 0;
}

.login-panel p,
.page-heading p {
    color: var(--muted);
    margin: 8px 0 0;
}

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

.content-panel,
.metric {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 28px rgba(20, 24, 38, .04);
}

.content-panel h2 {
    font-size: 18px;
    font-weight: 900;
    margin: 0;
}

.metric {
    min-height: 112px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    display: block;
    font-size: 30px;
    line-height: 1.2;
    margin-top: 8px;
}

.crud-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}

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

.image-uploader {
    border: 1px dashed #cfd6e2;
    border-radius: 8px;
    padding: 12px;
    background: #fafbfc;
}

.image-uploader img {
    width: 100%;
    max-height: 130px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    margin-top: 10px;
    display: none;
}

.table-card {
    overflow: hidden;
}

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

.toolbar-actions,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

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

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

.form-field-wide,
.modal-actions {
    grid-column: 1 / -1;
}

.required-mark {
    color: #d63333;
    margin-inline-start: 4px;
}

.modal-crud-form .form-control,
.modal-crud-form .form-select {
    min-height: 42px;
    border-color: var(--line);
}

.modal-crud-form textarea.form-control {
    min-height: 92px;
}

.modal-header {
    border-bottom-color: var(--line);
}

.table {
    vertical-align: middle;
}

.table th {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.table td {
    font-size: 13px;
}

.table-actions {
    display: inline-flex;
    gap: 6px;
    white-space: nowrap;
}

.table-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.thumb-link {
    display: inline-block;
}

.badge-active,
.badge-inactive {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 0.4em 0.75em;
    border-radius: 6px;
    display: inline-block;
    line-height: 1.2;
}

.badge-active {
    background-color: #157347;
}

.badge-inactive {
    background-color: #6c757d;
}

.dataTables_wrapper .dt-search input,
.dataTables_wrapper .dt-length select {
    border-radius: 8px;
    border-color: var(--line);
}

.invalid-feedback.client-error {
    display: block;
}

@media (max-width: 767.98px) {
    .content-wrap {
        padding: 16px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

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

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