/**
 * Hub Template - Main Stylesheet
 * High-performance Bootstrap 5 template for Joomla 5
 *
 * @package     Hub Template
 * @author      OUI Digital
 * @copyright   (C) 2024 OUI Digital
 * @license     GPL-2.0-or-later
 */

/* ==========================================================================
   CSS Custom Properties (Theme Tokens)
   ========================================================================== */
/* Tokens live in media/templates/site/hub_brand/css/tokens.css (a declared
   dependency of this sheet) and are finished by HubBrand::cssVars(), which is
   emitted after it. This file previously re-declared the whole set here with
   an indigo primary - a drifted duplicate that overrode the brand on any page
   where cssVars() did not run. Do not put tokens back in this file. */

/* ==========================================================================
   Base Styles
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--hub-font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--hub-text);
    background-color: var(--hub-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.guest {
    background-color: var(--hub-bg);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--hub-space-3);
    font-weight: 700;
    line-height: 1.3;
    color: var(--hub-text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: var(--hub-space-3);
}

a {
    color: var(--hub-primary);
    text-decoration: none;
    transition: var(--hub-transition);
}

a:hover {
    color: var(--hub-primary-dark);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.hub-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--hub-sidebar-width);
    min-width: var(--hub-sidebar-width-px);
    max-width: 320px;
    background: var(--hub-surface);
    border-right: 1px solid var(--hub-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hub-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--hub-space-5) 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Logo */
.hub-logo {
    text-align: center;
    padding: 0 var(--hub-space-4);
    margin-bottom: var(--hub-space-6);
}

.hub-logo-img {
    max-width: 40%;
    height: auto;
}

.hub-logo-svg {
    width: 60px;
    height: 60px;
    color: var(--hub-text);
}

/* Navigation */
.hub-nav {
    flex: 1;
    padding: 0;
}

.hub-nav .menu,
.hub-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hub-nav .menu > li,
.hub-nav ul > li {
    margin: 0;
}

.hub-nav .menu > li > a,
.hub-nav ul > li > a {
    display: flex;
    align-items: center;
    gap: var(--hub-space-3);
    padding: var(--hub-space-3) var(--hub-space-4);
    color: var(--hub-text);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--hub-transition);
    border-left: 3px solid transparent;
}

.hub-nav .menu > li > a:hover,
.hub-nav ul > li > a:hover {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
}

.hub-nav .menu > li.active > a,
.hub-nav .menu > li.current > a,
.hub-nav ul > li.active > a,
.hub-nav ul > li.current > a {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
    font-weight: 600;
}

.hub-nav .menu > li > a svg,
.hub-nav .menu > li > a i,
.hub-nav ul > li > a svg,
.hub-nav ul > li > a i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Module Menu - Full Width Items */
.mod-menu .nav-item {
    width: 100%;
}

.mod-menu .nav {
    flex-direction: column;
    width: 100%;
}

.mod-menu .nav-link {
    display: flex;
    align-items: center;
    gap: var(--hub-space-3);
    padding: var(--hub-space-3) var(--hub-space-4);
    color: var(--hub-text);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--hub-transition);
    border-left: 3px solid transparent;
    width: 100%;
}

.mod-menu .nav-link:hover {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
}

.mod-menu .nav-item.active > .nav-link,
.mod-menu .nav-item.current > .nav-link {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
    font-weight: 600;
}

/* Sub-menu: Hidden by default, shown only when parent or child is active */
.hub-nav .mod-menu__sub {
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Show sub-menu when parent is active (user is on parent page or child page) */
.hub-nav .nav-item.active > .mod-menu__sub,
.hub-nav .nav-item.current > .mod-menu__sub,
.hub-nav .nav-item.alias-parent-active > .mod-menu__sub,
.hub-nav .nav-item.parent:hover > .mod-menu__sub {
    display: block;
}

/* Sub-menu item styling */
.hub-nav .mod-menu__sub .nav-item > a {
    padding: var(--hub-space-2) var(--hub-space-4) var(--hub-space-2) calc(var(--hub-space-4) + 1.5rem);
    font-size: 0.9rem;
    color: var(--hub-text-secondary);
    border-left: 3px solid transparent;
}

.hub-nav .mod-menu__sub .nav-item > a:hover {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary-light);
}

.hub-nav .mod-menu__sub .nav-item.active > a,
.hub-nav .mod-menu__sub .nav-item.current > a {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
    font-weight: 600;
}

/* Sidebar Footer */
.hub-sidebar-footer {
    padding: var(--hub-space-4);
    border-top: 1px solid var(--hub-border);
    margin-top: auto;
}

.hub-logout-form {
    margin: 0;
    padding: 0;
}

.hub-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hub-space-2);
    padding: var(--hub-space-3);
    color: var(--hub-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--hub-radius-sm);
    transition: var(--hub-transition);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
}

.hub-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--hub-danger);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.hub-main {
    min-height: 100vh;
    padding: var(--hub-space-5);
    transition: var(--hub-transition);
}

.hub-main.has-sidebar {
    margin-left: var(--hub-sidebar-width);
    min-width: calc(100% - var(--hub-sidebar-width));
}

.hub-main.no-sidebar {
    margin-left: 0;
}

/* ==========================================================================
   Mobile Menu Toggle
   ========================================================================== */
.hub-menu-toggle {
    position: fixed;
    top: var(--hub-space-3);
    left: var(--hub-space-3);
    z-index: 1100;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    box-shadow: var(--hub-shadow);
    cursor: pointer;
    transition: var(--hub-transition);
}

.hub-menu-toggle:hover {
    background: var(--hub-bg);
}

.hub-menu-toggle svg {
    color: var(--hub-text);
}

/* Sidebar Overlay */
.hub-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hub-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   System Messages
   ========================================================================== */
.alert {
    padding: var(--hub-space-3) var(--hub-space-4);
    margin-bottom: var(--hub-space-4);
    border-radius: var(--hub-radius);
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--hub-success-dark);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--hub-warning-dark);
}

.alert-danger,
.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--hub-danger-dark);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--hub-info-dark);
}

/* ==========================================================================
   Cards (Glass Style)
   ========================================================================== */
.card,
.glass-card {
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-lg);
    box-shadow: var(--hub-shadow);
    overflow: hidden;
}

.glass-card {
    background: var(--hub-glass-bg);
    backdrop-filter: var(--hub-backdrop-blur);
    -webkit-backdrop-filter: var(--hub-backdrop-blur);
    border: 1px solid var(--hub-glass-border);
    box-shadow: var(--hub-shadow-glass);
}

.card-header {
    padding: var(--hub-space-4);
    border-bottom: 1px solid var(--hub-border);
    background: transparent;
}

.card-body {
    padding: var(--hub-space-4);
}

.card-footer {
    padding: var(--hub-space-4);
    border-top: 1px solid var(--hub-border);
    background: var(--hub-surface-secondary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--hub-space-2);
    padding: var(--hub-space-2) var(--hub-space-4);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--hub-radius-full);
    border: none;
    cursor: pointer;
    transition: var(--hub-transition);
}

.btn-primary {
    background: var(--hub-gradient-primary);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--hub-primary-rgb, 58, 151, 158), 0.4);
    color: #fff;
}

.btn-success {
    background: var(--hub-gradient-success);
    color: #fff;
}

.btn-warning {
    background: var(--hub-gradient-warning);
    color: #fff;
}

.btn-danger {
    background: var(--hub-gradient-danger);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--hub-primary);
    color: var(--hub-primary);
}

.btn-outline-primary:hover {
    background: var(--hub-primary);
    color: #fff;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--hub-radius-full);
}

