/* ─── TAMRIS enterprise look ────────────────────────────────────────────────
 * Visual layer only, loaded after the Apollo theme. It restyles the existing
 * markup (sidebar, top bar, cards, tables) and adds a few shared components
 * (.ent-hero, .kpi, .panel, .pill, .person, .row-btn, .status-tabs) used by
 * the dashboards, user lists and board report. No behaviour depends on it.
 */

:root {
    --brand: #238781;
    --brand-dark: #19625e;
    --brand-deep: #0b3b3a;
    --brand-soft: #e6f4f3;
    --accent: #f59e0b;
    --ink: #0f172a;
    --body: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --page: #f4f6fb;
    --red: #dc2626;    --red-soft: #fef2f2;
    --amber: #b45309;  --amber-soft: #fffbeb;
    --sky: #0369a1;    --sky-soft: #f0f9ff;
    --green: #047857;  --green-soft: #ecfdf5;
    --violet: #6d28d9; --violet-soft: #f5f3ff;
    --slate-soft: #f1f5f9;
    --side-bg: linear-gradient(180deg, #0f172a 0%, #0f2133 55%, #0b3b3a 100%);
    --side-fg: #cbd5e1;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { font-family: var(--font); background: var(--page) !important; color: var(--body); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--font); color: var(--ink); letter-spacing: -.01em; }
.app-container { background: var(--page); }
.num { font-variant-numeric: tabular-nums; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar-wrapper {
    background: var(--side-bg) !important;
    box-shadow: none !important;
    border-right: 1px solid rgba(255, 255, 255, .06);
    display: flex; flex-direction: column;
    font-family: var(--font);
}
.sidebar-wrapper .brand-container { border-bottom: 1px solid rgba(255, 255, 255, .07); min-height: 64px; flex-shrink: 0; }
.sidebar-wrapper .app-brand a { gap: .2rem; }
.sb-mark {
    width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
    display: grid; place-items: center; color: #fff; font-size: 1.15rem;
    background: linear-gradient(135deg, #2dd4bf, var(--brand) 55%, var(--brand-deep));
    box-shadow: 0 8px 20px rgba(45, 212, 191, .28);
}
.sb-name { color: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1.1; white-space: nowrap; }
.sb-name small { display: block; font-weight: 500; font-size: .68rem; color: #94a3b8; letter-spacing: .02em; }
.sidebar-wrapper .pin-sidebar {
    width: 34px; height: 34px; border: 0; border-radius: 10px;
    background: rgba(255, 255, 255, .06); color: #94a3b8;
}
.sidebar-wrapper .pin-sidebar:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.sidebar-wrapper .sidebar-profile {
    flex-direction: row; justify-content: flex-start; text-align: left;
    padding: .8rem 1rem; margin: 0;
    border-top: 0; border-bottom: 1px solid rgba(255, 255, 255, .07);
    flex-shrink: 0;
}
.sb-user { display: flex; align-items: center; gap: .65rem; min-width: 0; width: 100%; color: #fff; text-decoration: none; padding: .3rem; border-radius: 12px; }
.sb-user:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sb-avatar {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 800; font-size: .9rem;
    background: rgba(45, 212, 191, .16); color: #5eead4; border: 1px solid rgba(45, 212, 191, .25);
    overflow: hidden;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-user-text { min-width: 0; line-height: 1.2; }
.sb-user-text strong { display: block; font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.sb-user-text small { display: block; font-size: .72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-wrapper .sidebarMenuScroll { flex: 1 1 auto; height: auto !important; min-height: 0; overflow-y: auto; padding: .35rem 0 1rem; }
.sidebar-wrapper .sidebar-menu > li.menu-header {
    color: #64748b !important; font-size: .64rem !important; letter-spacing: .1em;
    padding: .95rem 1.35rem .35rem !important; margin: 0 !important;
}
.sidebar-wrapper .sidebar-menu > li > a {
    color: var(--side-fg); background: transparent;
    margin: 1px .65rem; padding: .5rem .75rem;
    border-radius: 10px; font-size: .875rem; font-weight: 500;
    transition: background .15s, color .15s;
}
.sidebar-wrapper .sidebar-menu > li > a:hover { padding-left: .75rem; }
.sidebar-wrapper .sidebar-menu > li > a > i {
    background: transparent; color: #94a3b8;
    width: 22px; height: 22px; margin-right: .7rem; font-size: 1.05rem; border-radius: 0;
}
.sidebar-wrapper .sidebar-menu > li:hover > a,
.sidebar-wrapper .sidebar-menu > li.active > a { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-wrapper .sidebar-menu > li:hover > a i,
.sidebar-wrapper .sidebar-menu > li.active > a i { background: transparent; color: #5eead4; }
.sidebar-wrapper .sidebar-menu > li.current-page > a {
    background: rgba(45, 212, 191, .16); color: #fff; font-weight: 600;
    box-shadow: inset 3px 0 0 #2dd4bf;
}
.sidebar-wrapper .sidebar-menu > li.current-page > a i { background: transparent; color: #5eead4; }
.sidebar-wrapper .sidebar-menu > li.treeview > a:after { color: #64748b; top: 50%; margin-top: -.6rem; right: .9rem; font-size: .9rem; }
.sidebar-wrapper .sidebar-menu > li.treeview.active > a:after { color: #5eead4; }
.sidebar-wrapper .sidebar-menu .treeview-menu { padding: .15rem 0 .4rem; }
.sidebar-wrapper .sidebar-menu .treeview-menu > li { margin: 0 .65rem 0 2.35rem; }
.sidebar-wrapper .sidebar-menu .treeview-menu > li > a {
    color: #94a3b8; white-space: normal; line-height: 1.3;
    padding: .42rem .7rem .42rem .9rem; font-size: .83rem;
    border-left: 1px solid rgba(255, 255, 255, .09); border-radius: 0 8px 8px 0;
}
.sidebar-wrapper .sidebar-menu .treeview-menu > li > a:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.sidebar-wrapper .sidebar-menu .treeview-menu > li > a.current-sub {
    color: #fff; font-weight: 600; background: rgba(45, 212, 191, .12); border-left: 2px solid #2dd4bf;
}
.sidebar-wrapper .sidebar-menu .badge { border-radius: 999px; font-size: .68rem; font-weight: 700; padding: .25em .55em; }
.sidebar-wrapper .sidebar-menu > li.menu-header { text-transform: uppercase; font-weight: 800; }
.sidebar-wrapper .sidebar-menu > li.menu-header:not(:first-child) { margin-top: .35rem !important; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-wrapper .sidebar-menu > li > a { display: flex; align-items: center; }
.sidebar-wrapper .sidebar-menu > li.treeview > a { padding-right: 2.1rem; }
.sidebar-wrapper .sidebar-menu > li.treeview > a .sb-badge { margin-right: .15rem; }
/* Badges on the dark sidebar: solid, so the number reads at a glance */
.sb-badge { min-width: 1.45rem; text-align: center; line-height: 1.1; }
.sb-badge.tone-red    { background: #ef4444 !important; color: #fff !important; }
.sb-badge.tone-amber  { background: #f59e0b !important; color: #111827 !important; }
.sb-badge.tone-sky    { background: #38bdf8 !important; color: #0c4a6e !important; }
.sb-badge.tone-green  { background: #34d399 !important; color: #064e3b !important; }
.sb-badge.tone-brand  { background: #2dd4bf !important; color: #134e4a !important; }
.page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-menu > li.menu-header { font-size: 0 !important; padding: .4rem 0 !important; }
.sidebar-wrapper .sidebar-contact {
    margin: .75rem; padding: .75rem .9rem; border-radius: 12px; flex-shrink: 0;
    background: rgba(255, 255, 255, .05) !important; border: 1px solid rgba(255, 255, 255, .08); color: #cbd5e1;
}
.sidebar-wrapper .sidebar-contact p { color: #94a3b8 !important; }
.sidebar-wrapper .sidebar-contact h5 { color: #fff !important; font-size: 1rem; }
.sidebar-wrapper .sidebar-contact { position: relative; padding-right: 3.2rem !important; }
.sidebar-wrapper .sidebar-contact i {
    color: #5eead4 !important; position: absolute !important; right: .9rem !important; left: auto !important;
    top: 50% !important; bottom: auto !important; transform: translateY(-50%); font-size: 1.35rem !important;
    margin: 0 !important; width: 2rem; height: 2rem; display: grid; place-items: center;
    border-radius: 10px; background: rgba(94, 234, 212, .12);
}
.page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sb-name,
.page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sb-user-text,
.page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-contact { display: none !important; }

/* ── Top bar ────────────────────────────────────────────────────────────── */
.app-header {
    background: rgba(255, 255, 255, .92) !important; backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line); min-height: 64px; gap: .75rem;
}
.app-header .toggle-sidebar {
    width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); display: grid; place-items: center;
}
.tb-title { min-width: 0; }
.tb-title h1 { font-size: 1.05rem; font-weight: 800; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title small { display: block; font-size: .74rem; color: var(--muted); }
.tb-btn {
    position: relative; width: 40px; height: 40px; border-radius: 12px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--line); background: #fff; color: var(--body); font-size: 1.1rem;
    text-decoration: none; transition: border-color .15s, color .15s, background .15s;
}
.tb-btn:hover { color: var(--brand); border-color: #a7d7d3; background: var(--brand-soft); }
.tb-count {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 99px; display: grid; place-items: center;
    font-size: .68rem; font-weight: 800; background: var(--red); color: #fff; border: 2px solid #fff;
}
.tb-user { display: flex; align-items: center; gap: .55rem; padding: .25rem .35rem .25rem .25rem; border-radius: 14px; text-decoration: none; color: var(--ink); }
.tb-user:hover, .tb-user[aria-expanded="true"] { background: var(--slate-soft); color: var(--ink); }
.tb-avatar {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; font-weight: 800;
}
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tb-user-text { line-height: 1.15; max-width: 180px; }
.tb-user-text strong { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-user-text small { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-menu { border: 1px solid var(--line) !important; border-radius: 16px !important; box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .25) !important; padding: .5rem !important; min-width: 250px; }
.tb-menu .dropdown-item { border-radius: 10px; padding: .55rem .75rem; display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.tb-menu .dropdown-item i { color: var(--muted); font-size: 1.05rem; }
.tb-menu .dropdown-item:hover i { color: var(--brand); }
.tb-menu .tb-menu-head { padding: .6rem .75rem .7rem; }
.app-footer { color: var(--muted); padding: 1rem 1.5rem !important; font-size: .78rem !important; background: transparent; }

/* ── Page content ───────────────────────────────────────────────────────── */
.app-body { padding: 1.25rem 1.5rem 2rem; }
@media (max-width: 767.98px) { .app-body { padding: 1rem .75rem 1.5rem; } }
.card { border: 1px solid #edf0f5; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -18px rgba(15, 23, 42, .18); }
.btn { border-radius: 10px; font-weight: 600; }
.btn-sm { border-radius: 8px; }
.form-control, .form-select { border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(35, 135, 129, .12); }

/* Page hero band */
.ent-hero {
    position: relative; overflow: hidden; border-radius: 20px;
    padding: 1.6rem 1.75rem 1.45rem; margin-bottom: 1.25rem; color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #0f2a3a 45%, var(--brand-dark) 100%);
}
.ent-hero::after {
    content: ""; position: absolute; width: 380px; height: 380px; right: -130px; top: -170px; border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 212, 191, .45), transparent 70%); pointer-events: none;
}
.ent-hero::before {
    content: ""; position: absolute; width: 260px; height: 260px; left: -90px; bottom: -150px; border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, .25), transparent 70%); pointer-events: none;
}
.ent-hero > * { position: relative; z-index: 1; }
.ent-hero h1 { color: #fff; font-weight: 800; font-size: clamp(1.3rem, 2.6vw, 1.85rem); margin: 0; }
.ent-hero .hero-sub { color: #ccfbf1; font-size: .92rem; max-width: 46rem; }
.hero-chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px;
    font-size: .76rem; font-weight: 600; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); color: #e0f2f1;
}
.btn-hero { border-radius: 12px; font-weight: 700; padding: .55rem 1rem; }
.btn-hero-primary { background: #fff; color: var(--brand-dark); border: 0; }
.btn-hero-primary:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-hero-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.btn-hero-ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* KPI cards */
.kpi {
    display: block; height: 100%; padding: 1.05rem 1.15rem; border-radius: 16px;
    background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--body);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.kpi:hover { transform: translateY(-2px); border-color: #a7d7d3; box-shadow: 0 12px 26px -14px rgba(35, 135, 129, .45); color: var(--body); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .55rem; }
.kpi-chip { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-size: 1.1rem; }
.kpi-tag { font-size: .66rem; font-weight: 800; letter-spacing: .06em; color: #94a3b8; text-transform: uppercase; }
.kpi-value { font-size: 1.85rem; font-weight: 800; color: var(--ink); line-height: 1.1; letter-spacing: -.02em; }
.kpi-label { font-size: .84rem; font-weight: 700; color: var(--ink); }
.kpi-hint { font-size: .75rem; color: var(--muted); margin-top: .15rem; }
.kpi-trend { font-size: .74rem; font-weight: 700; }
.kpi-trend.up { color: var(--green); } .kpi-trend.down { color: var(--red); } .kpi-trend.flat { color: var(--muted); }

/* Tones */
.tone-red    { background: var(--red-soft);    color: var(--red); }
.tone-amber  { background: var(--amber-soft);  color: var(--amber); }
.tone-sky    { background: var(--sky-soft);    color: var(--sky); }
.tone-green  { background: var(--green-soft);  color: var(--green); }
.tone-brand  { background: var(--brand-soft);  color: var(--brand-dark); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-slate  { background: var(--slate-soft);  color: var(--muted); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .95rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1rem; font-weight: 800; margin: 0; }
.panel-head .hint, .hint { color: var(--muted); font-size: .8rem; }
.panel-body { padding: 1.15rem 1.25rem; }
.section-title { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 .75rem; }

/* Pills, people, row actions, tabs */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .62rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.pill i { font-size: .85em; }
.person { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); min-width: 0; }
.person .avatar {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
    font-weight: 800; font-size: .85rem; background: var(--brand-soft); color: var(--brand-dark);
}
.person .avatar.alt { background: var(--violet-soft); color: var(--violet); }
.person .avatar.muted { background: var(--slate-soft); color: var(--muted); }
.person strong { display: block; font-weight: 700; font-size: .9rem; }
.person .sub, .sub { color: var(--muted); font-size: .77rem; font-weight: 500; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.row-btn {
    height: 34px; min-width: 34px; padding: 0 .6rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--body); font-size: .8rem; font-weight: 700;
    text-decoration: none; white-space: nowrap;
}
.row-btn:hover { color: var(--brand-dark); border-color: #a7d7d3; background: var(--brand-soft); }
.row-btn.warn:hover { color: var(--amber); border-color: #fde68a; background: var(--amber-soft); }
.row-btn.success:hover { color: var(--green); border-color: #a7f3d0; background: var(--green-soft); }
.row-btn.danger:hover { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
.status-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.status-tabs a {
    display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 10px;
    font-size: .84rem; font-weight: 700; color: var(--muted); text-decoration: none; border: 1px solid transparent;
}
.status-tabs a:hover { background: #f8fafc; color: var(--ink); }
.status-tabs a.active { background: var(--brand-soft); color: var(--brand-dark); border-color: #a7d7d3; }
.status-tabs .count { font-size: .7rem; padding: .05rem .45rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); }

/* Tables inside panels */
.ent-table { width: 100%; margin: 0; font-size: .875rem; }
.ent-table thead th {
    font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
    background: #f8fafc; padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ent-table tbody td { padding: .8rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ent-table tbody tr:last-child td { border-bottom: 0; }
.ent-table tbody tr:hover { background: #fafcff; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { display: block; font-size: 2rem; opacity: .45; margin-bottom: .4rem; }

/* Bars and rings for reports */
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; margin-bottom: .7rem; }
.bar-row .bar-label { font-size: .84rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-value { font-size: .82rem; font-weight: 800; color: var(--ink); }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2dd4bf, var(--brand)); }
.bar-fill.amber { background: linear-gradient(90deg, #fcd34d, var(--accent)); }
.bar-fill.red { background: linear-gradient(90deg, #fca5a5, var(--red)); }
.bar-fill.sky { background: linear-gradient(90deg, #7dd3fc, var(--sky)); }
.ring {
    --size: 118px; --p: 0; --c: var(--brand);
    width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e8edf5 0);
}
.ring::before { content: ""; grid-area: 1 / 1; width: calc(var(--size) - 22px); height: calc(var(--size) - 22px); border-radius: 50%; background: var(--surface); }
.ring span { grid-area: 1 / 1; z-index: 1; font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.funnel-step { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.funnel-step:last-child { border-bottom: 0; }

/* ── Older pages: the same look without changing their markup ───────────── */
/* Tables */
.app-container .table { --bs-table-bg: transparent; margin-bottom: 0; color: var(--body); }
.app-container .table > thead > tr > th,
.app-container .table > thead th {
    background: #f8fafc !important; color: var(--muted) !important; font-size: .7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line) !important;
    padding: .7rem 1rem; white-space: nowrap;
}
.app-container .table > thead.table-dark > tr > th, .app-container .table-dark > thead > tr > th { color: var(--muted) !important; }
.app-container .table > tbody > tr > td { padding: .8rem 1rem; border-color: #eef2f7; vertical-align: middle; }
.app-container .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; --bs-table-bg-type: transparent; }
.app-container .table-hover > tbody > tr:hover > * { --bs-table-accent-bg: #f8fbfb; --bs-table-bg-state: #f8fbfb; }
.app-container .table-responsive { border-radius: inherit; }

/* Card headers: white, with a quiet title, whatever colour the page asked for */
.app-container .card-header { background: #fff !important; border-bottom: 1px solid var(--line) !important; padding: .9rem 1.25rem; border-radius: 16px 16px 0 0 !important; }
.app-container .card-header[class*="bg-"],
.app-container .card-header[class*="bg-"] > h1, .app-container .card-header[class*="bg-"] > h2, .app-container .card-header[class*="bg-"] > h3,
.app-container .card-header[class*="bg-"] > h4, .app-container .card-header[class*="bg-"] > h5, .app-container .card-header[class*="bg-"] > h6,
.app-container .card-header[class*="bg-"] .text-white, .app-container .card-header[class*="bg-"] > i, .app-container .card-header[class*="bg-"] h5 i { color: var(--ink) !important; }
.app-container .card-header h5, .app-container .card-header h6, .app-container .card-header .card-title { font-size: .98rem; font-weight: 800; margin-bottom: 0; }
.app-container .card-header i { color: var(--brand); }
.app-container .card-footer { background: #fff; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px !important; }
.app-container .card.border-0 { border: 1px solid #edf0f5 !important; }

/* Tabs and pills look like the status tabs */
.app-container .nav-pills, .app-container .nav-tabs { gap: .35rem; border: 0; flex-wrap: wrap; }
.app-container .nav-pills.bg-white { border: 1px solid var(--line); border-radius: 14px !important; box-shadow: none !important; }
.app-container .nav-pills .nav-link, .app-container .nav-tabs .nav-link {
    border: 0; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: .86rem; padding: .55rem .9rem;
}
.app-container .nav-pills .nav-link:hover, .app-container .nav-tabs .nav-link:hover { background: var(--slate-soft); color: var(--ink); }
.app-container .nav-pills .nav-link.active, .app-container .nav-tabs .nav-link.active { background: var(--brand-soft) !important; color: var(--brand-dark) !important; }
.app-container .nav-tabs { border-bottom: 1px solid var(--line); padding-bottom: .5rem; }

/* Soft badges */
.app-container .badge { font-weight: 700; border-radius: 999px; padding: .38em .7em; letter-spacing: .01em; }
.app-container .badge.bg-primary   { background: var(--brand-soft) !important;  color: var(--brand-dark) !important; }
.app-container .badge.bg-success   { background: var(--green-soft) !important;  color: var(--green) !important; }
.app-container .badge.bg-danger    { background: var(--red-soft) !important;    color: var(--red) !important; }
.app-container .badge.bg-warning   { background: var(--amber-soft) !important;  color: var(--amber) !important; }
.app-container .badge.bg-info      { background: var(--sky-soft) !important;    color: var(--sky) !important; }
.app-container .badge.bg-secondary, .app-container .badge.bg-light, .app-container .badge.bg-dark { background: var(--slate-soft) !important; color: #475569 !important; }
.app-container .badge[class*="-lighten"] { background: var(--brand-soft) !important; color: var(--brand-dark) !important; }
.app-container .nav-link.active .badge { background: #fff !important; }

/* Filters, inputs, pagination, alerts */
.app-container .input-group-text { background: #f8fafc; border-color: #dee2e6; color: var(--muted); border-radius: 10px; }
.app-container .input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.app-container .input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.app-container .pagination { gap: .25rem; }
.app-container .page-link { border-radius: 9px !important; border: 1px solid var(--line); color: var(--body); font-weight: 600; min-width: 2.1rem; text-align: center; }
.app-container .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.app-container .alert { border-radius: 14px; border-width: 1px; }
.app-container .btn-primary { background: var(--brand); border-color: var(--brand); }
.app-container .btn-primary:hover, .app-container .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.app-container .btn-outline-primary { color: var(--brand-dark); border-color: #9fd3cf; }
.app-container .btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.app-container .text-primary { color: var(--brand-dark) !important; }
.app-container .form-label { font-weight: 600; color: var(--ink); font-size: .86rem; }

/* Page section heading under a hero */
.page-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.hero-stat { display: inline-flex; flex-direction: column; align-items: flex-end; padding: .55rem .95rem; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.hero-stat strong { font-size: 1.45rem; font-weight: 800; line-height: 1; }
.hero-stat span { font-size: .72rem; color: #ccfbf1; font-weight: 600; margin-top: .2rem; }
.hero-back { display: inline-flex; align-items: center; gap: .25rem; color: #99f6e4; font-size: .8rem; font-weight: 600; text-decoration: none; margin-bottom: .6rem; }
.hero-back:hover { color: #fff; }
@media (max-width: 575.98px) {
    .ent-hero { padding: 1.2rem 1.1rem; border-radius: 16px; }
    .hero-stat { align-items: flex-start; }
    .app-body .table > tbody > tr > td, .app-body .table > thead th { padding: .6rem .7rem; }
}

/* Resources library */
.res-card { display: flex; gap: .9rem; height: 100%; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
.res-card:hover { border-color: #a7d7d3; box-shadow: 0 12px 26px -18px rgba(35, 135, 129, .5); }
.res-card.is-draft { border-style: dashed; background: #fcfcfd; }
.res-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: var(--slate-soft); color: var(--muted); }
.res-icon.ext-pdf { background: var(--red-soft); color: var(--red); }
.res-icon.ext-doc, .res-icon.ext-docx, .res-icon.ext-odt { background: var(--sky-soft); color: var(--sky); }
.res-icon.ext-xls, .res-icon.ext-xlsx, .res-icon.ext-ods { background: var(--green-soft); color: var(--green); }
.res-icon.ext-ppt, .res-icon.ext-pptx, .res-icon.ext-odp { background: var(--amber-soft); color: var(--amber); }
.res-title { font-weight: 800; color: var(--ink); line-height: 1.3; }
.res-desc { font-size: .84rem; color: var(--body); margin-top: .2rem; }
.res-meta { font-size: .74rem; color: var(--muted); margin-top: .35rem; }
.min-w-0 { min-width: 0; }

/* ── Sign-in pages (split screen) ───────────────────────────────────────── */
.auth-body { min-height: 100vh; margin: 0; background: #f8fafc; font-family: var(--font); }
.auth-shell { min-height: 100vh; }
.auth-brand {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(150deg, #0f172a 0%, #0f2a3a 45%, var(--brand-dark) 100%);
}
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; filter: blur(8px); opacity: .45; pointer-events: none; }
.auth-brand::before { width: 440px; height: 440px; top: -140px; right: -150px; background: radial-gradient(circle, #2dd4bf 0%, transparent 70%); }
.auth-brand::after { width: 360px; height: 360px; bottom: -130px; left: -110px; background: radial-gradient(circle, var(--accent) 0%, transparent 70%); }
.auth-brand-inner { position: relative; z-index: 1; max-width: 500px; }
.auth-brand h1 { color: #fff; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.auth-brand .lead { color: #ccfbf1; font-size: 1.02rem; }
.auth-mark {
    width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; color: #fff;
    background: linear-gradient(135deg, #2dd4bf, var(--brand) 55%, var(--brand-deep)); box-shadow: 0 12px 30px rgba(45, 212, 191, .35);
}
.auth-feature { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); }
.auth-feature i { font-size: 1.2rem; color: #5eead4; margin-top: 1px; }
.auth-feature small { color: #cbd5e1; }
.auth-form { background: #fff; }
.auth-wrap { width: 100%; max-width: 430px; }
.auth-wrap.wide { max-width: 560px; }
.auth-wrap h2 { font-weight: 800; letter-spacing: -.02em; }
.auth-wrap label, .auth-wrap .form-label { font-weight: 600; font-size: .875rem; color: #334155; }
.auth-wrap .form-control, .auth-wrap .form-select { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: #f8fafc; }
.auth-wrap .form-control:focus, .auth-wrap .form-select:focus { background: #fff; border-color: var(--brand); }
.auth-wrap .form-text { font-size: .76rem; }
.input-icon { position: relative; }
.input-icon > i:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; font-size: 1.05rem; }
.input-icon .form-control { padding-left: 42px; padding-right: 46px; }
.input-icon:focus-within > i:first-child { color: var(--brand); }
.toggle-pass { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #94a3b8; width: 38px; height: 38px; border-radius: 10px; }
.toggle-pass:hover { color: var(--brand); background: var(--brand-soft); }
.btn-brand {
    min-height: 50px; border: 0; border-radius: 12px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep)); box-shadow: 0 10px 24px rgba(35, 135, 129, .3);
    transition: transform .15s, box-shadow .15s;
}
.btn-brand:hover, .btn-brand:focus { color: #fff; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(35, 135, 129, .38); }
.btn-brand:disabled { opacity: .85; color: #fff; transform: none; }
.link-brand { color: var(--brand); font-weight: 700; text-decoration: none; }
.link-brand:hover { text-decoration: underline; color: var(--brand-dark); }
.help-box { padding: .85rem 1rem; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); }
.auth-footer { color: #94a3b8; font-size: .78rem; }
.auth-alert { border-radius: 12px; font-size: .9rem; }

/* ── Print (board report) ───────────────────────────────────────────────── */
@media print {
    .sidebar-wrapper, .app-header, .app-footer, .no-print, #tamris-progress { display: none !important; }
    .main-container { padding-left: 0 !important; }
    .app-body { padding: 0 !important; }
    .ent-hero { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--line); }
    .ent-hero h1, .ent-hero .hero-sub { color: var(--ink) !important; }
    .ent-hero::before, .ent-hero::after { display: none; }
    .panel, .kpi, .card { break-inside: avoid; box-shadow: none !important; }
    body { background: #fff !important; }
}

@media (prefers-reduced-motion: reduce) { .btn-brand, .kpi { transition: none; } }

/* ── Email and SMS logs ─────────────────────────────────────────────── */
.log-filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.log-filters .form-select { width: 220px; }
.log-filters .form-control { width: 230px; }
.log-table .col-when { white-space: nowrap; width: 1%; }
.log-table .col-to { min-width: 250px; max-width: 300px; }
.log-table .col-to strong { display: block; line-height: 1.3; }
.log-table .addr { overflow-wrap: anywhere; }
.log-table .col-text { min-width: 220px; }
.log-table .col-type { min-width: 200px; }
.log-table .col-type .pill { white-space: normal; max-width: 240px; line-height: 1.3; border-radius: 10px; }
.log-table .col-result { min-width: 150px; }
@media (max-width: 767.98px) {
    .log-filters, .log-filters .form-select, .log-filters .form-control { width: 100%; }
    .log-filters .btn { flex: 1; }
    /* Each row becomes a card: no sideways scrolling on phones */
    .log-table thead { display: none; }
    .log-table, .log-table tbody, .log-table tr, .log-table td { display: block; width: 100%; max-width: none; min-width: 0; }
    .log-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .log-table tbody td { position: relative; padding: .25rem 0 .25rem 84px; border: 0; }
    .log-table tbody td::before { content: attr(data-label); position: absolute; left: 0; top: .35rem; width: 76px; color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
    .log-table .col-type .pill { max-width: 100%; }
    .log-table td[colspan] { padding-left: 0; }
    .log-table td[colspan]::before { content: none; }
}
