/* =============================================================
   Admin Theme - Adminator-inspired shell
   Base: Bootstrap 5 + custom design layer
   ============================================================= */

:root {
    --sidebar-w: 250px;
    --sidebar-bg: #2f3542;
    --sidebar-bg-soft: #262b36;
    --sidebar-text: #a7b0c0;
    --sidebar-active: #fd7e14;

    --accent: #fd7e14;
    --accent-soft: rgba(253, 126, 20, .12);
    --primary: #3c92e3;
    --success: #1abc9c;
    --danger: #ef4b5b;
    --warning: #f7c948;
    --purple: #6f5ef9;
    --info: #17c9e9;

    --body-bg: #f4f6fa;
    --card-border: #eceef4;
    --text: #3d4652;
    --muted: #8c93a3;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .06);
}

body {
    background: var(--body-bg);
    color: var(--text);
    font-size: .95rem;
    -webkit-font-smoothing: antialiased;
}

/* Align legacy Bootstrap helpers with the brand accent */
.text-warning { color: var(--accent) !important; }
.text-purple { color: var(--purple) !important; }
.text-info { color: var(--info) !important; }

/* ---------------------------------------------------------
   Shell
   --------------------------------------------------------- */
.shell {
    display: flex;
    min-height: 100vh;
}

.shell-sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1045;
    transition: width .25s ease, flex-basis .25s ease, transform .28s ease;
}

.shell-main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}

/* ---------------------------------------------------------
   Sidebar
   --------------------------------------------------------- */

/* Desktop collapsed state - icon rail */
body.sidebar-collapsed {
    --sidebar-w: 72px;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 20px 12px 18px;
}

body.sidebar-collapsed .sidebar-brand .brand-text,
body.sidebar-collapsed .nav-caption,
body.sidebar-collapsed .side-nav a .side-label {
    display: none;
}

body.sidebar-collapsed .sidebar-scroll {
    padding: 12px 10px 24px;
}

body.sidebar-collapsed .side-nav a {
    justify-content: center;
    padding: 11px 0;
    position: relative;
}

body.sidebar-collapsed .side-nav a i {
    font-size: 1rem;
}

/* Badge becomes a dot while collapsed */
body.sidebar-collapsed .side-nav .nav-badge {
    position: absolute;
    top: 7px;
    right: 13px;
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    box-shadow: 0 0 0 2px var(--sidebar-bg);
}

/* Tooltip from the link's title attribute when collapsed */
body.sidebar-collapsed .side-nav a::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) scale(.94);
    background: #1f2430;
    color: #fff;
    font-size: .78rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    transition: opacity .16s ease, transform .16s ease;
    z-index: 1060;
}

body.sidebar-collapsed .side-nav a:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    text-decoration: none;
    color: inherit;
}

/* The brand is an anchor - kill the default link underline */
.sidebar-brand:hover,
.sidebar-brand:focus {
    text-decoration: none;
    color: inherit;
}

.sidebar-brand:hover .logo-mark {
    transform: rotate(-6deg) scale(1.05);
}

.sidebar-brand .logo-mark {
    transition: transform .25s ease;
}

.sidebar-brand .logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #f56040);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .95rem;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: .2px;
    line-height: 1.15;
}

.sidebar-brand .brand-text small {
    display: block;
    color: var(--sidebar-text);
    font-weight: 400;
    font-size: .7rem;
    letter-spacing: .3px;
}

.sidebar-scroll {
    padding: 14px 12px 24px;
}

.nav-caption {
    color: #6b7484;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 14px 12px 6px;
}

.side-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-nav li {
    margin-bottom: 2px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .16s ease, color .16s ease;
}

.side-nav a i {
    width: 18px;
    text-align: center;
    font-size: .92rem;
    opacity: .9;
}

.side-nav a:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.side-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(253, 126, 20, .28);
}

.side-nav a.nav-danger {
    color: #ff8a95;
}

.side-nav a.nav-danger:hover {
    background: rgba(239, 75, 91, .16);
    color: #fff;
}

.side-nav .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 28, .5);
    z-index: 1040;
}

body.sidebar-open .sidebar-overlay {
    display: block;
}

