/* ==========================================================================
   PROPERA design system — shared by the management app shell (layouts.app).
   Restyles Bootstrap 5.3 components so every existing page follows along.
   ========================================================================== */

:root {
    --ink: #13201C;
    --ink-2: #33443F;
    --canvas: #F1F5F3;
    --canvas-2: #E6EEEA;
    --primary: #163832;
    --primary-2: #1E4A42;
    --primary-light: #2C5750;
    --primary-soft: #DCEAE6;
    --accent: #E3A63E;
    --accent-2: #F0BC5E;
    --accent-ink: #4A3410;
    --accent-soft: #FBEFD8;
    --line: #DCE5E1;
    --line-2: #C9D9D3;
    --card: #FFFFFF;
    --muted: #61756E;

    --ok: #2F8F5B;       --ok-soft: #E2F3E9;
    --warn: #B7791F;     --warn-soft: #FDF1DC;
    --bad: #C2462F;      --bad-soft: #FBE6E1;
    --info: #2F6E8F;     --info-soft: #E0EEF5;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-xs: 0 1px 2px rgba(19, 32, 28, .05);
    --shadow-sm: 0 1px 3px rgba(19, 32, 28, .06), 0 1px 2px rgba(19, 32, 28, .04);
    --shadow: 0 6px 24px -6px rgba(19, 32, 28, .12), 0 2px 6px rgba(19, 32, 28, .05);
    --shadow-lg: 0 24px 48px -12px rgba(19, 32, 28, .22);
    --sidebar-w: 264px;
    --topbar-h: 68px;
    --tabbar-h: 64px;
    --ease: cubic-bezier(.2, .8, .2, 1);

    /* Bootstrap 5.3 variables, re-pointed at the palette */
    --bs-primary: #163832;
    --bs-primary-rgb: 22, 56, 50;
    --bs-primary-text-emphasis: #163832;
    --bs-primary-bg-subtle: #DCEAE6;
    --bs-primary-border-subtle: #A9C9C1;
    --bs-success: #2F8F5B; --bs-success-rgb: 47, 143, 91;
    --bs-warning: #E3A63E; --bs-warning-rgb: 227, 166, 62;
    --bs-danger: #C2462F;  --bs-danger-rgb: 194, 70, 47;
    --bs-info: #2F6E8F;    --bs-info-rgb: 47, 110, 143;
    --bs-link-color: #2C5750;
    --bs-link-color-rgb: 44, 87, 80;
    --bs-link-hover-color: #163832;
    --bs-link-hover-color-rgb: 22, 56, 50;
    --bs-body-color: #13201C;
    --bs-body-color-rgb: 19, 32, 28;
    --bs-body-bg: #F1F5F3;
    --bs-border-color: #DCE5E1;
    --bs-border-radius: 10px;
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: 14px;
    --bs-body-font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --bs-body-font-size: .92rem;
}

