/* ==========================================================================
   FRANNAN INSURANCE IMS — PREMIUM PORTAL SHELL
   Visual language adapted from the stable htdocs (71) application layout.
   This stylesheet is intentionally scoped to the internal portal and auth UI.
   ========================================================================== */

:root {
    --portal-bg: #f3f6fa;
    --portal-bg-soft: #f8fafc;
    --portal-surface: #ffffff;
    --portal-surface-warm: #fffaf2;
    --portal-ink: #101828;
    --portal-ink-2: #344054;
    --portal-muted: #667085;
    --portal-muted-soft: #98a2b3;
    --portal-border: #e2e8f0;
    --portal-border-strong: #cbd5e1;
    --portal-navy: #0b1f35;
    --portal-navy-2: #0f2744;
    --portal-navy-3: #163a5f;
    --portal-gold: #f2b84b;
    --portal-gold-2: #d98b08;
    --portal-gold-soft: #fff7e7;
    --portal-blue: #0f5ea8;
    --portal-blue-soft: #eaf4ff;
    --portal-green: #15803d;
    --portal-green-soft: #ecfdf3;
    --portal-red: #b42318;
    --portal-red-soft: #fff1f0;
    --portal-purple: #7c3aed;
    --portal-purple-soft: #f3e8ff;
    --portal-radius-sm: 9px;
    --portal-radius-md: 12px;
    --portal-radius: 14px;
    --portal-radius-lg: 18px;
    --portal-radius-xl: 24px;
    --portal-shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --portal-shadow-sm: 0 8px 22px rgba(16, 24, 40, .07);
    --portal-shadow-md: 0 18px 42px rgba(16, 24, 40, .10);
    --portal-shadow-lg: 0 30px 90px rgba(15, 39, 68, .18);
    --sidebar-width: 248px;
    --sidebar-collapsed-width: 82px;
    --topbar: 70px;
    --content-max: 1480px;
    --portal-font: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    --ease-premium: cubic-bezier(.22, 1, .36, 1);
}

