:root {
    --sidebar-width: 272px;
    --brand: #3157d5;
    --brand-dark: #1f3aa5;
    --surface: #ffffff;
    --canvas: #f4f6fb;
    --text: #1d2533;
    --muted: #6c7585;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: linear-gradient(180deg, #18254e 0%, #101937 100%); color: #fff; z-index: 1040; display: flex; flex-direction: column; transition: transform .25s ease; box-shadow: 12px 0 30px rgba(17, 26, 56, .12); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #6f8cff, #38c6ff); font-weight: 800; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy small { color: rgba(255,255,255,.55); margin-top: 4px; }
.sidebar-nav { padding: 16px 12px; overflow-y: auto; }
.nav-item { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.72); text-decoration: none; padding: 11px 13px; margin: 4px 0; border-radius: 11px; transition: .18s ease; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.12); transform: translateX(2px); }
.nav-item i { font-size: 1.05rem; width: 22px; }
.sidebar-footer { margin-top: auto; padding: 18px 22px; border-top: 1px solid rgba(255,255,255,.08); }
.main-area { margin-left: var(--sidebar-width); min-height: 100vh; transition: margin-left .25s ease; }
.topbar { position: sticky; top: 0; z-index: 1020; height: 72px; padding: 0 24px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); display: flex; align-items: center; border-bottom: 1px solid #e9edf5; }
.icon-btn { border: 0; background: #f1f4fa; margin-right: 14px; }
.user-menu { border: 0; background: transparent; color: var(--text); }
.content-area { padding: 26px; }
.stat-card, .panel-card { background: var(--surface); border: 1px solid #e7ebf3; border-radius: 18px; box-shadow: 0 8px 26px rgba(32, 50, 92, .05); }
.stat-card { padding: 20px; height: 100%; }
.stat-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: #edf2ff; color: var(--brand); font-size: 1.25rem; }
.panel-card { padding: 22px; }
.table { --bs-table-bg: transparent; }
.table thead th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom-color: #e8ecf3; }
.table tbody td { vertical-align: middle; border-bottom-color: #eef1f6; }
.badge-soft-success { color: #147a4d; background: #e8f8f0; }
.badge-soft-warning { color: #9a6700; background: #fff6dc; }
.badge-soft-danger { color: #b42318; background: #ffebe9; }
.badge-soft-secondary { color: #596273; background: #edf0f4; }
.form-control, .form-select { border-radius: 10px; border-color: #dfe4ed; min-height: 42px; }
.btn { border-radius: 10px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.auth-bg, .installer-bg { min-height: 100vh; background: radial-gradient(circle at top left, #dfe8ff, transparent 35%), radial-gradient(circle at bottom right, #d9f6ff, transparent 35%), #f5f7fc; }
.auth-card { max-width: 430px; border: 0; border-radius: 22px; box-shadow: 0 22px 70px rgba(32, 50, 92, .14); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
body.sidebar-collapsed .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
body.sidebar-collapsed .main-area { margin-left: 0; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
    .main-area { margin-left: 0; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .content-area { padding: 18px; }
}

.management-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.management-toolbar h2 { margin-bottom: 3px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.action-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.action-buttons form { margin: 0; }
.table td.actions-cell { white-space: nowrap; width: 1%; }
.table .record-title { font-weight: 700; color: var(--text); }
.form-page { max-width: 1050px; margin: 0 auto; }
.form-section { border-top: 1px solid #edf0f5; padding-top: 20px; margin-top: 20px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.dataTables_wrapper .dataTables_filter input { margin-left: 0; min-width: 240px; border: 1px solid #dfe4ed; border-radius: 10px; padding: 8px 12px; }
.dataTables_wrapper .dataTables_length select { border: 1px solid #dfe4ed; border-radius: 9px; padding: 6px 28px 6px 10px; }
.dataTables_wrapper .dataTables_info { color: var(--muted); padding-top: 16px; }
.dataTables_wrapper .pagination { margin-top: 14px; }
.dataTables_wrapper .page-link { border-radius: 8px; margin: 0 2px; border-color: #e2e7ef; color: var(--brand); }
.dataTables_wrapper .page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.dataTables_processing { border: 0 !important; background: rgba(255,255,255,.96) !important; box-shadow: 0 10px 30px rgba(32,50,92,.12); border-radius: 12px; padding: 14px 20px !important; color: var(--text); }
.datatable-loader { display: flex; align-items: center; justify-content: center; }
@media (max-width: 767.98px) {
    .management-toolbar { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
    .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; }
}
.datatable-filter-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.datatable-filter-tools > label { margin: 0; }
.datatable-column-selector .dropdown-menu { min-width: 245px; max-height: 360px; overflow-y: auto; }
.datatable-column-option { display: flex; align-items: center; border-radius: 8px; padding: 8px 10px; cursor: pointer; white-space: normal; }
.datatable-column-option:hover { background: #f4f6fb; }
.datatable-column-option .form-check-input { flex: 0 0 auto; margin-top: 0; }
.table-responsive .dataTables_wrapper { min-width: 100%; }
@media (max-width: 767.98px) {
    .datatable-filter-tools { justify-content: stretch; width: 100%; }
    .datatable-filter-tools > label { flex: 1 1 180px; }
    .datatable-column-selector { flex: 0 0 auto; }
}