html { -webkit-tap-highlight-color: transparent; }
body {
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01", "cv11";
}
h1, h2, h3, h4, h5, .font-display { font-family: 'Fraunces', Georgia, serif; font-weight: 600; color: var(--ink); letter-spacing: -.015em; }
h6 { font-weight: 700; }
.text-muted { color: var(--muted) !important; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
a { text-underline-offset: 3px; }
.tabular { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   App shell
   ========================================================================== */

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    color: #fff;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(227, 166, 62, .12), transparent 60%),
        linear-gradient(180deg, #17392F 0%, #0F2722 100%);
    border-right: 1px solid rgba(255, 255, 255, .04);
    transition: transform .35s var(--ease);
}
.sidebar .brand {
    display: flex; align-items: center; gap: .7rem;
    padding: 1.3rem 1.35rem 1.15rem;
    color: #fff; text-decoration: none;
}
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: url('/icons/icon-192.png') center/cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 6px 16px rgba(0, 0, 0, .25);
}
.brand-word { font-family: 'Fraunces', Georgia, serif; font-size: 1.32rem; font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.brand-word .dot { color: var(--accent); }
.brand-sub { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .45); margin-top: 3px; }

.sidebar nav { flex: 1; overflow-y: auto; padding: .25rem .8rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar .nav-section {
    font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: rgba(255, 255, 255, .38); padding: 1.1rem .75rem .45rem;
}
.sidebar .nav-link {
    position: relative;
    display: flex; align-items: center; gap: .75rem;
    padding: .62rem .8rem; margin: 2px 0;
    border-radius: 10px;
    color: rgba(255, 255, 255, .72); font-size: .875rem; font-weight: 500;
    transition: background .2s, color .2s, transform .2s var(--ease);
}
.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .06));
    color: #fff; font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.sidebar .nav-link.active::before {
    content: ""; position: absolute; left: -.8rem; top: 22%; bottom: 22%;
    width: 4px; border-radius: 0 4px 4px 0; background: var(--accent);
    box-shadow: 0 0 12px rgba(227, 166, 62, .8);
}
.sidebar .nav-link.active i { color: var(--accent); }
.nav-count {
    margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 99px; font-size: .68rem; font-weight: 700;
    background: var(--accent); color: var(--accent-ink);
}
.nav-count.bad { background: #E8664C; color: #fff; }

.sidebar .plan-card {
    margin: .25rem .95rem .9rem; padding: .9rem 1rem; border-radius: 14px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
    font-size: .8rem;
}
.sidebar .plan-card .plan-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .55rem; }
.sidebar .plan-card .plan-name { font-weight: 700; color: #fff; }
.sidebar .plan-card .plan-meta { color: rgba(255, 255, 255, .55); font-size: .74rem; }
.sidebar .plan-card .bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.sidebar .plan-card .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; }
.sidebar .plan-card.upsell { background: linear-gradient(135deg, rgba(227, 166, 62, .22), rgba(227, 166, 62, .06)); border-color: rgba(227, 166, 62, .35); }
.sidebar .plan-card.upsell .btn { margin-top: .7rem; }

.sidebar-user {
    display: flex; align-items: center; gap: .7rem;
    margin: 0 .8rem .9rem; padding: .7rem .75rem;
    border-radius: 12px; background: rgba(0, 0, 0, .18);
}
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user .name { font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { font-size: .7rem; color: rgba(255, 255, 255, .5); text-transform: capitalize; }
.sidebar-user .btn-logout {
    width: 34px; height: 34px; border-radius: 9px; border: 0;
    background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .8);
    display: grid; place-items: center; transition: background .2s;
}
.sidebar-user .btn-logout:hover { background: rgba(232, 102, 76, .85); color: #fff; }

.avatar {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    font-size: .78rem; font-weight: 700; letter-spacing: .02em;
    color: var(--accent-ink); background: linear-gradient(135deg, var(--accent-2), var(--accent));
}
.avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 1rem; }

.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 1035;
    background: rgba(10, 22, 19, .5); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .3s;
}

.main-content { margin-left: var(--sidebar-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 2rem;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(241, 245, 243, .78);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(19, 32, 28, .4); }
.topbar .menu-btn { display: none; }
.topbar .page-title { font-family: 'Fraunces', Georgia, serif; font-size: 1.28rem; font-weight: 600; color: var(--ink); line-height: 1.1; margin: 0; }
.topbar .page-date { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn {
    position: relative;
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--card); color: var(--ink-2);
    border: 1px solid var(--line); box-shadow: var(--shadow-xs);
    transition: transform .2s var(--ease), box-shadow .2s, background .2s;
    font-size: 1.05rem; text-decoration: none;
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--ink); }
.icon-btn .ping {
    position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%;
    background: #E8664C; box-shadow: 0 0 0 2px var(--card);
}
.icon-btn .ping::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
    animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }

.user-chip {
    display: flex; align-items: center; gap: .55rem;
    padding: 3px 10px 3px 3px; border-radius: 13px;
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-xs);
    color: var(--ink); text-decoration: none; font-size: .82rem; font-weight: 600;
}
.user-chip .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: .72rem; }
.user-chip::after { display: none; }

