:root {
    --masa-primary: #c8102e;
    --masa-primary-dark: #9f0c24;
    --masa-primary-soft: #fff0f3;
    --masa-bg: #f5f7fa;
    --masa-surface: #ffffff;
    --masa-text: #172033;
    --masa-muted: #667085;
    --masa-border: #e5e9f0;
    --masa-success: #15803d;
    --masa-warning: #b45309;
    --masa-danger: #b42318;
    --masa-info: #175cd3;
    --masa-radius-sm: 8px;
    --masa-radius: 12px;
    --masa-radius-lg: 16px;
    --masa-shadow: 0 8px 28px rgba(16, 24, 40, .06);
    --masa-shadow-sm: 0 2px 8px rgba(16, 24, 40, .05);
}

html, body { min-height: 100%; }
body.masa-admin-body,
.masa-admin-body { font-family: "Inter", sans-serif; background: var(--masa-bg); color: var(--masa-text); }

.masa-shell .page-wrapper { background: var(--masa-bg); min-height: 100vh; }
.masa-main-content { min-height: calc(100vh - 132px); }
.page-content { padding: 28px 30px 36px; }

/* Sidebar */
.sidebar { border-right: 1px solid var(--masa-border); box-shadow: none; background: #fff; }
.sidebar .sidebar-header { height: 72px; border-bottom: 1px solid var(--masa-border); padding: 0 20px !important; }
.sidebar .sidebar-brand { display: flex !important; align-items: center; justify-content: flex-start; margin: 0 !important; }
.sidebar .sidebar-brand img.logo { max-height: 38px !important; max-width: 142px; object-fit: contain; }
.sidebar .sidebar-body { padding: 18px 12px 28px; scrollbar-width: thin; }
.sidebar .sidebar-body .nav { gap: 3px; }
.sidebar .nav .nav-category { color: #98a2b3; font-size: 10px; font-weight: 700; letter-spacing: .12em; padding: 20px 12px 7px; text-transform: uppercase; }
.sidebar .nav .nav-category:first-child { padding-top: 4px; }
.sidebar .nav .nav-item .nav-link { min-height: 42px; border-radius: 10px; color: #475467; font-weight: 500; padding: 10px 12px; transition: .18s ease; }
.sidebar .nav .nav-item .nav-link .link-icon { width: 18px; height: 18px; color: #667085; margin-right: 12px; }
.sidebar .nav .nav-item .nav-link:hover { background: #f7f8fa; color: var(--masa-text); transform: translateX(2px); }
.sidebar .nav .nav-item.active > .nav-link { background: var(--masa-primary-soft); color: var(--masa-primary); font-weight: 600; }
.sidebar .nav .nav-item.active > .nav-link .link-icon { color: var(--masa-primary); }
.sidebar .sidebar-toggler span { background: #667085; }

/* Navbar */
.masa-navbar { height: 72px; padding: 0 28px; border-bottom: 1px solid var(--masa-border); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); box-shadow: none; display: flex; align-items: center; justify-content: space-between; }
.masa-navbar-left, .masa-navbar-actions { display: flex; align-items: center; gap: 14px; }
.masa-icon-button { width: 40px; height: 40px; border: 1px solid var(--masa-border); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #475467; }
.masa-icon-button:hover { background: #f8fafc; color: var(--masa-primary); }
.masa-navbar-context { line-height: 1.2; }
.masa-navbar-eyebrow { display: block; color: #98a2b3; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
.masa-navbar-title { display: block; color: var(--masa-text); font-size: 15px; }
.masa-profile-trigger { border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 12px; color: var(--masa-text); }
.masa-profile-trigger:hover { background: #f7f8fa; }
.masa-profile-trigger::after { display: none; }
.masa-avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--masa-primary); color: #fff; font-size: 12px; font-weight: 700; }
.masa-avatar img { width: 100%; height: 100%; object-fit: cover; }
.masa-profile-copy { flex-direction: column; align-items: flex-start; line-height: 1.15; }
.masa-profile-copy strong { font-size: 13px; font-weight: 600; }
.masa-profile-copy small { color: var(--masa-muted); font-size: 11px; margin-top: 3px; }
.masa-profile-chevron { width: 16px; height: 16px; color: #98a2b3; }
.masa-profile-menu { width: 250px; border: 1px solid var(--masa-border); border-radius: 14px; box-shadow: var(--masa-shadow); padding: 8px; margin-top: 10px !important; }
.masa-profile-menu-header { padding: 12px 12px 14px; border-bottom: 1px solid var(--masa-border); margin-bottom: 6px; }
.masa-profile-menu-header strong, .masa-profile-menu-header span { display: block; }
.masa-profile-menu-header strong { font-size: 14px; }
.masa-profile-menu-header span { font-size: 12px; color: var(--masa-muted); margin-top: 4px; word-break: break-word; }
.masa-profile-menu .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 9px; font-size: 13px; }
.masa-profile-menu .dropdown-item svg { width: 17px; height: 17px; }

/* Common page structure */
.masa-page-header, .page-content > .d-flex.justify-content-between.align-items-start:first-child, .page-content > .d-flex.justify-content-between.align-items-center:first-child { margin-bottom: 24px !important; }
.page-content h3, .page-content h4 { color: var(--masa-text); font-weight: 700; letter-spacing: -.02em; }
.page-content h5 { color: var(--masa-text); font-weight: 600; }
.text-muted { color: var(--masa-muted) !important; }

.card { border: 1px solid var(--masa-border) !important; border-radius: var(--masa-radius-lg); background: var(--masa-surface); box-shadow: var(--masa-shadow-sm) !important; overflow: visible; }
.card .card-body { padding: 22px; }
.grid-margin { margin-bottom: 22px; }

/* KPI cards */
.page-content .row:first-of-type .card { transition: transform .18s ease, box-shadow .18s ease; }
.page-content .row:first-of-type .card:hover { transform: translateY(-2px); box-shadow: var(--masa-shadow) !important; }
.page-content h2 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--masa-text); }
.page-content h3 { font-size: 24px; }
.rounded-circle.bg-primary, .rounded.bg-primary { background: var(--masa-primary-soft) !important; }
.rounded-circle.bg-primary svg, .rounded.bg-primary svg { color: var(--masa-primary) !important; }

/* Buttons */
.btn { border-radius: 9px; font-weight: 600; padding: .58rem .95rem; font-size: 13px; box-shadow: none !important; }
.btn-sm { padding: .42rem .7rem; font-size: 12px; }
.btn-primary, .btn-success { background: var(--masa-primary); border-color: var(--masa-primary); color: #fff; }
.btn-primary:hover, .btn-success:hover { background: var(--masa-primary-dark); border-color: var(--masa-primary-dark); }
.btn-light { background: #fff; border-color: var(--masa-border); color: #344054; }
.btn-light:hover { background: #f8fafc; border-color: #d0d5dd; }
.btn-warning { background: #fff7ed; border-color: #fed7aa; color: var(--masa-warning); }
.btn-info { background: #eff8ff; border-color: #b2ddff; color: var(--masa-info); }
.btn-danger { background: var(--masa-danger); border-color: var(--masa-danger); }

/* Forms */
.form-label { color: #344054; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.form-control, .form-select { min-height: 43px; border: 1px solid #d0d5dd; border-radius: 9px; color: var(--masa-text); background-color: #fff; font-size: 13px; }
textarea.form-control { min-height: 130px; }
.form-control:focus, .form-select:focus { border-color: var(--masa-primary); box-shadow: 0 0 0 3px rgba(200, 16, 46, .10); }
.form-control::placeholder { color: #98a2b3; }
.invalid-feedback { font-size: 12px; }

/* Tables */
.table-responsive { border-radius: 12px; }
.table { margin-bottom: 0; color: #344054; }
.table > :not(caption) > * > * { padding: 14px 14px; border-bottom-color: #eef1f5; vertical-align: middle; }
.table thead th { background: #f8fafc; color: #667085; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; border-top: 0; }
.table tbody td { font-size: 13px; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: #fcfcfd; }
.table-bordered { border: 0; }
.table-bordered > :not(caption) > * { border-width: 0; }

/* Badges */
.badge { border-radius: 999px; padding: .38rem .62rem; font-size: 11px; font-weight: 600; }
.badge.bg-success { background: #ecfdf3 !important; color: var(--masa-success); border: 1px solid #abefc6; }
.badge.bg-danger { background: #fef3f2 !important; color: var(--masa-danger); border: 1px solid #fecdca; }
.badge.bg-warning { background: #fffaeb !important; color: var(--masa-warning); border: 1px solid #fedf89; }
.badge.bg-primary { background: var(--masa-primary-soft) !important; color: var(--masa-primary); border: 1px solid #ffc7d2; }
.badge.bg-info { background: #eff8ff !important; color: var(--masa-info); border: 1px solid #b2ddff; }
.badge.bg-secondary, .badge.bg-dark { background: #f2f4f7 !important; color: #475467; border: 1px solid #e4e7ec; }
.badge.bg-light { background: #f8fafc !important; }

/* Dropdown */
.dropdown-menu { border: 1px solid var(--masa-border); border-radius: 12px; box-shadow: var(--masa-shadow); padding: 7px; }
.dropdown-item { border-radius: 8px; padding: 9px 11px; font-size: 13px; }
.dropdown-item:hover { background: #f8fafc; }

/* Footer */
.masa-footer { min-height: 60px; padding: 15px 30px; border-top: 1px solid var(--masa-border); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.masa-footer strong, .masa-footer span { display: block; }
.masa-footer strong { color: #344054; font-size: 12px; }
.masa-footer a { color: var(--masa-primary); font-weight: 600; }

/* Chart */
#registrationChart { max-width: 100%; }

/* Pagination */
.pagination { gap: 5px; }
.page-link { border: 1px solid var(--masa-border); border-radius: 8px !important; color: #475467; min-width: 36px; text-align: center; }
.page-item.active .page-link { background: var(--masa-primary); border-color: var(--masa-primary); }

/* Alerts */
.alert { border-radius: 12px; border-width: 1px; }
.alert-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.alert-danger { background: #fef3f2; border-color: #fecdca; color: #b42318; }

@media (max-width: 991.98px) {
    .page-content { padding: 22px 18px 30px; }
    .masa-navbar { padding: 0 18px; }
    .masa-footer { padding: 15px 18px; }
}

@media (max-width: 767.98px) {
    .page-content > .d-flex.justify-content-between { align-items: stretch !important; flex-direction: column; }
    .page-content > .d-flex.justify-content-between > .btn,
    .page-content > .d-flex.justify-content-between > a.btn { width: 100%; }
    .masa-footer { align-items: flex-start; flex-direction: column; }
    .card .card-body { padding: 18px; }
    .table > :not(caption) > * > * { padding: 12px 10px; }
}