/* ---------------------------------------------------------
   Topbar
   --------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 10px 22px;
    flex-wrap: nowrap;
}

/* Right-hand cluster never wraps and never overflows */
.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
}

.topbar-title {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--text);
    margin: 0;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Uniform control sizing so everything lines up on one row */
.topbar .icon-btn,
.topbar-search,
.user-chip {
    height: 40px;
    flex-shrink: 0;
}

.topbar .icon-btn {
    width: 40px;
    border-radius: 9px;
    border: 1px solid var(--card-border);
    background: #fff;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    transition: all .16s ease;
}

.topbar .icon-btn:hover,
.topbar .icon-btn:focus {
    color: var(--accent);
    border-color: var(--accent-soft);
    background: var(--accent-soft);
}

.topbar-search {
    position: relative;
    width: 260px;
    max-width: 260px;
    min-width: 0;
}

.topbar-search input {
    width: 100%;
    height: 100%;
    border: 1px solid var(--card-border);
    background: #f8f9fc;
    border-radius: 9px;
    padding: 0 12px 0 36px;
    font-size: .88rem;
    color: var(--text);
    outline: none;
    transition: all .16s ease;
}

.topbar-search input:focus {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: .85rem;
    pointer-events: none;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 0 4px;
    border-radius: 30px;
    border: 1px solid var(--card-border);
    background: #fff;
    text-decoration: none;
    max-width: 190px;
}

.user-chip:hover {
    background: #f8f9fc;
}

.user-chip .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-chip .meta {
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
}

.user-chip .meta strong,
.user-chip .meta span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip .meta strong {
    font-size: .84rem;
    color: var(--text);
}

.user-chip .meta span {
    font-size: .72rem;
    color: var(--muted);
}

/* Caret on the user chip */
.user-chip-caret {
    font-size: .7rem;
    color: var(--muted);
    margin-left: 2px;
    transition: transform .2s ease;
}

.dropdown.show .user-chip-caret {
    transform: rotate(180deg);
}

/* Account dropdown menu */
.user-menu {
    min-width: 230px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .35rem 0;
    margin-top: 8px !important;
}

.user-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .55rem 1.1rem;
    font-size: .88rem;
    color: var(--text);
    border-radius: 0;
}

.user-menu .dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--muted);
    transition: color .16s ease;
}

.user-menu .dropdown-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.user-menu .dropdown-item:hover i {
    color: var(--accent);
}

.user-menu .dropdown-item.text-danger {
    color: var(--danger);
}

.user-menu .dropdown-item.text-danger i {
    color: var(--danger);
}

.user-menu .dropdown-item.text-danger:hover {
    background: rgba(239, 75, 91, .12);
    color: var(--danger);
}

.user-menu-head {
    padding: .55rem 1.1rem;
    line-height: 1.3;
}

.user-menu-name {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
}

.user-menu-mail {
    display: block;
    font-size: .76rem;
    color: var(--muted);
    word-break: break-all;
}

.user-menu .dropdown-divider {
    border-color: var(--card-border);
    margin: .3rem 0;
}

/* Profile page avatar */
.profile-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 14px;
}

/* Notification counter */
.topbar .icon-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: .6rem;
    padding: .22em .42em;
    line-height: 1;
}

/* ---------------------------------------------------------
   Content + page head
   --------------------------------------------------------- */
.content {
    padding: 22px;
    flex: 1 1 auto;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-head .eyebrow {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 2px;
}

.page-head h1,
.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0 0 4px;
    font-size: .8rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #c3c8d2;
}

.breadcrumb-item a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--text);
}