.badge-gradient {
    color: #fff;
}

.badge-high,
.badge-danger {
    background: var(--hub-gradient-danger);
    color: #fff;
}

.badge-medium,
.badge-warning {
    background: var(--hub-gradient-warning);
    color: #fff;
}

.badge-low,
.badge-success {
    background: var(--hub-gradient-success);
    color: #fff;
}

.badge-info {
    background: var(--hub-gradient-info);
    color: #fff;
}

.badge-status-active {
    background: var(--hub-gradient-info);
    color: #fff;
}

.badge-status-review {
    background: var(--hub-gradient-warning);
    color: #fff;
}

.badge-status-planning {
    background: linear-gradient(135deg, var(--hub-text-secondary) 0%, #4b5563 100%);
    color: #fff;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--hub-space-4);
}

.table th,
.table td {
    padding: var(--hub-space-3);
    text-align: left;
    border-bottom: 1px solid var(--hub-border);
}

.table th {
    font-weight: 600;
    color: var(--hub-text);
    background: var(--hub-surface-secondary);
}

.table tbody tr:hover {
    background-color: var(--hub-bg);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: var(--hub-space-2) var(--hub-space-3);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--hub-text);
    background-color: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    transition: var(--hub-transition);
    appearance: none;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--hub-primary);
    box-shadow: 0 0 0 3px rgba(var(--hub-primary-rgb, 58, 151, 158), 0.1);
}