/* Base portal reset ------------------------------------------------------- */
body.app-body,
body.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--portal-ink);
    font-family: var(--portal-font);
    font-size: 13px;
    line-height: 1.45;
    background:
        radial-gradient(circle at 10% -8%, rgba(242, 184, 75, .18), transparent 30rem),
        radial-gradient(circle at 102% 8%, rgba(15, 39, 68, .13), transparent 26rem),
        linear-gradient(135deg, #f8fafc 0%, #f8fafc 48%, #eef3f8 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.app-body *,
body.app-body *::before,
body.app-body *::after,
body.auth-page *,
body.auth-page *::before,
body.auth-page *::after { box-sizing: border-box; }

body.app-body a { text-decoration: none; }
body.app-body img,
body.app-body svg { display: block; max-width: 100%; }
body.app-body button,
body.app-body input,
body.app-body select,
body.app-body textarea { font: inherit; }
body.app-body .ui-icon { width: 18px; height: 18px; flex: 0 0 auto; }
body.app-body .skip-link { z-index: 10000; }

/* Application shell ------------------------------------------------------ */
.app-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.main-area {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: clip;
}

.page-content {
    width: min(100%, var(--content-max));
    margin: 0 auto;
    padding: 22px 24px 30px;
    flex: 1;
}

.page-content > * { min-width: 0; }
.page-content > * + * { margin-top: 18px; }

/* Sidebar ---------------------------------------------------------------- */
.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #f8fafc;
    overflow: hidden;
    background:
        radial-gradient(circle at 0 0, rgba(242, 184, 75, .21), transparent 17rem),
        linear-gradient(180deg, var(--portal-navy), #071521 100%);
    box-shadow: 16px 0 45px rgba(15, 39, 68, .14);
    transition: width .22s var(--ease-premium), flex-basis .22s var(--ease-premium), transform .22s var(--ease-premium);
    z-index: 80;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: -100px auto auto -110px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(242, 184, 75, .12);
    filter: blur(10px);
    pointer-events: none;
}

.sidebar__header {
    position: relative;
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 13px 12px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.sidebar-brand {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.sidebar-brand__mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 3px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fffdf7, #f9df9a);
    box-shadow: 0 13px 30px rgba(217, 139, 8, .23);
}

.sidebar-brand__mark .ims-logo-img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: none;
}

.sidebar-brand__copy { min-width: 0; }
.sidebar-brand__copy strong,
.sidebar-brand__copy small { display: block; }
.sidebar-brand__copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -.02em;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.sidebar-brand__copy small {
    margin-top: 4px;
    color: #fed7aa;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.sidebar-close,
.sidebar-collapse,
.sidebar-toggle {
    display: grid;
    place-items: center;
    border: 0;
    cursor: pointer;
}
.sidebar-close,
.sidebar-collapse {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: #e2e8f0;
    background: rgba(255,255,255,.08);
}
.sidebar-close { display: none; }
.sidebar-collapse .ui-icon { width: 16px; height: 16px; transition: transform .22s var(--ease-premium); }
.sidebar-close:hover,
.sidebar-collapse:hover { color: #fff; background: rgba(255,255,255,.14); }

.sidebar-nav {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 11px 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; }

.nav-group + .nav-group { margin-top: 6px; }
.nav-section {
    margin: 10px 9px 5px;
    color: #fdba74;
    opacity: .74;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
    white-space: nowrap;
}
.nav-group__links { display: grid; gap: 4px; }

.nav-link {
    position: relative;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    color: #dbe5ef;
    font-size: 12.5px;
    font-weight: 670;
    transition: transform .18s var(--ease-premium), background .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.085);
    transform: translateX(2px);
}
.nav-link.active {
    color: #1b2430;
    background: linear-gradient(135deg, #f6cf70, var(--portal-gold));
    box-shadow: 0 12px 28px rgba(217, 139, 8, .25);
}
.nav-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: rgba(255,255,255,.10);
}
.nav-icon .ui-icon { width: 15px; height: 15px; }
.nav-link.active .nav-icon { color: #1b2430; background: rgba(255,255,255,.35); }
.nav-label { min-width: 0; flex: 1; white-space: nowrap; }
.nav-badge {
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    color: #fff;
    background: #dc2626;
    font-size: 9px;
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(220,38,38,.28);
}
.nav-link.active .nav-badge { color: #fff; background: #9f1239; }

.sidebar__footer {
    position: relative;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.09);
    background: rgba(0,0,0,.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 13px;
    background: rgba(255,255,255,.075);
}
.sidebar-user__avatar,
.avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--portal-gold), var(--portal-gold-2));
    font-size: 10.5px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(217,139,8,.24);
}
.sidebar-user__details { min-width: 0; flex: 1; }
.sidebar-user__details strong,
.sidebar-user__details small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-user__details strong { color: #fff; font-size: 11.5px; }
.sidebar-user__details small { margin-top: 2px; color: #cbd5e1; font-size: 9.5px; text-transform: capitalize; }
.sidebar-user__status { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.14); }
.sidebar-logout {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 11px;
    color: #fee2e2;
    font-size: 11.5px;
    font-weight: 750;
}
.sidebar-logout:hover { color: #fff; background: rgba(220,38,38,.18); }
.sidebar-logout .ui-icon { width: 16px; height: 16px; }
.sidebar-system-name { display: block; margin-top: 8px; color: rgba(203,213,225,.55); font-size: 8.5px; text-align: center; }
.sidebar-overlay { display: none; }

.sidebar-is-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    flex-basis: var(--sidebar-collapsed-width);
}
.sidebar-is-collapsed .sidebar-brand__copy,
.sidebar-is-collapsed .nav-section,
.sidebar-is-collapsed .nav-label,
.sidebar-is-collapsed .sidebar-user__details,
.sidebar-is-collapsed .sidebar-user__status,
.sidebar-is-collapsed .sidebar-logout span,
.sidebar-is-collapsed .sidebar-system-name { display: none; }
.sidebar-is-collapsed .sidebar__header { justify-content: center; padding-inline: 10px; }
.sidebar-is-collapsed .sidebar-brand { flex: 0 0 auto; }
.sidebar-is-collapsed .sidebar-brand__mark { width: 42px; height: 42px; flex-basis: 42px; }
.sidebar-is-collapsed .sidebar-collapse { position: absolute; right: 4px; bottom: -13px; width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.12); background: var(--portal-navy-2); }
.sidebar-is-collapsed .sidebar-collapse .ui-icon { transform: rotate(180deg); }
.sidebar-is-collapsed .sidebar-nav { padding-inline: 10px; }
.sidebar-is-collapsed .nav-link { justify-content: center; padding-inline: 8px; }
.sidebar-is-collapsed .nav-icon { width: 30px; height: 30px; flex-basis: 30px; }
.sidebar-is-collapsed .nav-badge { position: absolute; top: 3px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 8px; }
.sidebar-is-collapsed .sidebar-user { justify-content: center; padding: 6px; }
.sidebar-is-collapsed .sidebar-logout { justify-content: center; }

/* Topbar ----------------------------------------------------------------- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    min-height: var(--topbar);
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(280px, 1.1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(226,232,240,.9);
    background: rgba(255,255,255,.88);
    box-shadow: 0 8px 30px rgba(16,24,40,.04);
    backdrop-filter: blur(18px);
}
.topbar-leading { min-width: 0; display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: var(--portal-navy);
    background: #fff;
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow-xs);
}
.topbar-title { min-width: 0; }
.topbar-title span {
    display: block;
    color: var(--portal-gold-2);
    font-size: 8.5px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.topbar-title h1 {
    overflow: hidden;
    margin: 3px 0 0;
    color: var(--portal-navy-2);
    font-size: 19px;
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: -.035em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.global-search {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
    border: 1px solid var(--portal-border);
    border-radius: 13px;
    background: #f8fafc;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.global-search:focus-within { border-color: #f0ba50; background: #fff; box-shadow: 0 0 0 4px rgba(242,184,75,.13); }
.global-search__icon { position: absolute; left: 12px; color: #7a8798; pointer-events: none; }
.global-search__icon .ui-icon { width: 17px; height: 17px; }
.global-search input {
    width: 100%;
    height: 40px;
    padding: 8px 46px 8px 38px;
    border: 0 !important;
    border-radius: inherit;
    outline: 0;
    color: var(--portal-ink);
    background: transparent !important;
    box-shadow: none !important;
    font-size: 12px;
}
.global-search kbd {
    position: absolute;
    right: 10px;
    min-width: 23px;
    padding: 2px 6px;
    border: 1px solid #d8dee8;
    border-bottom-width: 2px;
    border-radius: 6px;
    color: #7a8798;
    background: #fff;
    font-family: inherit;
    font-size: 9px;
    text-align: center;
}

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.top-action {
    position: relative;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--portal-border);
    border-radius: 11px;
    color: var(--portal-ink-2);
    background: #fff;
    box-shadow: var(--portal-shadow-xs);
    font-size: 10.5px;
    font-weight: 780;
    transition: transform .16s var(--ease-premium), border-color .16s ease, box-shadow .16s ease;
}
.top-action:hover { color: var(--portal-navy); border-color: #f1c268; box-shadow: var(--portal-shadow-sm); transform: translateY(-1px); }
.top-action__icon { display: grid; place-items: center; color: var(--portal-gold-2); }
.top-action__icon .ui-icon { width: 16px; height: 16px; }
.top-action--notification { width: 38px; padding: 0; justify-content: center; }
.top-action--notification > .ui-icon { width: 17px; height: 17px; }
.top-action em {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #dc2626;
    font-size: 7.5px;
    font-style: normal;
    font-weight: 900;
}

.profile-menu { position: relative; }
.user-pill {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: 1px solid var(--portal-border);
    border-radius: 999px;
    color: var(--portal-ink);
    background: #fff;
    box-shadow: var(--portal-shadow-xs);
    cursor: pointer;
}
.user-pill .avatar { width: 31px; height: 31px; flex-basis: 31px; }
.user-pill__text { min-width: 0; max-width: 145px; text-align: left; }
.user-pill__text strong,
.user-pill__text small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-pill__text strong { color: var(--portal-ink); font-size: 10.5px; line-height: 1.1; }
.user-pill__text small { margin-top: 2px; color: var(--portal-muted); font-size: 8.8px; text-transform: capitalize; }
.profile-chevron { color: #8a96a6; }
.profile-chevron .ui-icon { width: 13px; height: 13px; transform: rotate(90deg); }

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 100;
    width: 230px;
    padding: 8px;
    border: 1px solid var(--portal-border);
    border-radius: 15px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 22px 55px rgba(15,39,68,.18);
    backdrop-filter: blur(16px);
}
.profile-dropdown[hidden] { display: none !important; }
.profile-dropdown__header { display: flex; align-items: center; gap: 9px; padding: 8px 8px 11px; border-bottom: 1px solid #eef2f6; margin-bottom: 5px; }
.profile-dropdown__header .avatar { width: 32px; height: 32px; flex-basis: 32px; }
.profile-dropdown__header strong,
.profile-dropdown__header small { display: block; }
.profile-dropdown__header strong { font-size: 11px; color: var(--portal-ink); }
.profile-dropdown__header small { margin-top: 2px; font-size: 9px; color: var(--portal-muted); }
.profile-dropdown > a {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border-radius: 10px;
    color: var(--portal-ink-2);
    font-size: 11px;
    font-weight: 700;
}
.profile-dropdown > a:hover { color: var(--portal-navy); background: var(--portal-gold-soft); }
.profile-dropdown > a .ui-icon { width: 15px; height: 15px; }
.profile-dropdown .danger-link { color: var(--portal-red); }
.dropdown-divider { display: block; height: 1px; margin: 5px 2px; background: #eef2f6; }

/* Page heroes ------------------------------------------------------------ */
.page-hero {
    position: relative;
    overflow: hidden;
    min-height: 158px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 28px;
    border: 1px solid rgba(220,228,238,.95);
    border-radius: var(--portal-radius-xl);
    background:
        radial-gradient(circle at 100% 0, rgba(242,184,75,.18), transparent 21rem),
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,250,242,.95));
    box-shadow: var(--portal-shadow-sm);
}
.page-hero::after {
    content: "";
    position: absolute;
    right: -110px;
    bottom: -165px;
    width: 290px;
    height: 290px;
    border: 1px solid rgba(217,139,8,.12);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(242,184,75,.035), 0 0 0 90px rgba(242,184,75,.025);
    pointer-events: none;
}
.page-hero-copy { position: relative; z-index: 1; max-width: 780px; }
.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--portal-gold-2);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.page-eyebrow .ui-icon { width: 14px; height: 14px; }
.page-hero h2 {
    margin: 10px 0 7px;
    color: var(--portal-navy-2);
    font-size: clamp(24px, 2.5vw, 36px);
    line-height: 1.08;
    font-weight: 860;
    letter-spacing: -.045em;
}
.page-hero p { max-width: 720px; margin: 0; color: var(--portal-muted); font-size: 12.5px; line-height: 1.65; }
.page-hero-actions { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

/* Dark premium hero used by Policies ------------------------------------ */
.page-hero--gradient {
    min-height: 220px;
    padding: 34px 36px;
    color: #fff;
    border-color: rgba(255,255,255,.12);
    background:
        radial-gradient(circle at 88% 8%, rgba(242,184,75,.31), transparent 25%),
        radial-gradient(circle at 66% 100%, rgba(14,165,233,.18), transparent 30%),
        linear-gradient(135deg, #071521 0%, #0f2744 55%, #174d7e 100%);
    box-shadow: 0 26px 70px rgba(7,21,33,.20);
}
.page-hero--gradient::after { border-color: rgba(255,255,255,.10); box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.018); }
.page-hero--gradient .page-eyebrow { color: #ffe9a8; }
.page-hero--gradient h2 { color: #fff; }
.page-hero--gradient p { color: #d6e2ee; }

/* Cards and grids -------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.kpi-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    min-height: 116px;
    padding: 16px;
    border: 1px solid rgba(220,228,238,.95);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--portal-shadow-sm);
    transition: transform .18s var(--ease-premium), box-shadow .18s ease, border-color .18s ease;
}
.kpi-card::after {
    content: "";
    position: absolute;
    right: -58px;
    bottom: -78px;
    width: 155px;
    height: 155px;
    border-radius: 50%;
    background: rgba(242,184,75,.07);
    pointer-events: none;
}
.kpi-card:hover { transform: translateY(-2px); border-color: #efc36d; box-shadow: var(--portal-shadow-md); }
.kpi-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-card h3 { margin: 0; color: var(--portal-muted); font-size: 9.5px; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
.kpi-card .icon,
.kpi-card .kpi-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--portal-blue);
    background: var(--portal-blue-soft);
}
.kpi-card .icon .ui-icon,
.kpi-card .kpi-icon .ui-icon { width: 17px; height: 17px; }
.kpi-card .icon.green,
.kpi-card--success .kpi-icon { color: var(--portal-green); background: var(--portal-green-soft); }
.kpi-card .icon.gold,
.kpi-card--warning .kpi-icon { color: #a16207; background: #fff7d6; }
.kpi-card .icon.red,
.kpi-card--danger .kpi-icon { color: var(--portal-red); background: var(--portal-red-soft); }
.kpi-card--neutral .kpi-icon { color: #475467; background: #f2f4f7; }
.kpi-card > strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 12px;
    overflow: hidden;
    color: var(--portal-navy-2);
    font-size: clamp(20px, 1.7vw, 27px);
    line-height: 1.05;
    font-weight: 860;
    letter-spacing: -.04em;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.kpi-card > small { position: relative; z-index: 1; display: block; margin-top: 6px; color: var(--portal-muted); font-size: 9.5px; }

.panel,
.print-card {
    min-width: 0;
    padding: 19px;
    border: 1px solid rgba(220,228,238,.96);
    border-radius: 19px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--portal-shadow-sm);
    backdrop-filter: blur(10px);
}
.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
    padding-bottom: 13px;
    border-bottom: 1px solid #edf1f5;
}
.panel-header h2 { margin: 0; color: var(--portal-navy-2); font-size: 15px; line-height: 1.25; font-weight: 820; letter-spacing: -.025em; }
.panel-header p { margin: 4px 0 0; color: var(--portal-muted); font-size: 10.5px; line-height: 1.55; }
.panel-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 5px 9px; border-radius: 999px; color: #8a5a00; background: #fff5d4; font-size: 8.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.module-hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .55fr); gap: 18px; align-items: start; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.three-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr); gap: 18px; align-items: start; }

/* Buttons ---------------------------------------------------------------- */
.btn,
.action-btn,
.logout {
    position: relative;
    overflow: hidden;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--portal-gold), var(--portal-gold-2));
    box-shadow: 0 9px 20px rgba(217,139,8,.19);
    font-size: 10.5px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
    transition: transform .15s var(--ease-premium), box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover,
.action-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(217,139,8,.25); }
.btn .ui-icon,
.action-btn .ui-icon { width: 15px; height: 15px; }
.btn-primary { color: #18202a !important; background: linear-gradient(135deg, #f6cf70, var(--portal-gold)); border-color: rgba(217,139,8,.12); }
.btn-primary:hover { color: #111827 !important; }
.btn-secondary,
.btn-outline,
.btn-light,
.btn-ghost {
    color: var(--portal-ink-2) !important;
    background: #fff !important;
    border-color: var(--portal-border) !important;
    box-shadow: var(--portal-shadow-xs) !important;
}
.btn-secondary:hover,
.btn-outline:hover,
.btn-light:hover,
.btn-ghost:hover { color: var(--portal-navy) !important; border-color: #efc36d !important; box-shadow: var(--portal-shadow-sm) !important; }
.btn-gold { color: #1c2430 !important; background: linear-gradient(135deg, #f6cf70, var(--portal-gold)); }
.btn-danger,
.btn.danger { color: var(--portal-red) !important; background: var(--portal-red-soft) !important; border-color: #f2c7c2 !important; box-shadow: none !important; }
.btn-sm { min-height: 31px; padding: 6px 10px; border-radius: 9px; font-size: 9.5px; }
.btn-ghost-light { color: #fff !important; border-color: rgba(255,255,255,.20) !important; background: rgba(255,255,255,.09) !important; box-shadow: none !important; backdrop-filter: blur(10px); }
.btn-ghost-light:hover { color: #fff !important; border-color: rgba(255,255,255,.42) !important; background: rgba(255,255,255,.15) !important; }

/* Forms ------------------------------------------------------------------ */
.quote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 15px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field.full,
.field--full { grid-column: 1 / -1; }
.field--grow { min-width: 220px; flex: 1; }
.field label {
    color: var(--portal-ink-2);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.field label em,
.field label .required { color: var(--portal-red); font-style: normal; }
.field label .optional { color: var(--portal-muted-soft); font-size: 8px; font-weight: 650; text-transform: none; }
.field input,
.field select,
.field textarea,
.mini-form select,
.inline-status-form select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--portal-border-strong);
    border-radius: 10px;
    outline: 0;
    color: var(--portal-ink);
    background: #fff;
    font-size: 11px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 94px; resize: vertical; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #b8c4d3; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.mini-form select:focus,
.inline-status-form select:focus { border-color: var(--portal-gold); box-shadow: 0 0 0 4px rgba(242,184,75,.13); }
.field input[readonly],
.field input:disabled,
.field select:disabled { color: #667085; background: #f2f4f7; }
.field-hint,
.form-note { color: var(--portal-muted); font-size: 9.5px; line-height: 1.5; }
.form-note a { color: var(--portal-gold-2); font-weight: 800; }
.form-section-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px dashed #dbe2ea;
}
.form-section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section-step,
.form-section-title > span:first-child {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--portal-navy-2), #28639a);
    font-size: 9px;
    font-weight: 900;
    box-shadow: 0 8px 17px rgba(15,39,68,.16);
}
.form-section-title h3 { margin: 0; color: var(--portal-navy-2); font-size: 12px; font-weight: 800; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.input-prefix,
.input-with-icon { position: relative; }
.input-prefix__symbol { position: absolute; left: 9px; top: 50%; z-index: 1; transform: translateY(-50%); padding: 3px 6px; border-right: 1px solid #d8e0e9; color: #667085; background: #f7f9fb; font-size: 8.5px; font-weight: 900; pointer-events: none; }
.input-prefix input { padding-left: 52px; }
.input-with-icon__icon { position: absolute; left: 11px; top: 50%; z-index: 1; color: #98a2b3; transform: translateY(-50%); pointer-events: none; }
.input-with-icon__icon .ui-icon { width: 15px; height: 15px; }
.input-with-icon input { padding-left: 35px; }
.check-line { display: flex; align-items: center; gap: 8px; color: var(--portal-ink-2); font-size: 10.5px; }
.check-line input { width: auto; accent-color: var(--portal-gold-2); }

.filter-bar,
.agent-application-filter {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 13px;
    border: 1px solid #e3e9f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfcfd, #f7f9fc);
}
.filter-bar .field { min-width: 155px; }
.filter-actions,
.agent-application-filter-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: -2px 0 13px; }
.active-filters__label { color: var(--portal-muted); font-size: 9.5px; font-weight: 750; }
.filter-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 27px; padding: 5px 8px; border: 1px solid #dce4ed; border-radius: 999px; color: var(--portal-ink-2); background: #fff; font-size: 9px; font-weight: 750; }
.filter-chip .ui-icon { width: 11px; height: 11px; }

/* Tables ----------------------------------------------------------------- */
.table-wrap,
.table-scroll,
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--portal-shadow-xs);
    scrollbar-width: thin;
    scrollbar-color: #c9d2de transparent;
}
.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    font-size: 10.5px;
}
.data-table th,
.data-table td { padding: 11px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #e9eef4; }
.data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #667085;
    background: linear-gradient(180deg, #fff, #f7f9fb);
    font-size: 8.5px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover td { background: #fffaf2; }
.data-table strong,
.table-primary { color: var(--portal-navy-2); font-weight: 820; }
.data-table small,
.muted { color: var(--portal-muted); font-size: 9px; }
.data-table td > small { display: block; margin-top: 3px; }
.data-table a:not(.btn) { color: var(--portal-gold-2); font-weight: 800; }
.data-table--premium { min-width: 1120px; }
.text-right { text-align: right !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -.01em; }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mini-form,
.inline-status-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.mini-form select,
.inline-status-form select { min-width: 125px; min-height: 31px; padding: 5px 8px; font-size: 9.5px; }

/* Status badges ---------------------------------------------------------- */
.badge,
.status-badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    font-size: 8.5px;
    font-weight: 850;
    white-space: nowrap;
}
.badge-warning,
.status-pill.is-warning { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.badge-danger,
.status-pill.is-danger { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
.status-pill.is-success { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.status-pill.is-muted { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }

/* Lists and module components ------------------------------------------- */
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.action-card {
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 17px;
    border: 1px solid var(--portal-border);
    border-radius: 17px;
    color: var(--portal-ink);
    background: linear-gradient(145deg, #fff, #fbfcfd);
    box-shadow: var(--portal-shadow-xs);
    transition: transform .18s var(--ease-premium), box-shadow .18s ease, border-color .18s ease;
}
.action-card:hover { color: var(--portal-ink); transform: translateY(-2px); border-color: #efc36d; box-shadow: var(--portal-shadow-md); }
.action-card > span:first-child { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--portal-gold-2); background: var(--portal-gold-soft); }
.action-card > span:first-child .ui-icon { width: 18px; height: 18px; }
.action-card strong { margin-top: 12px; color: var(--portal-navy-2); font-size: 12px; }
.action-card small { margin-top: 5px; color: var(--portal-muted); font-size: 9.5px; line-height: 1.5; }
.action-card .action-arrow { margin-top: auto; padding-top: 13px; color: var(--portal-gold-2); font-weight: 850; }

.stat-list { display: grid; gap: 7px; }
.stat-row,
.status-row {
    min-height: 39px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e7ecf2;
    border-radius: 11px;
    color: var(--portal-ink-2);
    background: #fbfcfd;
    font-size: 10px;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.stat-row:hover,
.status-row:hover,
.status-row.is-active { color: var(--portal-navy); transform: translateX(2px); border-color: #efc36d; background: #fffaf2; }
.stat-row strong,
.status-row strong { color: var(--portal-navy-2); font-size: 11px; }
.status-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.status-row__chevron { color: #98a2b3; }
.status-row__chevron .ui-icon { width: 13px; height: 13px; }

.mini-list { display: grid; gap: 8px; }
.mini-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border: 1px solid #e7ecf2;
    border-radius: 12px;
    color: var(--portal-ink-2);
    background: #fbfcfd;
}
.mini-item:hover { color: var(--portal-ink-2); border-color: #efc36d; background: #fffaf2; }
.mini-date { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 11px; color: #704600; background: #fff1c7; font-size: 8.5px; line-height: 1.05; font-weight: 900; text-align: center; }
.mini-item strong,
.mini-item small { display: block; }
.mini-item strong { color: var(--portal-navy-2); font-size: 10.5px; }
.mini-item small { margin-top: 3px; color: var(--portal-muted); font-size: 8.8px; line-height: 1.45; }

.report-bars { display: grid; gap: 10px; }
.report-bar-row { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(180px, 1.8fr) auto; gap: 10px; align-items: center; }
.report-bar-label { color: var(--portal-ink-2); font-size: 9.5px; font-weight: 750; }
.report-track { overflow: hidden; height: 8px; border-radius: 999px; background: #eef2f6; }
.report-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--portal-gold), var(--portal-gold-2)); }
.report-bar-value { color: var(--portal-navy-2); font-size: 9.5px; font-weight: 850; }

.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-card { padding: 13px; border: 1px solid #e4eaf1; border-radius: 13px; background: #fbfcfd; }
.role-card strong { display: block; color: var(--portal-navy-2); font-size: 10.5px; }
.role-card small { display: block; margin-top: 4px; color: var(--portal-muted); font-size: 9px; line-height: 1.5; }

.settings-tabs { display: flex; align-items: center; gap: 6px; overflow-x: auto; margin-bottom: 15px; padding: 5px; border: 1px solid var(--portal-border); border-radius: 13px; background: #f8fafc; }
.settings-tabs a { min-height: 33px; display: inline-flex; align-items: center; padding: 7px 10px; border-radius: 9px; color: var(--portal-muted); font-size: 9.5px; font-weight: 800; white-space: nowrap; }
.settings-tabs a:hover,
.settings-tabs a.active { color: #1d2430; background: #fff; box-shadow: var(--portal-shadow-xs); }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.catalog-list { display: grid; gap: 7px; }
.catalog-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px; border: 1px solid #e5ebf2; border-radius: 11px; background: #fbfcfd; }

.profile-layout { display: grid; grid-template-columns: minmax(250px, .65fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }
.profile-summary { text-align: center; }
.profile-avatar-large { width: 82px; height: 82px; display: grid; place-items: center; margin: 2px auto 13px; border: 5px solid #fff7e7; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--portal-gold), var(--portal-gold-2)); box-shadow: 0 16px 38px rgba(217,139,8,.22); font-size: 23px; font-weight: 900; }
.profile-summary h2 { margin: 0; color: var(--portal-navy-2); font-size: 17px; }
.profile-summary > p { margin: 4px 0 14px; color: var(--portal-muted); font-size: 10px; }
.profile-meta { display: grid; gap: 7px; text-align: left; }
.profile-meta div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid #e7ecf2; border-radius: 10px; background: #fbfcfd; }
.profile-meta span { color: var(--portal-muted); font-size: 9px; }
.profile-meta strong { color: var(--portal-navy-2); font-size: 9.5px; text-align: right; }

/* Agent application details --------------------------------------------- */
.agent-applications-hero { background: radial-gradient(circle at 100% 0, rgba(34,197,94,.13), transparent 20rem), linear-gradient(135deg, #fff, #f7fff9); }
.agent-application-summary,
.agent-review-panel,
.agent-application-details { min-width: 0; }
.agent-document-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px; border: 1px solid #e5ebf2; border-radius: 10px; background: #fbfcfd; }
.agent-review-form { display: grid; gap: 12px; }
.agent-summary-link { color: var(--portal-gold-2); font-weight: 800; }

/* Empty states, alerts and pagination ----------------------------------- */
.empty-state {
    min-height: 120px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 24px;
    border: 1px dashed #cad4df;
    border-radius: 14px;
    color: var(--portal-muted);
    background: #fbfcfd;
    font-size: 10.5px;
    text-align: center;
}
.empty-state.compact { min-height: 86px; padding: 16px; }
.empty-state--premium > .ui-icon { width: 27px; height: 27px; color: var(--portal-gold-2); }
.empty-state h3 { margin: 5px 0 0; color: var(--portal-navy-2); font-size: 13px; }
.empty-state p { margin: 0; color: var(--portal-muted); font-size: 9.5px; }
.empty-state a { color: var(--portal-gold-2); font-weight: 800; }

.alert {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 13px;
    box-shadow: var(--portal-shadow-xs);
}
.alert-success { color: #067647; border-color: #abefc6; background: #ecfdf3; }
.alert-error,
.alert-warning { color: #b42318; border-color: #fecdca; background: #fff1f0; }
.alert-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.6); }
.alert-icon .ui-icon { width: 15px; height: 15px; }
.alert-copy { flex: 1; font-size: 10.5px; font-weight: 700; }
.alert-dismiss { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; color: currentColor; background: transparent; cursor: pointer; }
.alert-dismiss:hover { background: rgba(255,255,255,.6); }
.alert-dismiss .ui-icon { width: 14px; height: 14px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; }
.page-link,
.page-current,
.pagination a,
.pagination span { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border: 1px solid var(--portal-border); border-radius: 9px; color: var(--portal-ink-2); background: #fff; font-size: 9.5px; font-weight: 750; }
.page-link:hover,
.pagination a:hover { color: var(--portal-navy); border-color: #efc36d; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }

/* Footer ----------------------------------------------------------------- */
.app-footer { padding: 0 24px 13px; }
.app-footer__inner {
    width: min(100%, var(--content-max));
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto;
    color: #7a8798;
    font-size: 9px;
}
.app-footer__brand { display: flex; align-items: center; gap: 5px; }
.app-footer__brand strong { color: #526173; }
.app-footer__separator { width: 1px; height: 13px; background: #d8e0e8; }
.app-footer p { margin: 0; }

/* Authentication -------------------------------------------------------- */
body.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 10%, rgba(242,184,75,.28), transparent 26rem),
        radial-gradient(circle at 90% 86%, rgba(14,165,233,.18), transparent 24rem),
        linear-gradient(135deg, #071521, #0f2744 58%, #174d7e);
}
.auth-page .auth-card {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 410px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 36px 100px rgba(0,0,0,.28);
}
.auth-page .auth-panel {
    position: relative;
    overflow: hidden;
    padding: 42px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 12%, rgba(242,184,75,.29), transparent 26%),
        linear-gradient(150deg, #071521, #0f2744 65%, #1a4f7e);
}
.auth-page .auth-panel::after { content: ""; position: absolute; right: -160px; bottom: -210px; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.10); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.auth-page .auth-panel .brand { position: relative; z-index: 1; display: inline-flex; }
.auth-page .auth-panel .brand-logo-img { width: auto; height: 64px; border-radius: 14px; object-fit: contain; background: #fff; }
.auth-page .auth-panel h1 { position: relative; z-index: 1; max-width: 510px; margin: 42px 0 14px; color: #fff; font-size: clamp(31px, 4vw, 48px); line-height: 1; letter-spacing: -.05em; }
.auth-page .auth-panel p { position: relative; z-index: 1; max-width: 520px; margin: 0; color: #d7e3ef; font-size: 12.5px; line-height: 1.7; }
.auth-page .trust-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 25px !important; }
.auth-page .trust-row span { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.14) !important; border-radius: 999px; color: #f8fafc !important; background: rgba(255,255,255,.08) !important; font-size: 9px; font-weight: 750; }
.auth-page .auth-form { padding: 42px 36px; align-self: center; }
.auth-page .auth-form h2 { margin: 0 0 5px; color: var(--portal-navy-2); font-size: 24px; letter-spacing: -.04em; }
.auth-page .auth-form > p { margin: 0 0 23px !important; color: var(--portal-muted) !important; font-size: 10.5px; line-height: 1.6; }
.auth-page .auth-form .field label { font-size: 9px; }
.auth-page .auth-form .field input { min-height: 44px; border-radius: 11px; }
.auth-page .auth-form .btn { min-height: 42px; border-radius: 11px; }

/* Micro-interactions ----------------------------------------------------- */
[data-ui-glow="true"]::before { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; background: radial-gradient(150px circle at var(--pointer-x,50%) var(--pointer-y,50%), rgba(242,184,75,.13), transparent 70%); transition: opacity .2s ease; pointer-events: none; }
[data-ui-glow="true"]:hover::before { opacity: 1; }
.ui-row-inserted { animation: portal-row-enter .36s var(--ease-premium); }

@keyframes portal-row-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes portal-page-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page-content > * { animation: portal-page-enter .32s var(--ease-premium) both; }
.page-content > *:nth-child(2) { animation-delay: .025s; }
.page-content > *:nth-child(3) { animation-delay: .05s; }

/* Module personalities -------------------------------------------------- */
body[data-module="quotes"] .page-eyebrow,
body[data-module="quotes"] .action-card > span:first-child { color: #0369a1; }
body[data-module="quotes"] .action-card > span:first-child { background: #e0f2fe; }
body[data-module="renewals"] .page-eyebrow { color: #a16207; }
body[data-module="reports"] .page-eyebrow { color: var(--portal-purple); }
body[data-module="notifications"] .page-eyebrow { color: #0e7490; }
body[data-module="agent_applications"] .page-eyebrow { color: var(--portal-green); }
body[data-module="staff"] .page-eyebrow { color: #6d28d9; }
body[data-module="backups"] .page-eyebrow { color: #475467; }
body[data-module="settings"] .page-eyebrow { color: var(--portal-gold-2); }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1320px) {
    .app-topbar { grid-template-columns: minmax(170px,.7fr) minmax(240px,1fr) auto; gap: 12px; padding-inline: 18px; }
    .top-action__label--optional { display: none; }
    .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 1080px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(288px, 86vw) !important;
        flex-basis: auto !important;
        transform: translateX(-105%);
        box-shadow: 24px 0 70px rgba(7,21,33,.34);
    }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: grid; }
    .sidebar-collapse { display: none; }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 70;
        display: block;
        border: 0;
        opacity: 0;
        visibility: hidden;
        background: rgba(7,21,33,.48);
        backdrop-filter: blur(3px);
        transition: opacity .2s ease, visibility .2s ease;
    }
    body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
    .sidebar-toggle { display: grid; }
    .app-topbar { grid-template-columns: minmax(180px,.75fr) minmax(220px,1fr) auto; }
    .module-hero,
    .dashboard-grid,
    .profile-layout { grid-template-columns: 1fr; }
    .page-hero { align-items: flex-start; }
}

@media (max-width: 820px) {
    .app-topbar { grid-template-columns: 1fr auto; min-height: 64px; }
    .global-search { grid-column: 1 / -1; grid-row: 2; order: 3; }
    .app-topbar { padding-block: 9px; }
    .page-content { padding: 17px 15px 25px; }
    .page-hero { min-height: 0; flex-direction: column; padding: 22px; border-radius: 19px; }
    .page-hero-actions { width: 100%; justify-content: flex-start; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .split-grid,
    .three-grid,
    .catalog-grid { grid-template-columns: 1fr; }
    .quote-grid,
    .form-grid-3 { grid-template-columns: 1fr; }
    .field.full,
    .field--full,
    .form-section-title { grid-column: auto; }
    .filter-bar,
    .agent-application-filter { align-items: stretch; }
    .filter-bar .field,
    .agent-application-filter .field { min-width: min(100%, 220px); flex: 1; }
    .filter-actions,
    .agent-application-filter-actions { width: 100%; margin-left: 0; }
    .filter-actions .btn,
    .agent-application-filter-actions .btn { flex: 1; }
    .role-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .app-topbar { padding-inline: 12px; }
    .topbar-title span { display: none; }
    .topbar-title h1 { font-size: 16px; }
    .top-action--quote,
    .top-action--policy { display: none; }
    .user-pill__text,
    .profile-chevron { display: none; }
    .user-pill { padding-right: 4px; }
    .page-content { padding-inline: 11px; }
    .page-hero { padding: 19px; }
    .page-hero h2 { font-size: 25px; }
    .page-hero-actions .btn { flex: 1; }
    .kpi-grid { grid-template-columns: 1fr; }
    .action-grid { grid-template-columns: 1fr; }
    .panel,
    .print-card { padding: 15px; border-radius: 15px; }
    .panel-header { flex-direction: column; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn { width: 100%; }
    .report-bar-row { grid-template-columns: 1fr auto; }
    .report-track { grid-column: 1 / -1; grid-row: 2; }
    .app-footer__inner { flex-wrap: wrap; gap: 6px; text-align: center; }
    .app-footer__separator { display: none; }
    body.auth-page { padding: 12px; }
    .auth-page .auth-card { grid-template-columns: 1fr; border-radius: 20px; }
    .auth-page .auth-panel { display: none; }
    .auth-page .auth-form { padding: 30px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
    body.app-body { background: #fff !important; }
    .sidebar,
    .sidebar-overlay,
    .app-topbar,
    .app-footer,
    .no-print,
    .page-hero-actions,
    .alert { display: none !important; }
    .page-content { width: 100%; max-width: none; padding: 0; }
    .page-hero,
    .panel,
    .print-card,
    .kpi-card { border: 0; box-shadow: none; background: #fff; }
    .page-hero { min-height: 0; padding: 0 0 14px; }
    .page-hero::after { display: none; }
    .page-hero--gradient { color: #111; }
    .page-hero--gradient h2 { color: #111; }
    .page-hero--gradient p { color: #555; }
    .kpi-grid { display: none; }
    .table-wrap { overflow: visible; border: 0; }
    .data-table { min-width: 0; font-size: 8px; }
    .data-table th { position: static; }
}

/* Policies compatibility helpers --------------------------------------- */
.panel-header--split { align-items: center; }
.panel-header__actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.form-note--accent { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 11px; border: 1px solid #f1d889; border-radius: 11px; color: #7b5a0a; background: #fff9df; }
.form-note--accent .ui-icon { width: 15px; height: 15px; flex: 0 0 15px; }
.status-pill--info { color: #075985; background: #e0f2fe; border-color: #bae6fd; }
.status-pill--warning { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.status-pill--success { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.status-pill--gold { color: #854d0e; background: #fff7d6; border-color: #f6db79; }
.status-pill--danger { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
.status-pill--muted { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }

.field.is-disabled { opacity: .62; }

/* Frannan light portal theme ----------------------------------------------
   The former dark sidebar treatment is intentionally removed. Navigation,
   page surfaces and supporting text now follow the Frannan navy/black brief. */
:root {
    --portal-bg: #f5f8fc;
    --portal-bg-soft: #f8fbff;
    --portal-surface: #ffffff;
    --portal-surface-warm: #ffffff;
    --portal-ink: #111111;
    --portal-ink-2: #111111;
    --portal-muted: #111111;
    --portal-muted-soft: #374151;
    --portal-border: #d8e3f0;
    --portal-border-strong: #b9cbe0;
    --portal-navy: #071a33;
    --portal-navy-2: #071a33;
    --portal-navy-3: #0a3473;
    --portal-blue: #1d4ed8;
    --portal-blue-soft: #eaf4ff;
}
body.app-body {
    color: #111;
    background: linear-gradient(145deg, #f9fbfe 0%, #eef5fc 100%);
}
body.app-body h1,
body.app-body h2,
body.app-body h3,
body.app-body h4,
body.app-body .panel-header h2,
body.app-body .page-hero h2,
body.app-body .topbar-title h1 {
    color: #071a33;
    font-weight: 850;
}
body.app-body p,
body.app-body small,
body.app-body label,
body.app-body .form-note,
body.app-body .panel-header p,
body.app-body .page-hero p {
    color: #111;
}
.sidebar {
    color: #111;
    border-right: 1px solid #d8e3f0;
    background: #ffffff;
    box-shadow: 12px 0 34px rgba(7,26,51,.07);
}
.sidebar::before { display: none; }
.sidebar__header { border-bottom-color: #d8e3f0; background: #fff; }
.sidebar-brand { color: #071a33; }
.sidebar-brand__mark { background: #fff; border: 1px solid #d8e3f0; box-shadow: 0 8px 22px rgba(7,26,51,.10); }
.sidebar-brand__copy strong { color: #071a33; font-weight: 850; }
.sidebar-brand__copy small { color: #111; }
.sidebar-close,
.sidebar-collapse { color: #071a33; border: 1px solid #d8e3f0; background: #eaf4ff; }
.sidebar-close:hover,
.sidebar-collapse:hover { color: #fff; background: #0a3473; }
.sidebar-nav { scrollbar-color: #b9cbe0 transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #b9cbe0; }
.nav-section { color: #111; opacity: 1; }
.nav-link { color: #111; font-weight: 720; }
.nav-link:hover { color: #071a33; background: #f0f6fd; }
.nav-link.active { color: #071a33; background: #eaf4ff; box-shadow: inset 4px 0 0 #1d4ed8, 0 7px 20px rgba(7,26,51,.06); }
.nav-icon { color: #0a3473; background: #eaf4ff; }
.nav-link.active .nav-icon { color: #fff; background: #0a3473; }
.sidebar__footer { border-top-color: #d8e3f0; background: #f8fbff; }
.sidebar-user { border-color: #d8e3f0; background: #fff; }
.sidebar-user__avatar { color: #071a33; background: linear-gradient(135deg, #f5d76e, #d4af37); }
.sidebar-user__details strong { color: #071a33; }
.sidebar-user__details small { color: #111; }
.sidebar-logout { color: #111; }
.sidebar-logout:hover { color: #9b1c1c; background: #fff1f0; }
.sidebar-system-name { color: #374151; }
.sidebar-is-collapsed .sidebar-collapse { border-color: #d8e3f0; background: #fff; }
.app-topbar { border-bottom-color: #d8e3f0; background: rgba(255,255,255,.96); box-shadow: 0 8px 26px rgba(7,26,51,.05); }
.topbar-title span { color: #111; }
.global-search { border-color: #d8e3f0; background: #f8fbff; }
.global-search:focus-within { border-color: #1d4ed8; box-shadow: 0 0 0 4px rgba(29,78,216,.10); }
.top-action,
.user-pill { color: #111; border-color: #d8e3f0; background: #fff; }
.top-action:hover { color: #071a33; border-color: #8cb7ec; }
.top-action__icon { color: #0a3473; }
.page-hero,
.page-hero--gradient {
    color: #111;
    border-color: #d8e3f0;
    background: linear-gradient(145deg, #fff, #eef6ff);
    box-shadow: 0 10px 28px rgba(7,26,51,.07);
}
.page-hero::after,
.page-hero--gradient::after { border-color: rgba(29,78,216,.12); box-shadow: 0 0 0 45px rgba(29,78,216,.025), 0 0 0 90px rgba(29,78,216,.018); }
.page-hero--gradient h2 { color: #071a33; }
.page-hero--gradient p { color: #111; }
body.app-body .page-eyebrow,
body.app-body .page-hero--gradient .page-eyebrow { color: #111; }
.panel,
.print-card,
.kpi-card { border-color: #d8e3f0; background: #fff; box-shadow: 0 8px 24px rgba(7,26,51,.055); }
body.app-body .btn-primary { color: #fff; background: linear-gradient(135deg, #1d4ed8, #071a33); box-shadow: 0 9px 22px rgba(7,26,51,.18); }
body.app-body .btn-secondary { color: #071a33; border-color: #b9cbe0; background: #fff; }
body.app-body .btn-secondary:hover { color: #fff; border-color: #0a3473; background: #0a3473; }
.sidebar-overlay { background: rgba(7,26,51,.26); }

/* Accessibility and stable interaction refinements. */
body.app-body .sidebar-brand__mark{
  width:96px;
  height:46px;
  flex:0 0 96px;
  padding:3px;
  border-radius:10px;
}
body.app-body .sidebar-brand__mark .ims-logo-img{
  width:100%;
  height:100%;
  padding:0;
  object-fit:contain;
  border-radius:7px;
  box-shadow:none;
}
.app-shell.sidebar-is-collapsed .sidebar-brand__mark{
  width:58px;
  height:34px;
  flex-basis:58px;
}
body.app-body .btn,
body.app-body .action-btn,
body.app-body .logout{
  transition:background-color .15s ease,color .15s ease,border-color .15s ease;
}
body.app-body .btn:hover,
body.app-body .action-btn:hover,
body.app-body .logout:hover{transform:none}
body.app-body .btn:active,
body.app-body .action-btn:active,
body.app-body .logout:active,
body.app-body button:active,
body.app-body [role="button"]:active{
  transform:none!important;
  animation:none!important;
  transition:none!important;
}
body.app-body :where(a,button,input,select,textarea,[role="button"]):focus-visible{
  outline:3px solid #1d4ed8;
  outline-offset:3px;
}
body.app-body .sidebar :where(a,button):focus-visible{
  outline-color:#0a3473;
}

/* Sector imagery ---------------------------------------------------------
   Each operational area receives its own visual language. Opaque content
   surfaces preserve WCAG contrast while the brand overlay keeps imagery
   intentionally subtle behind data-heavy screens. */
body.app-body {
    --sector-image: url("../images/sectors/admin-executive-dashboard.webp");
    background-color: #eaf1f8;
    background-image:
        linear-gradient(180deg, rgba(7, 26, 51, .45) 0%, rgba(238, 245, 252, .86) 32%, rgba(247, 250, 253, .94) 100%),
        var(--sector-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.module-dashboard,
body.module-reports,
body.module-staff,
body.module-backups,
body.module-settings,
body.module-profile {
    --sector-image: url("../images/sectors/admin-executive-dashboard.webp");
}

body.module-policies,
body.module-renewals,
body.module-notifications,
body.module-quotes {
    --sector-image: url("../images/sectors/policy-claims-management.webp");
}

body.module-agent_applications {
    --sector-image: url("../images/sectors/agent-broker-portal.webp");
}

body.app-body .main-area {
    background: linear-gradient(180deg, rgba(247,250,253,.16), rgba(247,250,253,.52));
}

body.app-body .page-hero,
body.app-body .page-hero--gradient,
body.app-body .panel,
body.app-body .print-card,
body.app-body .kpi-card {
    background-color: rgba(255, 255, 255, .96);
    backdrop-filter: blur(9px);
}

body.auth-page {
    background-color: #071a33;
    background-image:
        linear-gradient(135deg, rgba(7, 26, 51, .66), rgba(10, 52, 115, .45)),
        url("../images/sectors/client-self-service-auth.webp");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.automation-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.automation-status {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--portal-border);
    border-radius: 13px;
    background: #f8fbff;
}

.automation-status strong { color: #071a33; }
.automation-status span { color: #374151; font-size: 11px; }

.automation-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--portal-border);
    border-radius: 13px;
    background: #f8fbff;
    cursor: pointer;
}

.automation-checkbox input {
    width: 19px;
    height: 19px;
    min-height: 0 !important;
    margin: 1px 0 0;
    accent-color: #1d4ed8;
}

.automation-checkbox span { display: grid; gap: 3px; }
.automation-checkbox strong { color: #071a33; }
.automation-checkbox small { color: #374151 !important; }
.notification-error { color: #991b1b !important; }

@media (max-width: 900px) {
    .automation-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    body.app-body,
    body.auth-page { background-attachment: scroll; }
    .automation-status-grid { grid-template-columns: 1fr; }
}


/* Social profile settings */
.settings-subheading{padding:14px 16px;border:1px solid var(--line,#dfe4ea);border-radius:12px;background:rgba(11,31,53,.03)}
.settings-subheading strong,.settings-subheading small{display:block}.settings-subheading small{margin-top:4px;color:var(--muted,#667085)}