/* ---------------------------------------------------------
   KPI cards
   --------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(16, 24, 40, .1);
}

.kpi-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.kpi-card.c-success::after { background: var(--success); }
.kpi-card.c-danger::after { background: var(--danger); }
.kpi-card.c-warning::after { background: var(--warning); }
.kpi-card.c-purple::after { background: var(--purple); }
.kpi-card.c-info::after { background: var(--info); }
.kpi-card.c-accent::after { background: var(--accent); }

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kpi-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
    background: rgba(60, 146, 227, .12);
    color: var(--primary);
}

.kpi-icon.success { background: rgba(26, 188, 156, .13); color: var(--success); }
.kpi-icon.danger { background: rgba(239, 75, 91, .13); color: var(--danger); }
.kpi-icon.warning { background: rgba(247, 201, 72, .16); color: #c99a10; }
.kpi-icon.purple { background: rgba(111, 94, 249, .13); color: var(--purple); }
.kpi-icon.info { background: rgba(23, 201, 233, .14); color: var(--info); }
.kpi-icon.accent { background: var(--accent-soft); color: var(--accent); }

.kpi-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .01em;
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-top: 12px;
    word-break: break-word;
}

.kpi-compare {
    font-size: .75rem;
    color: var(--muted);
    margin-top: 2px;
}

.kpi-pill {
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    background: #f1f3f7;
    color: var(--muted);
    white-space: nowrap;
}

.kpi-pill.up { background: rgba(26, 188, 156, .13); color: #12907a; }
.kpi-pill.down { background: rgba(239, 75, 91, .13); color: #cf2f3f; }
.kpi-pill.info { background: rgba(60, 146, 227, .12); color: #2a7cc7; }

/* ---------------------------------------------------------
   Cards / panels
   --------------------------------------------------------- */
.card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    padding: 14px 18px;
    font-weight: 700;
    font-size: .95rem;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-body {
    padding: 18px;
}

.card-footer {
    background: #fbfcfe;
    border-top: 1px solid var(--card-border);
    padding: 12px 18px;
}

.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--muted);
}

.empty-state i {
    display: block;
    font-size: 2.4rem;
    margin-bottom: 12px;
    opacity: .45;
}

.empty-state h6 {
    color: var(--text);
    font-weight: 600;
}

.empty-state p {
    font-size: .85rem;
    margin: 0;
}

/* ---------------------------------------------------------
   Tables
   --------------------------------------------------------- */
.table {
    color: var(--text);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: .75rem .85rem;
}

.table thead th {
    background: #f8f9fc;
    border-bottom: 1px solid var(--card-border);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    border-bottom: 1px solid #f2f4f8;
    vertical-align: middle;
    font-size: .88rem;
}

.table-hover tbody tr:hover {
    background-color: #fafbfd;
}

.table tfoot th {
    background: #f8f9fc;
    border-top: 1px solid var(--card-border);
    font-size: .82rem;
}

.table-responsive {
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Tags (status pills) */
.tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f1f3f7;
    color: var(--muted);
    letter-spacing: .01em;
}