.form-label {
    display: block;
    margin-bottom: var(--hub-space-2);
    font-weight: 500;
    color: var(--hub-text);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-primary { color: var(--hub-primary) !important; }
.text-success { color: var(--hub-success) !important; }
.text-warning { color: var(--hub-warning) !important; }
.text-danger { color: var(--hub-danger) !important; }
.text-info { color: var(--hub-info) !important; }
.text-muted { color: var(--hub-text-muted) !important; }

.bg-primary { background: var(--hub-gradient-primary) !important; }
.bg-success { background: var(--hub-gradient-success) !important; }
.bg-warning { background: var(--hub-gradient-warning) !important; }
.bg-danger { background: var(--hub-gradient-danger) !important; }
.bg-info { background: var(--hub-gradient-info) !important; }

.bg-gradient-primary { background: var(--hub-gradient-primary) !important; }
.bg-gradient-secondary { background: var(--hub-gradient-success) !important; }
.bg-gradient-warning { background: var(--hub-gradient-warning) !important; }
.bg-gradient-danger { background: var(--hub-gradient-danger) !important; }
.bg-gradient-info { background: var(--hub-gradient-info) !important; }

.gradient-text {
    background: var(--hub-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.time-display {
    background: var(--hub-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--hub-font-mono);
    font-weight: 700;
}

.avatar-gradient {
    background: var(--hub-gradient-primary);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Hover Effects */
.hover-lift {
    transition: var(--hub-transition-slow);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--hub-shadow-lg);
}

/* Progress Bars */
.progress-glass {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--hub-radius);
    height: 0.5rem;
    overflow: hidden;
}

.progress-bar-gradient {
    background: var(--hub-gradient-primary);
    border-radius: var(--hub-radius);
    height: 100%;
}

.mon-hero {
    position: relative;
    padding: 3rem 2rem 4rem;
    background: var(--hub-gradient-hero);
    overflow: hidden;
    margin-bottom: -2rem;
    text-align:center;
}

/* Project Dashboard */
.projectflow-dashboard {
    max-width: 90%;
    margin: 0 auto;
}

/* ==========================================================================
   Dropfiles Styling (Component Override)
   ========================================================================== */
.dropfiles-content,
.dropfiles-dropblock-content,
.dropfiles-content .breadcrumbs {
    background: transparent !important;
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file {
    display: block;
    font-size: 0.8125rem;
    background: var(--hub-surface);
    min-height: 50px;
    min-width: 12rem !important;
    padding: var(--hub-space-4);
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
    width: calc(33.333% - 20px) !important;
    float: left;
    box-sizing: border-box;
    flex-grow: 1;
    margin: 10px;
    transition: var(--hub-transition);
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file:hover {
    box-shadow: var(--hub-shadow-md);
    transform: translateY(-2px);
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file .ext.ext-pdf {
    display: block;
    margin: auto;
    clear: both;
    float: none !important;
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file h3 {
    display: block;
    margin: auto;
    clear: both;
    float: none !important;
    text-align: center;
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file .filecontent {
    width: 100% !important;
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file a.downloadlink {
    background-color: var(--hub-primary) !important;
    border-radius: var(--hub-radius-sm);
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file .file-right {
    display: flex;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Large screens */
@media (min-width: 1400px) {
    .hub-main.has-sidebar {
        padding: 0;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .hub-menu-toggle {
        display: none;
    }

    .hub-sidebar-overlay {
        display: none !important;
    }
}

/* Tablet & Mobile */
@media (max-width: 991.98px) {
    .hub-sidebar {
        transform: translateX(-100%);
        width: var(--hub-sidebar-width-px);
        min-width: var(--hub-sidebar-width-px);
        transition: transform 0.3s ease;
    }

    .hub-sidebar.open {
        transform: translateX(0);
    }

    .hub-main.has-sidebar {
        margin-left: 0;
        min-width: 100%;
        padding-top: calc(var(--hub-space-5) + 60px);
    }

    .hub-footer.has-sidebar {
        margin-left: 0;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .hub-main {
        padding: var(--hub-space-3);
    }

    .oui_interface,
    .projectflow-dashboard {
        max-width: 100%;
        padding: var(--hub-space-2);
    }

    .dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file {
        width: 100% !important;
        margin: var(--hub-space-2) 0;
    }
}

/* Small Mobile */
@media (max-width: 575.98px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }

    .card-body {
        padding: var(--hub-space-3);
    }

    .btn {
        padding: var(--hub-space-2) var(--hub-space-3);
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .hub-sidebar,
    .hub-menu-toggle,
    .hub-sidebar-overlay {
        display: none !important;
    }

    .hub-main.has-sidebar {
        margin-left: 0;
        min-width: 100%;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   Page Loading Overlay
   ========================================================================== */
.hub-page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hub-page-loader.active {
    opacity: 1;
    visibility: visible;
}

.hub-loader-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--hub-gradient-primary);
    position: relative;
    animation: hub-pulse 1.5s ease-in-out infinite;
}

.hub-loader-spinner::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: white;
    border-radius: 50%;
}

.hub-loader-spinner::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--hub-gradient-primary);
    animation: hub-spin 1s linear infinite;
}

@keyframes hub-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes hub-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.hub-loader-text {
    margin-top: var(--hub-space-4);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--hub-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hub-loader-dots {
    display: inline-flex;
    gap: 4px;
}

.hub-loader-dots span {
    width: 6px;
    height: 6px;
    background: var(--hub-primary);
    border-radius: 50%;
    animation: hub-bounce 1.4s ease-in-out infinite both;
}

.hub-loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.hub-loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes hub-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Navigation Progress Bar

   The default feedback for a page change. The full-screen .hub-page-loader
   above is now reserved for explicit long operations (window.showPageLoader),
   because blanking the whole page for a 150ms navigation reads as a flash.
   ========================================================================== */
.hub-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 10000;
    background: var(--hub-gradient-primary);
    box-shadow: 0 0 10px rgba(var(--hub-primary-rgb, 58, 151, 158), 0.7);
    transform: scaleX(0);
    transform-origin: 0 50%;
    opacity: 0;
    /* Fade only applies on the way out; showing must be instant. */
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hub-nav-progress.active {
    opacity: 1;
    transition: none;
    /* Linear, because the pacing lives in the keyframe stops below. */
    animation: hub-nav-progress 10s linear forwards;
}

/*
 * Jumps to a fifth of the bar inside the first 100ms so a fast page still
 * shows something, then creeps to 92% and waits for the new document.
 */
@keyframes hub-nav-progress {
    0%   { transform: scaleX(0.08); }
    1%   { transform: scaleX(0.2); }
    5%   { transform: scaleX(0.4); }
    20%  { transform: scaleX(0.65); }
    100% { transform: scaleX(0.92); }
}

/*
 * Leaving: the outgoing content recedes the moment you click. The top bar
 * alone is too far from where you are looking to register as feedback, so
 * the answer has to happen in the content area itself.
 */
body.hub-navigating .hub-main {
    opacity: 0.4;
    transform: scale(0.995);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

/* Arriving: content settles in instead of snapping. */
@media screen and (prefers-reduced-motion: no-preference) {
    .hub-main {
        animation: hub-content-in 0.28s var(--hub-ease-out, ease-out);
    }
}

/*
 * Transform only, deliberately. An arrival animation that starts from
 * opacity 0 blanks the page for as long as it fails to run -- a throttled
 * tab holds it in its before-phase indefinitely -- and its fill also
 * outranks the .hub-navigating dim above. Nothing here may own opacity.
 */
@keyframes hub-content-in {
    from {
        transform: translateY(8px);
    }
    to {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hub-nav-progress.active {
        animation: none;
        transform: scaleX(0.5);
    }

    /* The dim still reads without motion; the scale does not. */
    body.hub-navigating .hub-main {
        transform: none;
    }

    .hub-loader-spinner,
    .hub-loader-spinner::after,
    .hub-loader-dots span {
        animation: none;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

/* Theme Toggle Button */
.hub-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hub-space-2);
    width: 100%;
    padding: var(--hub-space-3);
    margin-bottom: var(--hub-space-3);
    background: var(--hub-bg);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    color: var(--hub-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--hub-transition);
}

.hub-theme-toggle:hover {
    background: var(--hub-primary);
    border-color: var(--hub-primary);
    color: #fff;
}

/* OUI4All panel header uses Hub gradient */
.oui4all__header {
    background: linear-gradient(135deg, #4285F4 0%, #34A853 50%, #FBBC05 100%) !important;
    color: #fff !important;
}
.oui4all__header .oui4all__title {
    color: #fff !important;
}
.oui4all__header .oui4all__reset,
.oui4all__header .oui4all__close {
    color: #fff !important;
}

/* Hide the default OUI4All floating button - sidebar has the trigger */
.oui4all__openbtn {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
}

/* Dark Mode CSS Custom Properties */
[data-theme="dark"] {
    /* No brand colours here. HubBrand::cssVars() emits the dark family
       (primary lifted one step so it clears 4.5:1 on --hub-surface) and is
       loaded after this sheet. Hardcoding them here is what made dark mode
       indigo whatever primaryColor was set to. */

    /* Semantic Colors - Slightly brighter for dark bg */
    --hub-success: #34d399;
    --hub-warning: #fbbf24;
    --hub-danger: #f87171;
    --hub-info: #60a5fa;

    /* Background & Surface - Dark palette */
    --hub-bg: #0f172a;
    --hub-surface: #1e293b;
    --hub-surface-secondary: #334155;

    /* Text Colors - Light on dark */
    --hub-text: #f1f5f9;
    --hub-text-secondary: #94a3b8;
    --hub-text-muted: #64748b;

    /* Borders - Subtle on dark */
    --hub-border: #334155;
    --hub-border-light: rgba(255, 255, 255, 0.1);

    /* Effects - Adapted for dark */
    --hub-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --hub-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --hub-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --hub-shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Glass Effect - Dark glass */
    --hub-glass-bg: rgba(30, 41, 59, 0.8);
    --hub-glass-border: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Dark Mode - Base Styles
   ========================================================================== */
[data-theme="dark"] body {
    background-color: var(--hub-bg);
    color: var(--hub-text);
}

[data-theme="dark"] a {
    color: var(--hub-primary);
}

[data-theme="dark"] a:hover {
    color: var(--hub-primary-light);
}

/* ==========================================================================
   Dark Mode - Sidebar
   ========================================================================== */
[data-theme="dark"] .hub-sidebar {
    background: var(--hub-surface);
    border-right-color: var(--hub-border);
}

[data-theme="dark"] .hub-logo-svg {
    color: var(--hub-text);
}

[data-theme="dark"] .hub-nav .menu > li > a,
[data-theme="dark"] .hub-nav ul > li > a,
[data-theme="dark"] .mod-menu .nav-link {
    color: var(--hub-text);
}

[data-theme="dark"] .hub-nav .menu > li > a:hover,
[data-theme="dark"] .hub-nav ul > li > a:hover,
[data-theme="dark"] .mod-menu .nav-link:hover {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
}

[data-theme="dark"] .hub-nav .menu > li.active > a,
[data-theme="dark"] .hub-nav .menu > li.current > a,
[data-theme="dark"] .hub-nav ul > li.active > a,
[data-theme="dark"] .hub-nav ul > li.current > a,
[data-theme="dark"] .mod-menu .nav-item.active > .nav-link,
[data-theme="dark"] .mod-menu .nav-item.current > .nav-link {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
}

[data-theme="dark"] .hub-nav .mod-menu__sub .nav-item > a {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .hub-nav .mod-menu__sub .nav-item > a:hover,
[data-theme="dark"] .hub-nav .mod-menu__sub .nav-item.active > a,
[data-theme="dark"] .hub-nav .mod-menu__sub .nav-item.current > a {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
}

[data-theme="dark"] .hub-sidebar-footer {
    border-top-color: var(--hub-border);
}

[data-theme="dark"] .hub-logout {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .hub-logout:hover {
    background-color: rgba(248, 113, 113, 0.15);
    color: var(--hub-danger);
}

/* ==========================================================================
   Dark Mode - Mobile Menu
   ========================================================================== */
[data-theme="dark"] .hub-menu-toggle {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .hub-menu-toggle:hover {
    background: var(--hub-surface-secondary);
}

[data-theme="dark"] .hub-menu-toggle svg {
    color: var(--hub-text);
}

[data-theme="dark"] .hub-sidebar-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   Dark Mode - Cards
   ========================================================================== */
[data-theme="dark"] .card,
[data-theme="dark"] .glass-card {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .glass-card {
    background: var(--hub-glass-bg);
    border-color: var(--hub-glass-border);
}

[data-theme="dark"] .card-header {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .card-footer {
    border-top-color: var(--hub-border);
    background: var(--hub-surface-secondary);
}

/* ==========================================================================
   Dark Mode - Alerts
   ========================================================================== */
[data-theme="dark"] .alert-success {
    background-color: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.25);
    color: #6ee7b7;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.25);
    color: rgba(var(--hub-warning-rgb, 245, 158, 11), 0.40);
}

[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-error {
    background-color: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.25);
    color: rgba(var(--hub-danger-rgb, 239, 68, 68), 0.35);
}

[data-theme="dark"] .alert-info {
    background-color: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.25);
    color: #93c5fd;
}

/* ==========================================================================
   Dark Mode - Tables
   ========================================================================== */
[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .table th {
    color: var(--hub-text);
    background: var(--hub-surface-secondary);
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: var(--hub-surface-secondary);
}

/* ==========================================================================
   Dark Mode - Forms
   ========================================================================== */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    color: var(--hub-text);
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    border-color: var(--hub-primary);
    box-shadow: 0 0 0 3px rgba(var(--hub-primary-rgb, 58, 151, 158), 0.2);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--hub-text-muted);
}

[data-theme="dark"] .form-label {
    color: var(--hub-text);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--hub-surface);
    color: var(--hub-text);
    border-color: var(--hub-border);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--hub-primary);
    outline-color: var(--hub-primary);
}

/* ==========================================================================
   Dark Mode - Buttons
   ========================================================================== */
[data-theme="dark"] .btn-outline-primary {
    border-color: var(--hub-primary);
    color: var(--hub-primary);
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: var(--hub-primary);
    color: #fff;
}

[data-theme="dark"] .btn-light {
    background: var(--hub-surface-secondary);
    color: var(--hub-text);
    border-color: var(--hub-border);
}

[data-theme="dark"] .btn-light:hover {
    background: var(--hub-border);
}

/* ==========================================================================
   Dark Mode - Text Utilities
   ========================================================================== */
[data-theme="dark"] .text-dark {
    color: var(--hub-text) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--hub-text-muted) !important;
}

[data-theme="dark"] .text-secondary {
    color: var(--hub-text-secondary) !important;
}

[data-theme="dark"] .text-body {
    color: var(--hub-text) !important;
}

/* ==========================================================================
   Dark Mode - Background Utilities
   ========================================================================== */
[data-theme="dark"] .bg-white {
    background-color: var(--hub-surface) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--hub-surface-secondary) !important;
}

[data-theme="dark"] .bg-body {
    background-color: var(--hub-bg) !important;
}

/* ==========================================================================
   Dark Mode - Borders
   ========================================================================== */
[data-theme="dark"] .border {
    border-color: var(--hub-border) !important;
}

[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--hub-border) !important;
}

/* ==========================================================================
   Dark Mode - Dropfiles Override
   ========================================================================== */
[data-theme="dark"] .dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file:hover {
    background: var(--hub-surface-secondary);
}

/* ==========================================================================
   Dark Mode - Page Loader
   ========================================================================== */
[data-theme="dark"] .hub-page-loader {
    background: rgba(15, 23, 42, 0.95);
}

[data-theme="dark"] .hub-loader-spinner::before {
    background: var(--hub-surface);
}

[data-theme="dark"] .hub-loader-text {
    color: var(--hub-text-secondary);
}

/* ==========================================================================
   Dark Mode - Progress Bars
   ========================================================================== */
[data-theme="dark"] .progress,
[data-theme="dark"] .progress-glass {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Dark Mode - Modals & Offcanvas
   ========================================================================== */
[data-theme="dark"] .modal-content {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--hub-border);
}

[data-theme="dark"] .offcanvas {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .offcanvas-header {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   Dark Mode - Dropdowns
   ========================================================================== */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .dropdown-item {
    color: var(--hub-text);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--hub-surface-secondary);
    color: var(--hub-text);
}

[data-theme="dark"] .dropdown-divider {
    border-top-color: var(--hub-border);
}

/* ==========================================================================
   Dark Mode - List Groups
   ========================================================================== */
[data-theme="dark"] .list-group-item {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] .list-group-item:hover {
    background-color: var(--hub-surface-secondary);
}

[data-theme="dark"] .list-group-item.active {
    background-color: var(--hub-primary);
    border-color: var(--hub-primary);
}

/* ==========================================================================
   Dark Mode - Accordions
   ========================================================================== */
[data-theme="dark"] .accordion-item {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .accordion-button {
    background-color: var(--hub-surface);
    color: var(--hub-text);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--hub-surface-secondary);
    color: var(--hub-primary);
}

[data-theme="dark"] .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   Dark Mode - Tabs & Nav
   ========================================================================== */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--hub-surface);
    border-color: var(--hub-border) var(--hub-border) var(--hub-surface);
    color: var(--hub-primary);
}

[data-theme="dark"] .nav-pills .nav-link {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .nav-pills .nav-link:hover {
    background-color: var(--hub-surface-secondary);
    color: var(--hub-text);
}

[data-theme="dark"] .nav-pills .nav-link.active {
    background-color: var(--hub-primary);
    color: #fff;
}

/* ==========================================================================
   Dark Mode - Breadcrumbs
   ========================================================================== */
[data-theme="dark"] .breadcrumb {
    background-color: var(--hub-surface);
}

[data-theme="dark"] .breadcrumb-item a {
    color: var(--hub-primary);
}

[data-theme="dark"] .breadcrumb-item.active {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--hub-text-muted);
}

/* ==========================================================================
   Dark Mode - Pagination
   ========================================================================== */
[data-theme="dark"] .page-link {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] .page-link:hover {
    background-color: var(--hub-surface-secondary);
    border-color: var(--hub-border);
    color: var(--hub-primary);
}

[data-theme="dark"] .page-item.active .page-link {
    background-color: var(--hub-primary);
    border-color: var(--hub-primary);
}

[data-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
    color: var(--hub-text-muted);
}

/* ==========================================================================
   Dark Mode - Tooltips & Popovers
   ========================================================================== */
[data-theme="dark"] .tooltip-inner {
    background-color: var(--hub-surface-secondary);
    color: var(--hub-text);
}

[data-theme="dark"] .popover {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .popover-header {
    background-color: var(--hub-surface-secondary);
    border-bottom-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] .popover-body {
    color: var(--hub-text);
}

/* ==========================================================================
   Dark Mode - Code & Pre
   ========================================================================== */
[data-theme="dark"] code {
    background-color: var(--hub-surface-secondary);
    color: #f472b6;
}

[data-theme="dark"] pre {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] pre code {
    background-color: transparent;
}

/* ==========================================================================
   Dark Mode - HR
   ========================================================================== */
[data-theme="dark"] hr {
    border-color: var(--hub-border);
    opacity: 1;
}

/* ==========================================================================
   Dark Mode - Shadows (already in variables, but ensure override)
   ========================================================================== */
[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow-lg {
    box-shadow: var(--hub-shadow) !important;
}

/* ==========================================================================
   Dark Mode - Component-Specific Overrides
   ========================================================================== */

/* ProjectFlow specific */
[data-theme="dark"] .projects-hero {
    background: linear-gradient(135deg, var(--hub-surface) 0%, var(--hub-surface-secondary) 100%);
}

[data-theme="dark"] .stat-card {
    background: var(--hub-surface);
}

[data-theme="dark"] .list-item {
    background: var(--hub-surface-secondary);
}

[data-theme="dark"] .list-item:hover {
    background: var(--hub-border);
}

[data-theme="dark"] .list-item-full {
    background: var(--hub-surface-secondary);
    border-color: var(--hub-border);
}

[data-theme="dark"] .list-item-full:hover {
    background: var(--hub-surface);
    border-color: var(--hub-text-muted);
}

/* Offcanvas gradients for dark mode */
[data-theme="dark"] .bg-gradient-warning-light,
[data-theme="dark"] .header-drafts {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%) !important;
}

[data-theme="dark"] .bg-gradient-primary-light,
[data-theme="dark"] .header-videos {
    background: linear-gradient(135deg, rgba(var(--hub-primary-rgb, 58, 151, 158), 0.15) 0%, rgba(var(--hub-primary-rgb, 58, 151, 158), 0.1) 100%) !important;
}

[data-theme="dark"] .bg-gradient-figma-light,
[data-theme="dark"] .header-figma {
    background: linear-gradient(135deg, rgba(162, 89, 255, 0.15) 0%, rgba(244, 78, 30, 0.1) 100%) !important;
}

/* Timer component */
[data-theme="dark"] .timer-display {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

/* Wiki/Documentation pages */
[data-theme="dark"] .wiki-content,
[data-theme="dark"] .documentation-content {
    background: var(--hub-surface);
}

[data-theme="dark"] .wiki-sidebar {
    background: var(--hub-surface-secondary);
    border-color: var(--hub-border);
}

/* Bootstrap Overrides for Dark Mode */
[data-theme="dark"] .bg-body-tertiary {
    background-color: var(--hub-surface-secondary) !important;
}

[data-theme="dark"] .bg-body-secondary {
    background-color: var(--hub-surface) !important;
}

[data-theme="dark"] .border-secondary {
    border-color: var(--hub-border) !important;
}

/* Text colors in dark mode */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--hub-text);
}

[data-theme="dark"] p {
    color: var(--hub-text);
}

[data-theme="dark"] .fw-semibold,
[data-theme="dark"] .fw-bold {
    color: inherit;
}

/* Ensure smooth transition when switching themes */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body,
.hub-sidebar,
.hub-main,
.card,
.glass-card,
.form-control,
.form-select,
.btn,
.alert,
.modal-content,
.offcanvas,
.dropdown-menu,
.list-group-item,
.accordion-item,
.nav-tabs .nav-link,
.page-link {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ==========================================================================
   REUSABLE VIEW COMPONENTS
   Use these classes across any view for consistent styling
   ========================================================================== */

/* View Container */
.hub-view {
    min-height: 100vh;
    padding-bottom: 3rem;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
/* ==========================================================================
   THE hero
   ==========================================================================
   One geometry for every page hero in the Hub. Eighteen selectors, because
   each component invented its own name for the same band - but they are all
   the same component, and a user moving between views should not see the
   masthead change height under them.

   Heights measured before this existed: 201px, 238px, 254px, 293px across
   nine pages, all with identical padding. The variance was entirely content:
   some heroes carry only a title and subtitle, others a badge, an action, or
   a whole filter row. A min-height with the content centred absorbs that -
   everything up to a title + subtitle + one row of actions lands on exactly
   the same height.

   Only geometry lives here. Colour, radius and decoration stay with each
   component; those are allowed to differ. Do NOT re-declare padding,
   min-height or margin-bottom on a hero anywhere else - that is the drift
   this rule exists to end.
   ========================================================================== */
.hub-view-hero,
.mon-hero,
.projects-hero,
.project-hero,
.tickets-hero,
.bugs-hero,
.recettes-hero,
.cc-hero,
.cc-qr-hero,
.company-hero,
.dash-hero,
.inv-hero,
.spi-hero,
.upi-hero,
.md-hero,
.monitor-hero,
.domain-hero,
.snd-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: var(--hub-hero-height, 264px);
    padding: 2.5rem 2rem;
    background: var(--hub-gradient-hero);
    overflow: hidden;
    margin-bottom: -2rem;
}

/* The one recognised variant: a hero carrying a strip of stat pills. Eight
   views do this, so it is a pattern rather than an accident, and it gets its
   own single height instead of each page landing wherever its content stops.
   Detected rather than opted into, so no view has to add a class - and where
   :has() is unsupported the hero simply keeps the 264px floor and grows, which
   is the behaviour it had before. */
.hub-view-hero:has(.hero-stats, .cc-hero-stats, .hero-badges),
.projects-hero:has(.hero-stats, .cc-hero-stats, .hero-badges),
.cc-hero:has(.hero-stats, .cc-hero-stats, .hero-badges),
.hub-view-hero.is-tall,
.projects-hero.is-tall,
.cc-hero.is-tall,
.monitor-hero.is-tall,
.company-hero.is-tall {
    --hub-hero-height: 280px;
}

/* Record detail. A detail hero carries the record's own state - status
   selector, progress, key dates - so it is taller than a list masthead by
   design. One height for all of them, rather than each detail view landing
   wherever its content stops. */
.project-hero,
.company-hero,
.domain-hero,
.md-hero {
    --hub-hero-height: 320px;
}

@media (max-width: 768px) {
    .hub-view-hero,
    .mon-hero,
    .projects-hero,
    .project-hero,
    .tickets-hero,
    .bugs-hero,
    .recettes-hero,
    .cc-hero,
    .cc-qr-hero,
    .company-hero,
    .dash-hero,
    .inv-hero,
    .spi-hero,
    .upi-hero,
    .md-hero,
    .monitor-hero,
    .domain-hero,
    .snd-hero {
        --hub-hero-height: 190px;
        padding: 2rem 1.25rem;
    }
}

.hub-view-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hub-view-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.5rem;
    letter-spacing: -0.025em;
}

.hub-view-hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* Hero Badge (for company name, status, etc.) */
.hub-view-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hub-view-hero-badge svg {
    opacity: 0.9;
}

/* Hero Decoration */
.hub-view-hero-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hub-view-hero-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.hub-view-hero-circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
}

.hub-view-hero-circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: 10%;
}

.hub-view-hero-circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hero Actions (top right buttons) */
.hub-view-hero-actions {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    z-index: 3;
}

.hub-view-btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: var(--hub-transition-slow);
    cursor: pointer;
}

.hub-view-btn-hero:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.hub-view-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Toolbar (Search & Filters)
   -------------------------------------------------------------------------- */


/* Search Box */
.hub-view-search-wrapper {
    margin-bottom: 1rem;
}

.hub-view-search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--hub-surface-secondary);
    border: 2px solid var(--hub-border);
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    transition: var(--hub-transition-slow);
        position: relative;
    z-index: 10;
}

.hub-view-search-box:focus-within {
    border-color: var(--hub-primary);
    background: var(--hub-surface);
    box-shadow: 0 0 0 4px rgba(var(--hub-primary-rgb, 58, 151, 158), 0.1);
}

.hub-view-search-icon {
    color: var(--hub-text-muted);
    flex-shrink: 0;
}

.hub-view-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    color: var(--hub-text);
    outline: none;
    min-width: 0;
}

.hub-view-search-input::placeholder {
    color: var(--hub-text-muted);
}

.hub-view-search-submit {
    padding: 0.625rem 1.5rem;
    background: var(--hub-gradient-primary-short);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--hub-transition-slow);
    white-space: nowrap;
}

.hub-view-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--hub-primary-rgb, 58, 151, 158), 0.4);
}

