/* HIIVO TECH ownership theme. Status colors are intentionally independent. */
:root, html[data-theme="light"], html[data-theme="dark"] {
    --hiivo-primary: #0659EF;
    --hiivo-dark: #09225A;
    --hiivo-white: #FFFFFF;
    --hiivo-black: #000000;
    --primary: #0659EF;
    --primary-hover: #09225A;
    --heading-color: #09225A;
    --link-color: #0659EF;
    --focus-color: #0659EF;
    /* Compatibility aliases for existing component styles. */
    --dms-red: #0659EF;
    --dms-red-2: #09225A;
    --dms-navy: #09225A;
    --dms-navy-2: #09225A;
    --dms-bg: #f7f7f7;
    --dms-surface: #fff;
    --dms-text: #222;
    --dms-muted: #666;
    --dms-border: #e5e5e5;
    --dms-shadow: 0 14px 35px rgba(0,0,0,.08);
    --bs-primary: #0659EF;
    --bs-primary-rgb: 6, 89, 239;
    --bs-link-color: #0659EF;
    --bs-link-color-rgb: 6, 89, 239;
    --bs-link-hover-color: #09225A;
    --bs-link-hover-color-rgb: 9, 34, 90;
    --bs-primary-text-emphasis: #09225A;
    --bs-primary-bg-subtle: rgba(6,89,239,.08);
    --bs-primary-border-subtle: rgba(6,89,239,.25);
    --bs-focus-ring-color: rgba(6,89,239,.25);
    /* Django admin */
    --secondary: #09225A;
    --accent: #fff;
    --header-bg: #09225A;
    --header-color: #fff;
    --header-branding-color: #fff;
    --link-fg: #0659EF;
    --link-hover-color: #09225A;
    --button-bg: #0659EF;
    --button-hover-bg: #09225A;
    --default-button-bg: #0659EF;
    --default-button-hover-bg: #09225A;
    --selected-bg: rgba(6,89,239,.08);
    --selected-row: rgba(6,89,239,.08);
}
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0659EF;
    --bs-btn-border-color: #0659EF;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #09225A;
    --bs-btn-hover-border-color: #09225A;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #09225A;
    --bs-btn-active-border-color: #09225A;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0659EF;
    --bs-btn-disabled-border-color: #0659EF;
    --bs-btn-focus-shadow-rgb: 6,89,239;
}
.btn-outline-primary {
    --bs-btn-color: #0659EF;
    --bs-btn-border-color: #0659EF;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #09225A;
    --bs-btn-hover-border-color: #09225A;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0659EF;
    --bs-btn-active-border-color: #0659EF;
    --bs-btn-disabled-color: #0659EF;
    --bs-btn-disabled-border-color: #0659EF;
    --bs-btn-focus-shadow-rgb: 6,89,239;
}
.form-control:focus, .form-select:focus, .form-check-input:focus,
.ts-wrapper.focus .ts-control {
    border-color: #0659EF;
    box-shadow: 0 0 0 .2rem rgba(6,89,239,.2);
}
.form-check-input:checked, .dropdown-item.active, .dropdown-item:active,
.nav-pills .nav-link.active { background-color: #0659EF; border-color: #0659EF; color: #fff; }
.pagination { --bs-pagination-color:#0659EF; --bs-pagination-hover-color:#09225A; --bs-pagination-active-bg:#0659EF; --bs-pagination-active-border-color:#0659EF; }
.nav-tabs { --bs-nav-tabs-link-active-color:#0659EF; }
.accordion { --bs-accordion-active-color:#09225A; --bs-accordion-active-bg:rgba(6,89,239,.08); --bs-accordion-btn-focus-box-shadow:0 0 0 .2rem rgba(6,89,239,.2); }
.module-header-info h1, .module-title, .brand-title, .home-hero h1,
.portal-title, .settings-info-tile strong, .modal-title { color:#09225A; }
.dms-navbar .nav-link { color:#09225A; }
.dms-navbar .nav-link:hover, .dms-navbar .nav-link.active { color:#0659EF; }
.portal-card, .dms-portal-badge { --portal-color:#0659EF !important; }
.module-card { background-color:#fff; }
.module-card:hover, .module-card.active { border-color:#0659EF; }
.hiivo-product-mark { display:inline-flex; align-items:center; justify-content:center; width:100%; height:100%; color:#0659EF; font:bold 13px Arial,sans-serif; letter-spacing:-.5px; }
.hiivo-footer { background:#fff; border-top:1px solid #e5e5e5; color:#555; font:12px/1.6 Arial,sans-serif; padding:14px 16px; text-align:center; flex-shrink:0; }
.hiivo-footer a, .hiivo-ownership a { color:#0659EF; }
.hiivo-footer a:hover, .hiivo-ownership a:hover { color:#09225A; }
.hiivo-footer-print { display:none; }
.hiivo-ownership { background:#fff; border:1px solid #e5e5e5; border-radius:12px; padding:16px 20px; color:#222; }
.hiivo-ownership strong { color:#09225A; }
.hiivo-ownership p { margin:4px 0; }
@media print {
    .hiivo-footer { background:#fff; border:0; padding:8px 0; font-size:8pt; break-inside:avoid; }
    .hiivo-footer-screen { display:none; }
    .hiivo-footer-print { display:inline; }
    .hiivo-document-credit { break-inside:avoid; }
}
/* HIIVO TECH branding; module icons retain their original category colors. */
.command-hero, .crm-hero, .directory-strip { background:#09225A; color:#fff; }
.command-btn-primary, .btn-login { background:#0659EF; color:#fff; }
.command-btn-primary:hover, .btn-login:hover { background:#09225A; color:#fff; filter:none; }
.home-hero, .portal-select-page { background-color:#f7f7f7; }
.btn-primary:focus-visible, .btn-outline-primary:focus-visible { box-shadow:0 0 0 .2rem rgba(6,89,239,.25); }
.login-brand-footer, .login-brand-footer i { color:rgba(255,255,255,.85); font-size:.75rem; }
.login-foot-note, .portal-foot-note { color:#555; font-size:.75rem; }
.login-form-panel h1, .login-form-panel h2, .portal-header h1 { color:#09225A; }
.btn-verify { background:#0659EF; }
.btn-verify:hover { background:#09225A; filter:none; }
.login-brand .login-brand-footer { color:rgba(255,255,255,.85); font-size:.75rem; }
.portal-select-page .portal-foot-note { color:#555; font-size:.75rem; }

/* Keep ownership at the viewport bottom on short pages, after content on long ones. */
@media screen {
    body.hiivo-portal-layout {
        display:flex;
        flex-direction:column;
        min-height:100vh;
        min-height:100dvh;
    }
    body.hiivo-portal-layout > main { flex:1 0 auto; }
    body.hiivo-portal-layout.wa-page > main { flex:1 1 auto; }
    body.hiivo-portal-layout > .hiivo-footer { margin-top:auto; }
}

/* Shared branded portal headers. */
    .home-hero.hiivo-portal-hero {
        display:grid;
        grid-template-columns:minmax(0, 1fr) auto;
        align-items:center;
        gap:24px;
        padding:26px 30px;
        background:#fff;
    }
    .hiivo-portal-hero .hiivo-portal-brand { gap:24px; align-items:center; }
    .hiivo-portal-hero .home-hero-mark.hiivo-owner-logo {
        width:200px; height:auto; padding:12px 24px 12px 0;
        background:transparent; border:0; border-right:1px solid #e5e5e5;
        border-radius:0; box-shadow:none;
    }
    .hiivo-portal-hero .hiivo-owner-logo img { display:block; width:100%; height:auto; }
    .hiivo-portal-copy { min-width:0; }
    .hiivo-portal-hero .section-kicker { font-size:.72rem; letter-spacing:.06em; margin-bottom:6px!important; }
    .hiivo-portal-hero h1 { font-size:1.9rem; line-height:1.15; }
    .hiivo-portal-owner { color:#666; font-size:.78rem; margin:5px 0 0; }
    .hiivo-portal-hero .home-hero-subtitle { font-size:.88rem; line-height:1.5; margin-top:10px; }
    .hiivo-portal-hero .home-hero-meta { gap:12px; min-width:0; }
    .hiivo-portal-hero .home-hero-chips { flex-wrap:wrap; justify-content:flex-end; }
    @media (max-width:1100px) {
        .home-hero.hiivo-portal-hero { grid-template-columns:minmax(0, 1fr); gap:20px; }
        .hiivo-portal-hero .home-hero-meta { flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; border-top:1px solid #eee; padding-top:16px; }
        .hiivo-portal-hero .home-hero-chips { justify-content:flex-start; }
    }
    @media (max-width:575px) {
        .home-hero.hiivo-portal-hero { padding:22px 20px; }
        .hiivo-portal-hero .hiivo-portal-brand { flex-direction:column; align-items:flex-start; gap:18px; }
        .hiivo-portal-hero .home-hero-mark.hiivo-owner-logo { width:170px; padding:0; border:0; }
        .hiivo-portal-hero h1 { font-size:1.65rem; }
        .hiivo-portal-hero .home-branch-chip { white-space:normal; overflow-wrap:anywhere; }
    }