.tag.t-success { background: rgba(26, 188, 156, .14); color: #128a76; }
.tag.t-danger { background: rgba(239, 75, 91, .13); color: #cf2f3f; }
.tag.t-warning { background: rgba(247, 201, 72, .18); color: #9c7a08; }
.tag.t-info { background: rgba(23, 201, 233, .15); color: #0e8ba1; }
.tag.t-primary { background: rgba(60, 146, 227, .13); color: #2a7cc7; }
.tag.t-accent { background: var(--accent-soft); color: #d9700b; }
.tag.t-purple { background: rgba(111, 94, 249, .13); color: #5744e0; }
.tag.t-muted { background: #f1f3f7; color: var(--muted); }

/* Keep bootstrap badges readable on the new surface */
.badge {
    font-weight: 700;
    border-radius: 20px;
    padding: .32em .68em;
    letter-spacing: .01em;
}

/* Action buttons in rows */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
}

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
.form-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.form-control, .form-select {
    border: 1px solid #e3e7ee;
    border-radius: var(--radius-sm);
    padding: .55rem .8rem;
    font-size: .9rem;
    color: var(--text);
    background: #fff;
}

.form-control::placeholder {
    color: #b4bac7;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: none;
}

.form-control:disabled, .form-control[readonly] {
    background: #f8f9fc;
    color: var(--muted);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .88rem;
    padding: .5rem 1rem;
    transition: all .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    font-size: .82rem;
    padding: .35rem .7rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

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

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-warning {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-dark {
    background: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
}

.btn-outline-dark {
    border-color: #d7dce4;
    color: var(--text);
}

.btn-outline-dark:hover {
    background: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
}

.btn.loading {
    pointer-events: none;
    opacity: .75;
    color: transparent !important;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------
   Alerts / pagination / modal
   --------------------------------------------------------- */
.alert {
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: .88rem;
}

.pagination {
    gap: 4px;
}

.page-link {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm) !important;
    color: var(--text);
    font-size: .85rem;
    padding: .4rem .75rem;
}

.page-link:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.modal-content {
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(16, 24, 40, .2);
}

.swal2-popup {
    border-radius: var(--radius) !important;
}

.swal2-confirm {
    background: var(--danger) !important;
    border-radius: var(--radius-sm) !important;
}

/* Toastr alignment with the new shell */
#toast-container {
    z-index: 1090;
}

/* ---------------------------------------------------------
   Trainer / member avatar
   --------------------------------------------------------- */
.trainer-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 2.2rem;
}

.admin-footer {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    padding: 20px 22px;
    border-top: 1px solid var(--card-border);
}

/* ---------------------------------------------------------
   Settings boxes
   --------------------------------------------------------- */
.settings-box {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.settings-box .card-header {
    justify-content: flex-start;
    gap: 12px;
}

.settings-box .box-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
    background: var(--accent-soft);
    color: var(--accent);
}

.settings-box .box-icon.i-primary { background: rgba(60, 146, 227, .12); color: var(--primary); }
.settings-box .box-icon.i-purple { background: rgba(111, 94, 249, .12); color: var(--purple); }
.settings-box .box-icon.i-success { background: rgba(26, 188, 156, .13); color: var(--success); }
.settings-box .box-icon.i-info { background: rgba(23, 201, 233, .14); color: var(--info); }

.settings-box .box-title {
    font-size: .98rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.settings-box .box-sub {
    font-size: .76rem;
    color: var(--muted);
    font-weight: 400;
}

.settings-box .card-body {
    flex: 1 1 auto;
}

.field-hint {
    font-size: .74rem;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}

.logo-preview {
    width: 84px;
    height: 84px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: #fff;
    padding: 6px;
}

/* Sticky save bar */
.save-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: 0 -4px 20px rgba(16, 24, 40, .08);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------
   DataTable
   --------------------------------------------------------- */
.dt-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.dt-search {
    max-width: 280px;
}

.dt-length {
    max-width: 110px;
    margin-left: auto;
}

/* Sortable headers */
.dt-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.dt-sortable:hover {
    color: var(--accent);
}

.dt-sort-icon {
    font-size: .6rem;
    opacity: .35;
    margin-left: 4px;
}

.dt-sortable.sorted .dt-sort-icon {
    opacity: 1;
    color: var(--accent);
}

/* Info + pager */
.dt-info {
    font-size: .8rem;
    color: var(--muted);
    padding: 12px 18px 0;
}

.dt-pager {
    padding: 10px 18px 14px;
    margin: 0;
    flex-wrap: wrap;
}

/* Cards without a table still need the toolbar spacing balanced */
.card > .dt-toolbar:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* Reclaim space before the topbar gets cramped */
    .topbar-search {
        display: none;
    }
}

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

    .shell-sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .shell-sidebar {
        transform: translateX(0);
    }

    .shell-main {
        margin-left: 0;
    }

    /* The icon rail is desktop-only - never apply it below this breakpoint */
    body.sidebar-collapsed {
        --sidebar-w: 250px;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
        padding: 20px 20px 18px;
    }

    body.sidebar-collapsed .sidebar-brand .brand-text,
    body.sidebar-collapsed .nav-caption,
    body.sidebar-collapsed .side-nav a .side-label {
        display: initial;
    }

    body.sidebar-collapsed .side-nav a::after {
        display: none;
    }

    body.sidebar-collapsed .side-nav a {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    .sidebar-scroll {
        padding: 14px 12px 24px;
    }

    .topbar-search {
        display: none;
    }
}

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

    .content {
        padding: 14px;
    }

    .topbar {
        padding: 10px 14px;
        gap: 8px;
        min-height: 58px;
    }

    .topbar-title {
        font-size: .95rem;
    }

    .topbar-actions {
        gap: 6px;
    }

    .user-chip {
        max-width: 40px;
        padding: 0 4px;
        gap: 0;
    }

    .user-chip .meta {
        display: none;
    }

    .table thead th, .table tbody td {
        font-size: .8rem;
        padding: .55rem .6rem;
    }
}