/* Filters */
.hub-view-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.hub-view-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 180px;
}

.hub-view-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hub-text-secondary);
}

.hub-view-filter-label svg {
    color: var(--hub-text-muted);
}

.hub-view-filter-select {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background: var(--hub-surface-secondary);
    border: 2px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    font-size: 0.875rem;
    color: var(--hub-text);
    cursor: pointer;
    transition: var(--hub-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.hub-view-filter-select:hover {
    border-color: var(--hub-primary-light);
}

.hub-view-filter-select:focus {
    outline: none;
    border-color: var(--hub-primary);
    box-shadow: 0 0 0 3px rgba(var(--hub-primary-rgb, 58, 151, 158), 0.1);
}

/* --------------------------------------------------------------------------
   Stats Grid
   -------------------------------------------------------------------------- */
.hub-view-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.hub-view-stat-card {
    background: var(--hub-surface);
    border-radius: var(--hub-radius-lg);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--hub-shadow);
    border: 1px solid var(--hub-border);
    transition: var(--hub-transition-slow);
}

.hub-view-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hub-shadow-lg);
}

.hub-view-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.hub-view-stat-value.success { color: var(--hub-success); }
.hub-view-stat-value.danger { color: var(--hub-danger); }
.hub-view-stat-value.warning { color: var(--hub-warning); }
.hub-view-stat-value.primary { color: var(--hub-primary); }
.hub-view-stat-value.info { color: var(--hub-info); }

