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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1e1b2e;
    background: var(--color-page);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: var(--color-primary-tint);
    color: var(--color-primary-hover);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.topbar { background: var(--color-primary); color: #fff; }

.topbar__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 700;
}

.page { padding: 48px 0; }

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    background: #fff;
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 16px;
    padding: 32px;
    max-width: 560px;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
}

h1 {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.lead { margin: 0 0 24px; color: #4b475e; }

.checks {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(124, 58, 237, 0.12);
}

.checks li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}

.checks__label { color: #4b475e; }
.checks__value { font-weight: 600; }

.hint {
    margin: 24px 0 0;
    padding: 12px 16px;
    background: var(--color-primary-tint);
    border-radius: 10px;
    font-size: 14px;
    color: var(--color-primary-hover);
}

.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
}

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

.footer { padding: 24px 0; color: #8b8798; font-size: 13px; }

@media (max-width: 560px) {
    .card { padding: 24px; }
    h1 { font-size: 24px; }
}

/* ---- Header user / actions ---- */
.topbar__inner { display: flex; align-items: center; justify-content: space-between; }
.topbar__user { display: flex; align-items: center; gap: 14px; }
.topbar__name { color: #fff; font-size: 14px; font-weight: 500; opacity: 0.95; }

.btn--ghost {
    background: rgba(255, 255, 255, 0.16);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.26); }

.muted { color: #6b6780; margin: 0 0 20px; }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin: 0 0 20px;
}
.alert--error { background: #fde8e8; color: #9b1c1c; }
.alert--success { background: #e6f6ec; color: #0f6b3a; }

/* ---- Forms ---- */
.form { margin: 8px 0 0; }
.field { display: block; margin: 0 0 16px; }
.field__label { display: block; font-size: 14px; font-weight: 500; color: #4b475e; margin: 0 0 6px; }
.field input {
    width: 100%;
    padding: 11px 13px;
    font-size: 15px;
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 10px;
    background: #fff;
    color: #1e1b2e;
}
.field input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-tint);
}
.btn--block { width: 100%; text-align: center; border: none; cursor: pointer; font-size: 15px; }

/* ---- Guest auth pages ---- */
.auth-body { background: var(--color-page); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
    background: #fff;
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
}
.auth-brand {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; margin: 0 0 24px; text-align: center;
}
.auth-brand__logo {
    max-height: 80px; max-width: 200px; object-fit: contain; display: block;
}
.auth-brand__initial {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 16px;
    background: var(--color-primary); color: #fff;
    font-size: 28px; font-weight: 700;
}
.auth-brand__name {
    margin: 0; font-size: 18px; font-weight: 700; color: var(--color-primary);
}
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }

/* ====== Admin shell ====== */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: #1e1b2e;
    color: #d6d3e0;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
}
.sidebar__brand {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
    padding: 20px 8px 18px; text-align: center; line-height: 1.2;
}
.sidebar__brand .brand__mark {
    background: var(--color-primary); color: #fff;
    width: 52px; height: 52px; border-radius: 14px; font-size: 22px;
}
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.navlabel {
    margin: 16px 8px 6px; font-size: 11px; letter-spacing: 0.1em;
    text-transform: uppercase; color: #7c7892;
}
.navlink {
    display: block; padding: 9px 12px; border-radius: 9px;
    color: #cfcbdd; text-decoration: none; font-size: 14px; font-weight: 500;
}
.navlink:hover { background: rgba(255,255,255,0.06); color: #fff; }
.navlink.is-active { background: var(--color-primary); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar--admin {
    background: #fff; color: #1e1b2e;
    border-bottom: 1px solid rgba(124,58,237,0.12);
    display: flex; align-items: center;
}
.topbar--admin .topbar__name { color: #1e1b2e; }
.topbar__spacer { flex: 1; }
.iconbtn {
    display: none; background: none; border: none; font-size: 22px;
    color: #1e1b2e; cursor: pointer; padding: 4px 8px; margin-right: 8px;
}
.btn--ghost-dark {
    background: var(--color-primary-tint); color: var(--color-primary-hover);
    padding: 8px 14px; border-radius: 9px; font-size: 14px; border: none; cursor: pointer;
}
.btn--ghost-dark:hover { background: #e0d7fb; }

.content { padding: 28px; max-width: 1100px; width: 100%; }

.shell__backdrop { display: none; }

/* ====== Page header / toolbar ====== */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.pagehead h1 { margin: 0 0 4px; font-size: 24px; }
.toolbar { margin: 0 0 16px; }
.search {
    width: 100%; max-width: 360px; padding: 10px 14px; font-size: 15px;
    border: 1px solid rgba(124,58,237,0.25); border-radius: 10px; background: #fff;
}
.search:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-tint); }

/* ====== Tables ====== */
.tablewrap { background: #fff; border: 1px solid rgba(124,58,237,0.12); border-radius: 14px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
    text-align: left; padding: 12px 16px; font-size: 12px; letter-spacing: 0.04em;
    text-transform: uppercase; color: #6b6780; background: #faf9fd; border-bottom: 1px solid rgba(124,58,237,0.1);
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid rgba(124,58,237,0.07); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody.is-loading { opacity: 0.5; }
.table__empty { text-align: center; color: #8b8798; padding: 28px 16px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge--on { background: #e6f6ec; color: #0f6b3a; }
.badge--off { background: #f0eef5; color: #6b6780; }

.row-actions { display: flex; gap: 14px; align-items: center; }
.link { color: var(--color-primary); text-decoration: none; font-weight: 500; background: none; border: none; cursor: pointer; font-size: 14px; padding: 0; }
.link:hover { text-decoration: underline; }
.link--danger { color: #c0392b; }
.row-actions form { display: inline; }

/* ====== Forms (cards / grid) ====== */
.card--form { max-width: 640px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { margin-top: 8px; display: flex; gap: 10px; }
.btn { display: inline-block; background: var(--color-primary); color: #fff; text-decoration: none; padding: 10px 18px; border-radius: 10px; font-weight: 600; border: none; cursor: pointer; font-size: 15px; }

/* ====== Tom Select theming ====== */
.ts-wrapper { margin: 0; }
.ts-control {
    border: 1px solid rgba(124,58,237,0.25) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    min-height: 44px;
    box-shadow: none !important;
}
.ts-wrapper.focus .ts-control { border-color: var(--color-primary) !important; box-shadow: 0 0 0 3px var(--color-primary-tint) !important; }
.ts-dropdown { border: 1px solid rgba(124,58,237,0.2); border-radius: 10px; box-shadow: 0 8px 24px rgba(30,27,46,0.12); }
.ts-dropdown .active { background: var(--color-primary-tint); color: var(--color-primary-hover); }
.ts-dropdown .option { padding: 9px 12px; }

/* ====== Responsive ====== */
@media (max-width: 860px) {
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
        transform: translateX(-100%); transition: transform 0.2s ease;
    }
    .shell--open .sidebar { transform: translateX(0); }
    .shell--open .shell__backdrop {
        display: block; position: fixed; inset: 0; z-index: 30; background: rgba(30,27,46,0.4);
    }
    .iconbtn { display: inline-block; }
    .content { padding: 20px 16px; }
    .grid2 { grid-template-columns: 1fr; }
}

/* ====== Form sections ====== */
.formsection {
    margin: 22px 0 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--color-primary);
    border-bottom: 1px solid rgba(124,58,237,0.12); padding-bottom: 6px;
}
.formsection:first-child { margin-top: 0; }

/* ====== Detail (definition list) ====== */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
.detail > div { padding: 12px 4px; border-bottom: 1px solid rgba(124,58,237,0.08); }
.detail dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #8b8798; margin: 0 0 3px; }
.detail dd { margin: 0; font-size: 15px; color: #1e1b2e; }

.badge--warn { background: #fdf0e3; color: #9a5b00; }

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

/* ====== Member avatar / cells ====== */
.membercell { display: inline-flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 32px; }
.avatar--placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-primary-tint); color: var(--color-primary-hover);
    font-size: 12px; font-weight: 600;
}
.avatar--lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 18px; }
.member-head { display: flex; align-items: center; gap: 14px; }

.check { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; font-size: 15px; }
.check input { width: 18px; height: 18px; }
.filenote { display: block; font-size: 12px; color: #8b8798; font-weight: 400; margin-top: 4px; }

/* ====== Responsive tables: stack into cards on phones ====== */
@media (max-width: 640px) {
    .tablewrap { border: none; background: transparent; border-radius: 0; overflow: visible; }
    .table { font-size: 14px; }
    .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tbody tr {
        background: #fff; border: 1px solid rgba(124,58,237,0.14); border-radius: 12px;
        padding: 4px 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(30,27,46,0.04);
    }
    .table tbody td {
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        padding: 10px 0; border-bottom: 1px solid rgba(124,58,237,0.07); text-align: right;
    }
    .table tbody tr td:last-child { border-bottom: none; }
    .table tbody td::before {
        content: attr(data-label); text-align: left; flex: 0 0 42%;
        font-size: 12px; font-weight: 800; letter-spacing: 0.04em;
        text-transform: uppercase; color: #3a3452; min-width: 90px;
        padding-right: 8px; word-break: break-word;
    }
    .table tbody td[data-label=""]::before, .table tbody td:not([data-label])::before { display: none; }
    .table tbody td:not([data-label])::before { display: none; }
    .table td.table__empty { display: block; text-align: center; padding: 18px 0; }
    .table td.table__empty::before { content: ''; display: none; }
    .table td.row-actions { justify-content: flex-end; gap: 18px; }
    .membercell { justify-content: flex-end; }
}

/* ====== Dashboard cards ====== */
.dashgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.dashcard {
    background: #fff; border-radius: 14px; padding: 22px 20px;
    border: 1px solid rgba(124,58,237,0.12); text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dashcard:hover { border-color: var(--color-primary); box-shadow: 0 2px 10px rgba(124,58,237,0.1); }
.dashcard__label { display: block; font-size: 16px; font-weight: 600; color: #1e1b2e; margin-bottom: 4px; }
.dashcard__desc { display: block; font-size: 13px; color: #8b8798; }

/* ====== Account type cards ====== */
.acctgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.acctcard {
    background: #fff; border-radius: 14px; padding: 20px;
    border: 1px solid rgba(124,58,237,0.12);
}
.acctcard__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.acctcard__name { font-size: 16px; font-weight: 600; color: #1e1b2e; margin: 0; }
.acctcard__prefix { font-size: 12px; color: #8b8798; margin: 0 0 12px; }
.acctcard__stats { display: flex; gap: 20px; margin-bottom: 14px; padding-top: 12px; border-top: 1px solid rgba(124,58,237,0.08); }
.acctcard__stats > div { text-align: center; flex: 1; }
.acctcard__num { display: block; font-size: 15px; font-weight: 600; color: var(--color-primary); }
.acctcard__label { display: block; font-size: 11px; color: #8b8798; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }
.acctcard__actions { display: flex; gap: 16px; padding-top: 10px; border-top: 1px solid rgba(124,58,237,0.08); }
.acctcard--frozen { opacity: 0.7; border-color: #f0c040; }
.freeze-form { display: flex; align-items: center; gap: 8px; }

/* ====== Action dropdown ====== */
.dropdown { position: relative; display: inline-block; }
.dropdown__trigger {
    background: #fff; border: 1px solid rgba(124,58,237,0.18); border-radius: 8px;
    padding: 5px 14px; font-size: 13px; cursor: pointer; color: var(--color-primary);
    font-weight: 500; white-space: nowrap; transition: border-color 0.15s;
}
.dropdown__trigger:hover { border-color: var(--color-primary); }
.dropdown__menu {
    display: none; position: absolute; right: 0; top: calc(100% + 4px);
    background: #fff; border: 1px solid rgba(124,58,237,0.14); border-radius: 10px;
    box-shadow: 0 6px 20px rgba(30,27,46,0.12); min-width: 140px; z-index: 50;
    padding: 6px 0; overflow: hidden;
}
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__item {
    display: block; width: 100%; padding: 9px 16px; font-size: 14px; text-align: left;
    background: none; border: none; cursor: pointer; color: #1e1b2e; text-decoration: none;
    transition: background 0.1s;
}
.dropdown__item:hover { background: var(--color-primary-tint); }
.dropdown__item--danger { color: #c0392b; }
.dropdown__item--danger:hover { background: #fbeaea; }

/* ====== Custom confirm modal ====== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(30,27,46,0.45);
    z-index: 999; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.is-active { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; padding: 28px 24px 20px; max-width: 380px; width: 100%;
    box-shadow: 0 10px 40px rgba(30,27,46,0.2); text-align: center;
}
.modal-box__icon { font-size: 36px; margin-bottom: 8px; }
.modal-box__title { font-size: 17px; font-weight: 600; color: #1e1b2e; margin: 0 0 8px; }
.modal-box__text { font-size: 14px; color: #6b6780; margin: 0 0 22px; line-height: 1.5; }
.modal-box__actions { display: flex; gap: 10px; justify-content: center; }
.modal-box__btn {
    padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 500;
    border: none; cursor: pointer; transition: background 0.15s;
}
.modal-box__btn--cancel { background: #f0eef5; color: #4a4560; }
.modal-box__btn--cancel:hover { background: #e4e1ed; }
.modal-box__btn--confirm { background: #c0392b; color: #fff; }
.modal-box__btn--confirm:hover { background: #a93226; }

/* ====== Month grid ====== */
.monthgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 10px; }
.check--sm { font-size: 13px; }
.check--sm input { width: 15px; height: 15px; }

/* ====== Improved mobile responsive (phone-specific) ====== */
@media (max-width: 640px) {
    /* Page head stacks vertically */
    .pagehead { flex-direction: column; align-items: flex-start; gap: 12px; }
    .pagehead h1 { font-size: 20px; }
    .pagehead .btn { font-size: 13px; padding: 8px 14px; }

    /* Cards and forms tighter */
    .card--form { padding: 16px; }

    /* Member profile head stacks */
    .member-head { flex-direction: column; text-align: center; gap: 8px; }

    /* Account + dashboard grids single col */
    .acctgrid { grid-template-columns: 1fr; }
    .acctcard__stats { flex-wrap: wrap; gap: 10px; }
    .dashgrid { grid-template-columns: 1fr; }

    /* Toolbar */
    .toolbar { padding: 0 4px; }
    .search { font-size: 14px; }

    /* Detail list single col */
    .detail { grid-template-columns: 1fr; }

    /* Form section headers */
    .formsection { font-size: 12px; }

    /* Row actions */
    .row-actions { justify-content: flex-start !important; }

    /* Dropdown: flip to left on small screens */
    .dropdown__menu { right: auto; left: 0; }

    /* Freeze form wraps */
    .freeze-form { flex-wrap: wrap; }
    .freeze-form input { max-width: 100% !important; width: 100%; }

    /* Month grid 3-col on phones */
    .monthgrid { grid-template-columns: repeat(3, 1fr); }

    /* Full-width submit buttons */
    .form-actions .btn { width: 100%; }
    .btn--block { padding: 12px; }
}

@media (max-width: 400px) {
    .content { padding: 14px 10px; }
    .card { padding: 14px; }
    .acctcard { padding: 14px; }
    .monthgrid { grid-template-columns: repeat(2, 1fr); }
}
.modal-box__btn--primary { background: var(--color-primary); color: #fff; }
.modal-box__btn--primary:hover { background: var(--color-primary-hover); }

/* ====== Filter bar ====== */
.filterbar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-bottom: 16px; padding: 12px 14px;
    background: #fff; border: 1px solid rgba(124,58,237,0.12); border-radius: 12px;
}
.filterbar input, .filterbar select { font-size: 13px; padding: 7px 10px; border: 1px solid #ddd; border-radius: 8px; }
.filterbar .search--sm { flex: 1; min-width: 160px; }
.btn--sm { padding: 7px 16px; font-size: 13px; }
.txt-right { text-align: right; }
.txt-lg { font-size: 18px; font-weight: 600; color: var(--color-primary); }

@media (max-width: 640px) {
    .filterbar { flex-direction: column; }
    .filterbar input, .filterbar select, .filterbar .btn--sm { width: 100%; }
}

.btn--danger { background: #c0392b; border-color: #c0392b; color: #fff; }
.btn--danger:hover { background: #a93226; border-color: #a93226; }
.card--warn { border-color: #f0c040; }

.approval-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.reject-form { display: flex; gap: 6px; align-items: center; }

.row--error { background: #fdf0e3; }
.row--error td { color: #9a5b00; }

/* ====== Tab bar ====== */
.tabbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid rgba(124,58,237,0.12); }
.tab { padding: 9px 14px; font-size: 14px; color: #6b6780; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--color-primary); }
.tab--active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 500; }
.tab__count { display: inline-block; min-width: 18px; padding: 1px 6px; font-size: 11px; background: #f0eef5; border-radius: 9px; text-align: center; }
.tab--active .tab__count { background: var(--color-primary-tint); }
@media (max-width: 640px) { .tabbar { overflow-x: auto; flex-wrap: nowrap; } }

/* ====== Loan application ====== */
.infobox { background: var(--color-primary-tint); border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; color: #4a4560; }
.guarantor-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.guarantor-row .g-num { flex: 0 0 160px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; }
.guarantor-row .g-name { flex: 1; min-width: 120px; font-size: 13px; }
.guarantor-row .g-pct { flex: 0 0 90px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; }
.guarantor-row .g-amt { flex: 0 0 120px; font-size: 13px; }
.table--compact td, .table--compact th { padding: 6px 10px; font-size: 13px; }
@media (max-width: 640px) { .guarantor-row .g-num, .guarantor-row .g-pct { flex: 1 1 100%; } }

/* ====== Timeline ====== */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid rgba(124,58,237,0.18); position: relative; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--color-primary); }
.timeline li .muted { font-size: 12px; }

/* ====== Permission groups ====== */
.permgroup { border: 1px solid rgba(124,58,237,0.12); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.permgroup__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(124,58,237,0.08); }
.permgroup__all { font-size: 12px; color: #6b6780; font-weight: normal; }
.permgroup__items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; }
@media (max-width: 640px) { .permgroup__items { grid-template-columns: 1fr; } }

/* ====== Dashboard ====== */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.statcard {
    background: #fff; border: 1px solid rgba(124,58,237,0.12); border-radius: 14px; padding: 18px;
    display: flex; flex-direction: column; gap: 4px;
}
.statcard--accent { background: linear-gradient(135deg, var(--color-primary), #9d5cf0); border: none; }
.statcard--accent .statcard__label, .statcard--accent .statcard__value, .statcard--accent .statcard__sub { color: #fff; }
.statcard--warn { border-color: #f0c040; background: #fffbf0; }
.statcard__label { font-size: 13px; color: #6b6780; }
.statcard__value { font-size: 26px; font-weight: 600; color: #1e1b2e; line-height: 1.1; }
.statcard__sub { font-size: 12px; color: #8a8699; }
.statcard--accent .statcard__sub { opacity: 0.85; }

.dashcols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.dashcol { display: flex; flex-direction: column; gap: 16px; }
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

@media (max-width: 860px) { .statgrid { grid-template-columns: repeat(2, 1fr); } .dashcols { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .statgrid { grid-template-columns: 1fr; } }

/* ====== Notifications ====== */
.notiflist { list-style: none; margin: 0; padding: 0; }
.notifitem { border-bottom: 1px solid rgba(124,58,237,0.08); }
.notifitem:last-child { border-bottom: none; }
.notifitem__form { margin: 0; }
.notifitem__btn { width: 100%; background: none; border: none; cursor: pointer; text-align: left; padding: 14px 6px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.notifitem__btn:hover { background: var(--color-primary-tint); }
.notifitem--unread .notifitem__btn { background: #f6f2ff; }
.notifitem--unread .notifitem__title::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--color-primary); border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.notifitem__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notifitem__title { font-weight: 600; font-size: 14px; color: #1e1b2e; }
.notifitem__msg { font-size: 13px; color: #6b6780; }
.notifitem__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; font-size: 11px; }

/* Bell */
.bell { position: relative; display: inline-block; }
.bell__btn { background: none; border: none; cursor: pointer; font-size: 20px; position: relative; padding: 6px; color: #4a4560; line-height: 1; }
.bell__badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px; background: #c0392b; color: #fff; border-radius: 8px; font-size: 10px; line-height: 16px; text-align: center; font-weight: 600; }
.bell__menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); width: 320px; max-width: 90vw; background: #fff; border: 1px solid rgba(124,58,237,0.14); border-radius: 12px; box-shadow: 0 10px 30px rgba(30,27,46,0.15); z-index: 80; overflow: hidden; }
.bell.is-open .bell__menu { display: block; }
.bell__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid rgba(124,58,237,0.1); font-size: 13px; }
.bell__list { max-height: 360px; overflow-y: auto; }
.bell__item { display: block; padding: 10px 14px; border-bottom: 1px solid rgba(124,58,237,0.06); text-decoration: none; color: #1e1b2e; }
.bell__item:hover { background: var(--color-primary-tint); }
.bell__item--unread { background: #f6f2ff; }
.bell__item-title { font-size: 13px; font-weight: 600; display: block; }
.bell__item-msg { font-size: 12px; color: #6b6780; display: block; }
.bell__item-time { font-size: 11px; color: #8a8699; }
.bell__foot { padding: 10px 14px; text-align: center; }
.bell__empty { padding: 24px 14px; text-align: center; color: #8a8699; font-size: 13px; }

/* ====== Reports ====== */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.report-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid rgba(124,58,237,0.12); border-radius: 10px; text-decoration: none; color: #1e1b2e; transition: border-color 0.15s, box-shadow 0.15s; }
.report-card:hover { border-color: var(--color-primary); box-shadow: 0 2px 8px rgba(124,58,237,0.10); }
.report-card__name { font-weight: 600; font-size: 14px; }
.report-card__desc { font-size: 12px; color: #6b6780; }
@media (max-width: 860px) { .report-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .report-grid { grid-template-columns: 1fr; } }
@media print { .topbar, .sidebar, .shell__backdrop, .pagehead .row-actions, .filterbar, .btn { display: none !important; } .shell__main { margin-left: 0 !important; } .tablewrap { overflow: visible; } }

/* ====== Nav badge ====== */
.nav-badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; background: #c0392b; color: #fff; border-radius: 9px; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; margin-left: 6px; vertical-align: middle; }

/* ====== Nav icons ====== */
.nav-icon { width: 16px; height: 16px; vertical-align: -2px; margin-right: 6px; opacity: 0.7; flex-shrink: 0; }
.navlink:hover .nav-icon, .navlink.is-active .nav-icon { opacity: 1; }

/* ====== Topbar avatar ====== */
.topbar__avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary); color: #fff; font-weight: 700; font-size: 14px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.topbar__avatar:hover { opacity: 0.85; }