.notif-menu { width: 340px; padding: .4rem; }
.notif-menu .notif-head { padding: .6rem .75rem .5rem; font-weight: 700; font-size: .85rem; display: flex; justify-content: space-between; }
.notif-item { display: flex; gap: .75rem; padding: .65rem .75rem; border-radius: 10px; color: var(--ink); text-decoration: none; }
.notif-item:hover { background: var(--canvas); color: var(--ink); }
.notif-item .ni-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif-item .ni-title { font-size: .82rem; font-weight: 600; line-height: 1.3; }
.notif-item .ni-sub { font-size: .74rem; color: var(--muted); }
.notif-empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); font-size: .84rem; }

.install-btn { display: none !important; }
.install-btn.show { display: inline-flex !important; }

.page-body { flex: 1; padding: 1.5rem 2rem 2.5rem; width: 100%; max-width: 1480px; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.flash-stack .alert { animation: rise .4s var(--ease) both; }

/* Bottom tab bar (phones) */
.tabbar {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: .66rem; font-weight: 600; text-decoration: none;
    background: none; border: 0; position: relative;
}
.tabbar i { font-size: 1.25rem; transition: transform .2s var(--ease); }
.tabbar .active { color: var(--primary); }
.tabbar .active i { transform: translateY(-1px); color: var(--primary); }
.tabbar .active::before {
    content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent);
}
.tabbar .tab-dot { position: absolute; top: 9px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: #E8664C; box-shadow: 0 0 0 2px #fff; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    body.nav-open { overflow: hidden; }
    .main-content { margin-left: 0; }
    .topbar { padding-left: 1rem; padding-right: 1rem; height: calc(var(--topbar-h) - 6px + env(safe-area-inset-top, 0px)); }
    .topbar .menu-btn { display: grid; }
    .topbar .page-title { font-size: 1.12rem; }
    .topbar .page-date { display: none; }
    .user-chip .uc-name { display: none; }
    .user-chip { padding-right: 3px; }
    .page-body { padding: 1rem 1rem calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom, 0px)); }
    .tabbar { display: flex; }
}
@media (max-width: 575.98px) {
    .notif-menu { width: calc(100vw - 2rem); }
    .topbar .actions .hide-xs { display: none !important; }
}
@media (display-mode: standalone) {
    body { overscroll-behavior-y: none; }
}

/* ==========================================================================
   Bootstrap component restyle
   ========================================================================== */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: 10px;
    --bs-btn-padding-x: 1rem;
    --bs-btn-font-size: .875rem;
    transition: transform .15s var(--ease), box-shadow .2s, background .2s, color .2s, border-color .2s;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn:active { transform: scale(.98); }