.hub-view-stat-label {
    font-size: 0.8125rem;
    color: var(--hub-text-secondary);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Notice/Alert Banner
   -------------------------------------------------------------------------- */
.hub-view-notice {
    background: linear-gradient(135deg, rgba(var(--hub-primary-rgb, 58, 151, 158), 0.1) 0%, rgba(var(--hub-primary-rgb, 58, 151, 158), 0.1) 100%);
    border: 1px solid rgba(var(--hub-primary-rgb, 58, 151, 158), 0.2);
    border-radius: var(--hub-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--hub-primary-dark);
}

.hub-view-notice svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Cards Grid (for card-based layouts)
   -------------------------------------------------------------------------- */
.hub-view-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   List Layout (for item-based layouts)
   -------------------------------------------------------------------------- */
.hub-view-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --------------------------------------------------------------------------
   Item Card (universal card component)
   -------------------------------------------------------------------------- */
.hub-view-item {
    background: var(--hub-surface);
    border-radius: var(--hub-radius);
    padding: 1.5rem;
    border: 1px solid var(--hub-border);
    transition: var(--hub-transition-slow);
}

.hub-view-item:hover {
    box-shadow: var(--hub-shadow-lg);
    border-color: var(--hub-primary-light);
    transform: translateY(-2px);
}

.hub-view-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hub-view-item-info {
    flex: 1;
    min-width: 0;
}

.hub-view-item-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.hub-view-item-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hub-text);
    margin: 0;
}

.hub-view-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.hub-view-item-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hub-view-item-badge.purple {
    background: rgba(var(--hub-primary-rgb, 58, 151, 158), 0.15);
    color: var(--hub-primary);
}

.hub-view-item-badge.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--hub-success);
}

.hub-view-item-badge.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--hub-warning);
}

.hub-view-item-badge.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--hub-danger);
}

.hub-view-item-badge.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--hub-info);
}

.hub-view-item-description {
    font-size: 0.875rem;
    color: var(--hub-text-secondary);
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.hub-view-item-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--hub-border);
}

.hub-view-item-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--hub-text-secondary);
}

.hub-view-item-meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--hub-text-muted);
}

/* Item Icon */
.hub-view-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--hub-radius-sm);
    background: var(--hub-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hub-view-item-icon svg {
    width: 24px;
    height: 24px;
    color: var(--hub-text-muted);
}

/* Item Footer */
.hub-view-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hub-border);
}

/* --------------------------------------------------------------------------
   Status Badge
   -------------------------------------------------------------------------- */
.hub-view-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.hub-view-status-badge.online,
.hub-view-status-badge.success {
    background: var(--hub-success);
}

.hub-view-status-badge.offline,
.hub-view-status-badge.danger {
    background: var(--hub-danger);
}

.hub-view-status-badge.warning {
    background: var(--hub-warning);
}

/* --------------------------------------------------------------------------
   Action Buttons
   -------------------------------------------------------------------------- */
.hub-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--hub-gradient-primary-short);
    color: white;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--hub-transition-slow);
    border: none;
    cursor: pointer;
}

.hub-view-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(var(--hub-primary-rgb, 58, 151, 158), 0.3);
    color: white;
}

.hub-view-btn-outline {
    background: transparent;
    border: 2px solid var(--hub-primary);
    color: var(--hub-primary);
}

.hub-view-btn-outline:hover {
    background: var(--hub-primary);
    color: white;
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.hub-view-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--hub-surface);
    border-radius: var(--hub-radius-lg);
    box-shadow: var(--hub-shadow);
    border: 1px solid var(--hub-border);
}

.hub-view-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--hub-text-muted);
    opacity: 0.5;
}

.hub-view-empty h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hub-text);
    margin: 0 0 0.5rem;
}

.hub-view-empty p {
    color: var(--hub-text-secondary);
    margin: 0 0 1.5rem;
}

/* --------------------------------------------------------------------------
   URL/Link Style
   -------------------------------------------------------------------------- */
.hub-view-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--hub-primary);
    text-decoration: none;
    transition: var(--hub-transition);
}

.hub-view-link:hover {
    color: var(--hub-primary-dark);
    text-decoration: underline;
}

.hub-view-link svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Value Display (uptime, percentages, etc.)
   -------------------------------------------------------------------------- */
.hub-view-value-display {
    text-align: right;
}

.hub-view-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.hub-view-value.success { color: var(--hub-success); }
.hub-view-value.danger { color: var(--hub-danger); }
.hub-view-value.warning { color: var(--hub-warning); }
.hub-view-value.primary { color: var(--hub-primary); }
.hub-view-value.info { color: var(--hub-info); }