.btn-sm { --bs-btn-border-radius: 8px; --bs-btn-font-size: .8rem; --bs-btn-padding-x: .7rem; }
.btn-lg { --bs-btn-border-radius: 12px; }
.btn-primary {
    --bs-btn-color: #4A3410; --bs-btn-bg: #E3A63E; --bs-btn-border-color: #E3A63E;
    --bs-btn-hover-color: #4A3410; --bs-btn-hover-bg: #EDB352; --bs-btn-hover-border-color: #EDB352;
    --bs-btn-active-color: #4A3410; --bs-btn-active-bg: #D99A30; --bs-btn-active-border-color: #D99A30;
    --bs-btn-focus-shadow-rgb: 227, 166, 62;
    --bs-btn-disabled-color: #4A3410; --bs-btn-disabled-bg: #E3A63E; --bs-btn-disabled-border-color: #E3A63E;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 4px 12px -4px rgba(227, 166, 62, .7);
}
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 8px 18px -6px rgba(227, 166, 62, .8); }
.btn-dark, .btn-teal {
    --bs-btn-color: #fff; --bs-btn-bg: #163832; --bs-btn-border-color: #163832;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1E4A42; --bs-btn-hover-border-color: #1E4A42;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #0F2722; --bs-btn-active-border-color: #0F2722;
}
.btn-outline-primary {
    --bs-btn-color: #163832; --bs-btn-border-color: #B9CFC8; --bs-btn-bg: #fff;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #163832; --bs-btn-hover-border-color: #163832;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #163832; --bs-btn-active-border-color: #163832;
    --bs-btn-focus-shadow-rgb: 22, 56, 50;
    --bs-btn-disabled-color: #163832; --bs-btn-disabled-border-color: #B9CFC8;
}
.btn-outline-secondary, .btn-light {
    --bs-btn-color: #33443F; --bs-btn-bg: #fff; --bs-btn-border-color: #DCE5E1;
    --bs-btn-hover-color: #13201C; --bs-btn-hover-bg: #F1F5F3; --bs-btn-hover-border-color: #C9D9D3;
    --bs-btn-active-color: #13201C; --bs-btn-active-bg: #E6EEEA; --bs-btn-active-border-color: #C9D9D3;
    box-shadow: var(--shadow-xs);
}
.btn-success {
    --bs-btn-bg: #2F8F5B; --bs-btn-border-color: #2F8F5B;
    --bs-btn-hover-bg: #277A4D; --bs-btn-hover-border-color: #277A4D;
    --bs-btn-active-bg: #216A43; --bs-btn-active-border-color: #216A43;
}
.btn-danger {
    --bs-btn-bg: #C2462F; --bs-btn-border-color: #C2462F;
    --bs-btn-hover-bg: #A93B27; --bs-btn-hover-border-color: #A93B27;
    --bs-btn-active-bg: #923321; --bs-btn-active-border-color: #923321;
}
.btn-warning { --bs-btn-bg: #E3A63E; --bs-btn-border-color: #E3A63E; --bs-btn-color: #4A3410; --bs-btn-hover-bg: #EDB352; --bs-btn-hover-border-color: #EDB352; }
.btn-outline-success { --bs-btn-color: #2F8F5B; --bs-btn-border-color: #A9D6BC; --bs-btn-hover-bg: #2F8F5B; --bs-btn-hover-border-color: #2F8F5B; --bs-btn-hover-color: #fff; }
.btn-outline-danger  { --bs-btn-color: #C2462F; --bs-btn-border-color: #EBB8AC; --bs-btn-hover-bg: #C2462F; --bs-btn-hover-border-color: #C2462F; --bs-btn-hover-color: #fff; }
.btn-outline-warning { --bs-btn-color: #9A6516; --bs-btn-border-color: #EED29E; --bs-btn-hover-bg: #E3A63E; --bs-btn-hover-border-color: #E3A63E; --bs-btn-hover-color: #4A3410; }
.btn-outline-info    { --bs-btn-color: #2F6E8F; --bs-btn-border-color: #ACCFE0; --bs-btn-hover-bg: #2F6E8F; --bs-btn-hover-border-color: #2F6E8F; --bs-btn-hover-color: #fff; }
.btn-xs { font-size: .74rem; padding: .25rem .6rem; border-radius: 7px; }

.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius);
    --bs-card-inner-border-radius: calc(var(--radius) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-cap-padding-y: .9rem;
    --bs-card-cap-padding-x: 1.15rem;
    --bs-card-spacer-x: 1.15rem;
    box-shadow: var(--shadow-sm) !important;
    border-color: var(--line) !important;
}
.card-header { border-bottom: 1px solid var(--line); font-weight: 700; background: transparent !important; }
.card-header h5, .card-header h6 { font-family: var(--bs-body-font-family); font-weight: 700; font-size: .92rem; letter-spacing: 0; margin: 0; }
.card-footer { background: #FAFCFB; border-top-color: var(--line); }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }

.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: rgba(22, 56, 50, .035);
    --bs-table-striped-bg: rgba(22, 56, 50, .025);
    font-size: .875rem;
}
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.table-sm > :not(caption) > * > * { padding: .55rem .85rem; }
.table > thead > tr > th, .table .table-light th, .table thead.table-light th {
    color: var(--muted) !important; font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    background: #F7FAF9 !important; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table > tbody > tr { transition: background .15s; }
.table > tbody > tr:last-child > * { border-bottom-width: 0; }
.table-responsive { border-radius: inherit; }
.card > .table-responsive:last-child, .card > .table:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }

.badge {
    --bs-badge-font-weight: 700;
    --bs-badge-font-size: .7rem;
    --bs-badge-padding-x: .6rem;
    --bs-badge-padding-y: .32rem;
    --bs-badge-border-radius: 99px;
    letter-spacing: .01em;
}
/* Soft status pills — badges across every page get the tinted look */
.badge.bg-success   { background: var(--ok-soft) !important;   color: #1F6B42 !important; box-shadow: inset 0 0 0 1px rgba(47, 143, 91, .18); }
.badge.bg-primary   { background: var(--primary-soft) !important; color: var(--primary) !important; box-shadow: inset 0 0 0 1px rgba(22, 56, 50, .14); }
.badge.bg-warning   { background: var(--warn-soft) !important; color: #8A5A10 !important; box-shadow: inset 0 0 0 1px rgba(183, 121, 31, .2); }
.badge.bg-danger    { background: var(--bad-soft) !important;  color: #9C3420 !important; box-shadow: inset 0 0 0 1px rgba(194, 70, 47, .2); }
.badge.bg-info      { background: var(--info-soft) !important; color: #255A75 !important; box-shadow: inset 0 0 0 1px rgba(47, 110, 143, .2); }
.badge.bg-secondary { background: #EEF1F0 !important; color: #55635F !important; box-shadow: inset 0 0 0 1px rgba(85, 99, 95, .16); }
.badge.bg-dark      { background: var(--ink) !important; color: #fff !important; }
.badge.bg-light     { background: #F5F7F6 !important; color: var(--ink-2) !important; box-shadow: inset 0 0 0 1px var(--line); }
.badge[class*="bg-"]::before {
    content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; margin-right: 5px; vertical-align: 1px; opacity: .85;
}
.badge.no-dot::before, .nav-count::before { display: none; }

.form-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.form-control, .form-select {
    border-color: var(--line-2); border-radius: 10px; font-size: .9rem;
    padding: .58rem .85rem; background-color: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-control-sm, .form-select-sm { border-radius: 8px; padding: .35rem .7rem; font-size: .82rem; }
.form-control:hover, .form-select:hover { border-color: #AFC5BE; }
.form-control:focus, .form-select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(44, 87, 80, .12); }
.input-group-text { background: #F7FAF9; border-color: var(--line-2); color: var(--muted); border-radius: 10px; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(44, 87, 80, .12); }
.form-text { color: var(--muted); }

.alert { border-radius: 12px; border: 1px solid transparent; font-size: .86rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert.alert-dismissible { padding-right: 3rem; }
.alert > .btn-close { margin-left: auto; }
.alert-success { --bs-alert-bg: var(--ok-soft);   --bs-alert-color: #1F5E36; --bs-alert-border-color: #BFE0CC; }
.alert-danger  { --bs-alert-bg: var(--bad-soft);  --bs-alert-color: #7A2E1B; --bs-alert-border-color: #F0C3B8; }
.alert-warning { --bs-alert-bg: var(--warn-soft); --bs-alert-color: #6E4A0E; --bs-alert-border-color: #F1D6A6; }
.alert-info    { --bs-alert-bg: var(--info-soft); --bs-alert-color: #1F4E66; --bs-alert-border-color: #BCD9E8; }
.alert-secondary { --bs-alert-bg: #F5F7F6; --bs-alert-color: var(--ink-2); --bs-alert-border-color: var(--line); }

.pagination {
    --bs-pagination-color: #163832; --bs-pagination-hover-color: #163832; --bs-pagination-hover-bg: #DCEAE6;
    --bs-pagination-border-color: #DCE5E1; --bs-pagination-focus-color: #163832; --bs-pagination-focus-bg: #DCEAE6;
    --bs-pagination-active-bg: #163832; --bs-pagination-active-border-color: #163832; --bs-pagination-active-color: #fff;
    --bs-pagination-border-radius: 10px; --bs-pagination-font-size: .85rem;
    gap: 4px;
}
.pagination .page-link { border-radius: 9px !important; margin: 0; }
.nav-pills { --bs-nav-pills-link-active-bg: #163832; --bs-nav-pills-border-radius: 10px; }
.nav-tabs { --bs-nav-tabs-link-active-border-color: var(--line) var(--line) #fff; --bs-nav-link-color: #2C5750; --bs-nav-link-hover-color: #163832; --bs-nav-link-font-weight: 600; }
.progress { --bs-progress-bar-bg: #2C5750; --bs-progress-border-radius: 99px; --bs-progress-bg: #E6EEEA; }
.list-group { --bs-list-group-active-bg: #163832; --bs-list-group-active-border-color: #163832; --bs-list-group-border-color: var(--line); --bs-list-group-border-radius: 12px; }
.dropdown-menu {
    --bs-dropdown-link-active-bg: #163832; --bs-dropdown-border-color: var(--line);
    --bs-dropdown-border-radius: 14px; --bs-dropdown-font-size: .86rem;
    --bs-dropdown-link-hover-bg: var(--canvas);
    box-shadow: var(--shadow-lg); padding: .4rem;
    animation: drop .18s var(--ease);
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .55rem; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-content { border-radius: var(--radius-lg); border: 0; box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-backdrop.show { opacity: .4; }
.breadcrumb { --bs-breadcrumb-font-size: .8rem; --bs-breadcrumb-divider-color: var(--muted); }

/* Re-tint Bootstrap utility colours used directly in views */
.text-primary { color: var(--primary-light) !important; }
.text-success { color: var(--ok) !important; }
.text-danger  { color: var(--bad) !important; }
.text-warning { color: var(--warn) !important; }
.text-info    { color: var(--info) !important; }
.bg-primary.bg-opacity-10, .bg-primary-subtle { background-color: var(--primary-soft) !important; }
.bg-success.bg-opacity-10, .bg-success-subtle { background-color: var(--ok-soft) !important; }
.bg-warning.bg-opacity-10, .bg-warning-subtle { background-color: var(--warn-soft) !important; }
.bg-danger.bg-opacity-10, .bg-danger-subtle  { background-color: var(--bad-soft) !important; }
.bg-info.bg-opacity-10, .bg-info-subtle      { background-color: var(--info-soft) !important; }
.bg-light { background-color: #F7FAF9 !important; }

.icon-box { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.1rem; }

/* ==========================================================================
   Reusable building blocks (dashboards and new pages)
   ========================================================================== */

.hero-panel {
    position: relative; overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.75rem;
    color: #fff;
    background:
        radial-gradient(80% 120% at 100% 0%, rgba(227, 166, 62, .35), transparent 55%),
        radial-gradient(60% 90% at 0% 100%, rgba(44, 87, 80, .9), transparent 60%),
        linear-gradient(135deg, #163832, #0F2722);
    box-shadow: var(--shadow);
}
.hero-panel::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(100deg, transparent 35%, #000 90%);
    -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 90%);
}
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel h2 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 .35rem; }
.hero-panel .eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); font-weight: 700; margin-bottom: .45rem; }
.hero-panel p { color: rgba(255, 255, 255, .75); margin: 0; font-size: .92rem; }
.hero-panel .btn-glass {
    --bs-btn-color: #fff; --bs-btn-bg: rgba(255,255,255,.1); --bs-btn-border-color: rgba(255,255,255,.18);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255,255,255,.18); --bs-btn-hover-border-color: rgba(255,255,255,.3);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: rgba(255,255,255,.22);
    backdrop-filter: blur(6px);
}

.kpi {
    position: relative; overflow: hidden; height: 100%;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.1rem 1.15rem 1rem; box-shadow: var(--shadow-sm);
    transition: transform .25s var(--ease), box-shadow .25s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.kpi .kpi-label { font-size: .76rem; font-weight: 600; color: var(--muted); }
.kpi .kpi-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 1rem; }
.kpi .kpi-value { font-family: 'Fraunces', Georgia, serif; font-size: 1.75rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-value small { font-family: var(--bs-body-font-family); font-size: .78rem; font-weight: 600; color: var(--muted); margin-right: 2px; letter-spacing: 0; }
.kpi .kpi-foot { margin-top: .55rem; font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 46% !important; height: 34px !important; opacity: .55; pointer-events: none; z-index: 0; }
.kpi > *:not(.spark) { position: relative; z-index: 1; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; padding: .1rem .45rem; border-radius: 99px; font-size: .7rem; }
.trend.up { color: #1F6B42; background: var(--ok-soft); }
.trend.down { color: #9C3420; background: var(--bad-soft); }
.trend.flat { color: var(--muted); background: #EEF1F0; }

.tone-teal  { background: var(--primary-soft); color: var(--primary); }
.tone-gold  { background: var(--accent-soft); color: #9A6516; }
.tone-green { background: var(--ok-soft); color: var(--ok); }
.tone-red   { background: var(--bad-soft); color: var(--bad); }
.tone-blue  { background: var(--info-soft); color: var(--info); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); height: 100%; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.15rem .4rem; }
.panel-head h3 { font-family: var(--bs-body-font-family); font-size: .95rem; font-weight: 700; letter-spacing: 0; margin: 0; }
.panel-head .sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.panel-body { padding: .6rem 1.15rem 1.15rem; flex: 1; display: flex; flex-direction: column; }
.panel-body > .row-link:first-child { padding-top: .2rem; }
.panel-link { font-size: .78rem; font-weight: 600; color: var(--primary-light); text-decoration: none; white-space: nowrap; }
.panel-link:hover { color: var(--primary); }

.attn-item {
    display: flex; align-items: center; gap: .8rem;
    padding: .7rem .75rem; margin: 0 -.75rem; border-radius: 12px;
    color: var(--ink); text-decoration: none; transition: background .15s;
}
.attn-item:hover { background: var(--canvas); color: var(--ink); }
.attn-item .ai-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.attn-item .ai-title { font-size: .84rem; font-weight: 600; line-height: 1.25; }
.attn-item .ai-sub { font-size: .74rem; color: var(--muted); }
.attn-item .ai-end { margin-left: auto; text-align: right; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.attn-item + .attn-item { border-top: 1px dashed var(--line); border-radius: 0; }
.attn-item + .attn-item:hover { border-radius: 12px; }

.row-link { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; color: var(--ink); text-decoration: none; }
.row-link + .row-link { border-top: 1px solid var(--line); }
.row-link:hover .rl-title { color: var(--primary-light); }
.row-link .rl-title { font-size: .84rem; font-weight: 600; }
.row-link .rl-sub { font-size: .74rem; color: var(--muted); }

.empty-state { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty-state .es-icon { width: 56px; height: 56px; margin: 0 auto .8rem; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; background: var(--canvas); color: var(--primary-light); }
.empty-state .es-title { font-weight: 700; color: var(--ink); margin-bottom: .2rem; }

.prop-tile {
    position: relative; display: block; border-radius: var(--radius); overflow: hidden;
    aspect-ratio: 4 / 3; color: #fff; text-decoration: none; background: var(--primary);
    box-shadow: var(--shadow-sm);
}
.prop-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.prop-tile:hover img { transform: scale(1.06); }
.prop-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,20,17,.05) 20%, rgba(8,20,17,.55) 55%, rgba(8,20,17,.94) 100%); }
.prop-tile .pt-name, .prop-tile .pt-meta { text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.prop-tile .pt-body { position: absolute; left: .85rem; right: .85rem; bottom: .75rem; z-index: 1; }
.prop-tile .pt-name { font-weight: 700; font-size: .86rem; line-height: 1.25; }
.prop-tile .pt-meta { font-size: .72rem; color: rgba(255, 255, 255, .75); }
.prop-tile .pt-status { position: absolute; top: .65rem; left: .65rem; z-index: 1; }
.prop-tile .pt-status .badge { backdrop-filter: blur(6px); }

.ring { --p: 0; --c: var(--accent); width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.ring > div { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; text-align: center; background: #12302A; }
.ring.light > div { background: #fff; }
.ring.light { background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--canvas-2) 0); }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.pipeline .stage { border-radius: 12px; padding: .7rem .75rem; background: var(--canvas); }
.pipeline .stage .n { font-family: 'Fraunces', Georgia, serif; font-size: 1.45rem; font-weight: 600; line-height: 1; }
.pipeline .stage .l { font-size: .7rem; font-weight: 600; color: var(--muted); margin-top: .3rem; }

.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.skeleton { background: linear-gradient(90deg, #EEF2F0 25%, #F7FAF9 37%, #EEF2F0 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.stagger > * { animation: rise .5s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(6) { animation-delay: .25s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Old per-page stat cards: give them the new look without touching each view */
.stat-card { border-radius: var(--radius) !important; border: 1px solid var(--line) !important; transition: transform .25s var(--ease), box-shadow .25s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow) !important; }
.min-w-0 { min-width: 0; }