.hub-view-value-label {
    font-size: 0.75rem;
    color: var(--hub-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Secondary Stats Block (like Plausible stats)
   -------------------------------------------------------------------------- */
.hub-view-secondary-stats {
    background: var(--hub-surface-secondary);
    border-radius: var(--hub-radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.hub-view-secondary-stats-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hub-text-secondary);
    margin-bottom: 0.75rem;
}

.hub-view-secondary-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.hub-view-secondary-stat {
    text-align: center;
}

.hub-view-secondary-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
}

.hub-view-secondary-stat-label {
    font-size: 0.6875rem;
    color: var(--hub-text-muted);
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Item Actions
   -------------------------------------------------------------------------- */
.hub-view-item-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Responsive Styles for View Components
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .hub-view-secondary-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hub-view-hero {
        padding: 2rem 1rem 3rem;
    }

    .hub-view-hero-title {
        font-size: 1.75rem;
    }



    .hub-view-search-box {
        flex-wrap: wrap;
        border-radius: var(--hub-radius-sm);
        padding: 0.75rem;
    }

    .hub-view-search-input {
        width: 100%;
        order: -1;
    }

    .hub-view-filters {
        flex-direction: column;
    }

    .hub-view-filter-group {
        min-width: 100%;
    }

    .hub-view-item-header {
        flex-direction: column;
    }

    .hub-view-value-display {
        text-align: left;
    }

    .hub-view-hero-actions {
        position: static;
        text-align: center;
        margin-top: 1rem;
    }

    .hub-view-secondary-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hub-view-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hub-view-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Dark Mode for View Components
   -------------------------------------------------------------------------- */

[data-theme="dark"] .hub-view-item,
[data-theme="dark"] .hub-view-stat-card,
[data-theme="dark"] .hub-view-empty {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .hub-view-search-box,
[data-theme="dark"] .hub-view-filter-select,
[data-theme="dark"] .hub-view-secondary-stats {
    background: var(--hub-surface-secondary);
    border-color: var(--hub-border);
}

[data-theme="dark"] .hub-view-search-input {
    color: var(--hub-text);
}

[data-theme="dark"] .hub-view-item-icon {
    background: var(--hub-surface-secondary);
}

/* System messages - fixed top right */
#system-message-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    max-width: 420px;
    width: 100%;
}

#system-message-container:empty {
    display: none;
}

/* --------------------------------------------------------------------------
   Joomla showon support

   Joomla's showon.js toggles the `hidden` class on the elements it controls,
   but Bootstrap 5 dropped that utility and this template never defined it, so
   conditionally-shown fields stayed visible. Scoped to showon-driven elements
   and form field wrappers so it cannot affect anything else.
   -------------------------------------------------------------------------- */
[data-showon].hidden,
.control-group.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   com_work - mission creation assistant

   Built from the hub-view components; only what the system lacks is defined here:
   a card that is itself a link, an actions row, and this view's spacing.
   -------------------------------------------------------------------------- */

/* .hub-view-hero carries margin-bottom:-2rem so a toolbar can overlap it. This view
   has no toolbar, so its content clears the hero instead. */
.work-create { padding-top: 3.5rem; }

.work-create-card { max-width: 46rem; }

.work-create-subheading {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
}

.work-create-escape {
    margin-top: 1.25rem;
    font-size: .875rem;
    color: var(--hub-text-muted, #6b7280);
}

a.hub-view-item {
    display: block;
    color: inherit;
    text-decoration: none;
}

.hub-view-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* The whole card is the link, so its footer action is a span, not a button. */
a.hub-view-item .hub-view-btn { pointer-events: none; }

/* ==========================================================================
   HUB VIEW COMPONENTS - the missing half
   ==========================================================================
   Every block below was already being used by site views and had NO rule in
   this file - they rendered unstyled. Documented in templates/hub/docs/, used
   in 1-8 views each, never written. See docs/COHERENCE.md §9.

   The rest (panel, table, tabs, pagination, progress) are promoted here from
   media/com_work/css/work.css and media/hub/css/design-system.css, where the
   same patterns existed twice under `.pf-*` and `.card-*-modern` names.
   ========================================================================== */

/* Toolbar - the row holding search + filters above the content */
.hub-view-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    box-shadow: var(--hub-shadow);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 5;
}

.hub-view-toolbar > .hub-view-search-wrapper {
    flex: 1 1 260px;
    margin-bottom: 0;
}

.hub-view-toolbar > .hub-view-filters {
    margin-bottom: 0;
}

.hub-view-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Button variants.
   .hub-view-btn-light sits on a brand fill or the hero: a light surface with
   brand text, the inverse of .hub-view-btn. Both colours are tokens, so it
   stays legible whatever primaryColor is set to. */
.hub-view-btn-light {
    background: var(--hub-surface);
    color: var(--hub-primary-dark);
    box-shadow: var(--hub-shadow);
}

.hub-view-btn-light:hover {
    background: var(--hub-surface);
    color: var(--hub-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--hub-shadow-md);
}

.hub-view-btn-secondary {
    background: var(--hub-surface-secondary);
    color: var(--hub-text);
    border: 1px solid var(--hub-border);
}

.hub-view-btn-secondary:hover {
    background: var(--hub-primary-05);
    border-color: var(--hub-primary);
    color: var(--hub-primary-dark);
    transform: translateY(-2px);
}

.hub-view-btn-danger {
    background: var(--hub-gradient-danger);
    color: #fff;
}

.hub-view-btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.hub-view-btn[disabled],
.hub-view-btn.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* Info banner - an inline message that is not an error */
.hub-view-info-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--hub-primary-05);
    border: 1px solid var(--hub-primary-20);
    border-left: 4px solid var(--hub-primary);
    border-radius: var(--hub-radius-sm);
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--hub-text);
    font-size: 0.875rem;
}

.hub-view-info-banner svg {
    flex-shrink: 0;
    color: var(--hub-primary);
}

.hub-view-info-banner.success {
    background: rgba(var(--hub-success-rgb, 16, 185, 129), 0.08);
    border-color: rgba(var(--hub-success-rgb, 16, 185, 129), 0.25);
    border-left-color: var(--hub-success);
}

.hub-view-info-banner.warning {
    background: rgba(var(--hub-warning-rgb, 245, 158, 11), 0.08);
    border-color: rgba(var(--hub-warning-rgb, 245, 158, 11), 0.25);
    border-left-color: var(--hub-warning);
}

.hub-view-info-banner.danger {
    background: rgba(var(--hub-danger-rgb, 239, 68, 68), 0.08);
    border-color: rgba(var(--hub-danger-rgb, 239, 68, 68), 0.25);
    border-left-color: var(--hub-danger);
}

.hub-view-info-banner.success svg { color: var(--hub-success); }
.hub-view-info-banner.warning svg { color: var(--hub-warning); }
.hub-view-info-banner.danger svg { color: var(--hub-danger); }

/* List layout - the horizontal alternative to the card grid */
.hub-view-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hub-view-item-horizontal {
    display: block;
}

.hub-view-item-horizontal .hub-view-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.hub-view-item-main {
    flex: 1;
    min-width: 0;
}

.hub-view-item-main .hub-view-item-title {
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .hub-view-item-horizontal .hub-view-item-header {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Panel - a titled section card. Promoted from `.pf-panel` / `.detail-card`. */
.hub-view-panel {
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-lg);
    box-shadow: var(--hub-shadow-md);
    margin-bottom: 2rem;
    overflow: hidden;
}

/* No fill behind the header: a grey strip with a hard rule under it is the
   detail that dates a card most. Space and a hairline do the same job. */
.hub-view-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2rem 1.25rem;
    border-bottom: 1px solid var(--hub-border);
    background: transparent;
}

.hub-view-panel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--hub-text);
}

.hub-view-panel-title svg {
    color: var(--hub-primary);
}

.hub-view-panel-body {
    padding: 1.75rem 2rem 2rem;
}

.hub-view-panel-body > :last-child {
    margin-bottom: 0;
}

/* Table - promoted from `.pf-table`. Wrap it in .hub-view-table-scroll so a
   wide table scrolls inside its own box instead of widening the page. */
.hub-view-table-card {
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-lg);
    box-shadow: var(--hub-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.hub-view-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hub-view-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.hub-view-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    background: var(--hub-surface-secondary);
    border-bottom: 1px solid var(--hub-border);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hub-text-secondary);
    white-space: nowrap;
}

.hub-view-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hub-border);
    color: var(--hub-text);
    vertical-align: middle;
}

.hub-view-table tbody tr:last-child td {
    border-bottom: 0;
}

.hub-view-table tbody tr:hover {
    background: var(--hub-primary-05);
}

.hub-view-table-note {
    padding: 0.875rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--hub-text-secondary);
    border-top: 1px solid var(--hub-border);
}

/* Tabs - promoted from `.pf-tabs` / `.project-tabs` */
.hub-view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 2px solid var(--hub-border);
    margin-bottom: 2rem;
}

.hub-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border: 0;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hub-text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--hub-transition);
}

.hub-view-tab:hover {
    color: var(--hub-primary-dark);
}

.hub-view-tab.active,
.hub-view-tab[aria-selected="true"] {
    color: var(--hub-primary-dark);
    border-bottom-color: var(--hub-primary);
}

.hub-view-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    padding: 0 0.35rem;
    border-radius: var(--hub-radius-full);
    background: var(--hub-primary-10);
    color: var(--hub-primary-dark);
    font-size: 0.6875rem;
    font-weight: 700;
}

/* Progress - promoted from work.css, which carried four size variants of it */
.hub-view-progress {
    margin: 0.75rem 0;
}

.hub-view-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
}

.hub-view-progress-label {
    color: var(--hub-text-secondary);
    font-weight: 600;
}

.hub-view-progress-value {
    color: var(--hub-primary-dark);
    font-weight: 700;
}

.hub-view-progress-track {
    height: 8px;
    border-radius: var(--hub-radius-full);
    background: var(--hub-surface-secondary);
    overflow: hidden;
}

.hub-view-progress-fill {
    height: 100%;
    border-radius: var(--hub-radius-full);
    background: var(--hub-gradient-primary-90);
    transition: width 0.4s var(--hub-ease-out, ease);
}

.hub-view-progress.sm .hub-view-progress-track { height: 4px; }
.hub-view-progress.lg .hub-view-progress-track { height: 12px; }
.hub-view-progress.success .hub-view-progress-fill { background: var(--hub-gradient-success); }
.hub-view-progress.warning .hub-view-progress-fill { background: var(--hub-gradient-warning); }
.hub-view-progress.danger .hub-view-progress-fill { background: var(--hub-gradient-danger); }

/* Pagination - promoted from `.pagination-wrapper` */
.hub-view-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hub-border);
}

.hub-view-pagination-info,
.hub-view-pagination-limit {
    font-size: 0.8125rem;
    color: var(--hub-text-secondary);
}

.hub-view-pagination .pagination {
    margin: 0;
    gap: 0.25rem;
}

.hub-view-pagination .page-link {
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
    color: var(--hub-text);
}

.hub-view-pagination .active > .page-link {
    background: var(--hub-primary);
    border-color: var(--hub-primary);
    color: var(--hub-on-primary);
}

@media (max-width: 768px) {
    .hub-view-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .hub-view-toolbar-actions {
        margin-left: 0;
    }

    .hub-view-pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --------------------------------------------------------------------------
   Hero contents are theme-independent
   --------------------------------------------------------------------------
   The hero is a brand gradient in BOTH themes, so anything sitting on it stays
   white. Without this, `[data-theme="dark"] a` and `[data-theme="dark"] h1..h6`
   (specificity 0-1-1) outrank every single-class hero rule (0-1-0) and repaint
   hero text slate and hero links teal - on a teal band.
   -------------------------------------------------------------------------- */
[data-theme="dark"] .hub-view-hero h1,
[data-theme="dark"] .hub-view-hero h2,
[data-theme="dark"] .hub-view-hero h3,
[data-theme="dark"] .hub-view-hero h4,
[data-theme="dark"] .hub-view-hero h5,
[data-theme="dark"] .hub-view-hero h6,
[data-theme="dark"] .hub-view-hero p,
[data-theme="dark"] .hub-view-hero a,
[data-theme="dark"] .hub-view-hero .hub-view-btn-hero,
[data-theme="dark"] .hub-view-hero .hub-view-hero-title {
    color: #fff;
}

[data-theme="dark"] .hub-view-hero .hub-view-hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .hub-view-hero .hub-view-btn-light {
    background: var(--hub-surface);
    color: var(--hub-primary-light);
}

/* --------------------------------------------------------------------------
   Hero contents are white, in both themes
   --------------------------------------------------------------------------
   `h1..h6 { color: var(--hub-text) }` above is a direct rule, and a direct rule
   always beats a `color: #fff` inherited from the hero - so a heading inside a
   hero rendered dark navy on the brand gradient. Same story in dark mode with
   `[data-theme="dark"] a`. Stated once here for every hero rather than left to
   each view to remember.
   -------------------------------------------------------------------------- */
.hub-view-hero h1,
.hub-view-hero h2,
.hub-view-hero h3,
.hub-view-hero h4,
.hub-view-hero h5,
.hub-view-hero h6,
.mon-hero h1,
.mon-hero h2,
.mon-hero h3,
.mon-hero h4,
.mon-hero h5,
.mon-hero h6,
.projects-hero h1,
.projects-hero h2,
.projects-hero h3,
.projects-hero h4,
.projects-hero h5,
.projects-hero h6,
.project-hero h1,
.project-hero h2,
.project-hero h3,
.project-hero h4,
.project-hero h5,
.project-hero h6,
.tickets-hero h1,
.tickets-hero h2,
.tickets-hero h3,
.tickets-hero h4,
.tickets-hero h5,
.tickets-hero h6,
.bugs-hero h1,
.bugs-hero h2,
.bugs-hero h3,
.bugs-hero h4,
.bugs-hero h5,
.bugs-hero h6,
.recettes-hero h1,
.recettes-hero h2,
.recettes-hero h3,
.recettes-hero h4,
.recettes-hero h5,
.recettes-hero h6,
.cc-hero h1,
.cc-hero h2,
.cc-hero h3,
.cc-hero h4,
.cc-hero h5,
.cc-hero h6,
.cc-qr-hero h1,
.cc-qr-hero h2,
.cc-qr-hero h3,
.cc-qr-hero h4,
.cc-qr-hero h5,
.cc-qr-hero h6,
.company-hero h1,
.company-hero h2,
.company-hero h3,
.company-hero h4,
.company-hero h5,
.company-hero h6,
.dash-hero h1,
.dash-hero h2,
.dash-hero h3,
.dash-hero h4,
.dash-hero h5,
.dash-hero h6,
.inv-hero h1,
.inv-hero h2,
.inv-hero h3,
.inv-hero h4,
.inv-hero h5,
.inv-hero h6,
.spi-hero h1,
.spi-hero h2,
.spi-hero h3,
.spi-hero h4,
.spi-hero h5,
.spi-hero h6,
.upi-hero h1,
.upi-hero h2,
.upi-hero h3,
.upi-hero h4,
.upi-hero h5,
.upi-hero h6,
.md-hero h1,
.md-hero h2,
.md-hero h3,
.md-hero h4,
.md-hero h5,
.md-hero h6,
.monitor-hero h1,
.monitor-hero h2,
.monitor-hero h3,
.monitor-hero h4,
.monitor-hero h5,
.monitor-hero h6,
.domain-hero h1,
.domain-hero h2,
.domain-hero h3,
.domain-hero h4,
.domain-hero h5,
.domain-hero h6,
.snd-hero h1,
.snd-hero h2,
.snd-hero h3,
.snd-hero h4,
.snd-hero h5,
.snd-hero h6 {
    color: #fff;
}

.hub-view-hero p,
.hub-view-hero a,
.mon-hero p,
.mon-hero a,
.projects-hero p,
.projects-hero a,
.project-hero p,
.project-hero a,
.tickets-hero p,
.tickets-hero a,
.bugs-hero p,
.bugs-hero a,
.recettes-hero p,
.recettes-hero a,
.cc-hero p,
.cc-hero a,
.cc-qr-hero p,
.cc-qr-hero a,
.company-hero p,
.company-hero a,
.dash-hero p,
.dash-hero a,
.inv-hero p,
.inv-hero a,
.spi-hero p,
.spi-hero a,
.upi-hero p,
.upi-hero a,
.md-hero p,
.md-hero a,
.monitor-hero p,
.monitor-hero a,
.domain-hero p,
.domain-hero a,
.snd-hero p,
.snd-hero a {
    color: rgba(255, 255, 255, 0.9);
}

/* The -2rem pull assumes the next block overlaps the hero - a stats grid or a
   search toolbar, which is how most list views are built. com_send is followed
   by a form, so it takes the gap its own layout was written for. */
.snd-hero {
    margin-bottom: 1.5rem;
}

/* Category blog (core blog layout): padded content zone, cards, cropped images */
.com-content-category-blog {
  padding: 2.5rem 3rem;
}
@media (max-width: 767px) {
  .com-content-category-blog { padding: 1.5rem 1rem; }
}
.blog-items .blog-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  overflow: hidden;
}
.blog-items .blog-item .item-image {
  float: none;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.blog-items .blog-item .item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-items .blog-item .item-content {
  padding: 1rem 1.25rem 1.25rem;
}

/* Category blog columns (num_columns): Joomla only emits .columns-N, the grid is template CSS */
.blog-items[class*="columns-"] {
  display: grid;
  gap: 1.5rem;
}
.blog-items.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blog-items.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.blog-items.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991px) {
  .blog-items.columns-3, .blog-items.columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
  .blog-items[class*="columns-"] { grid-template-columns: 1fr; }
}
