/* public/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #ffffff; /* White page background as requested */
    --bg-secondary: #ffffff;
    --bg-panel: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-color: #0f172a;
    --text-muted: #64748b;
    
    --primary: #0284c7; /* Sky blue primary color */
    --primary-hover: #0369a1;
    --primary-glow: rgba(2, 132, 199, 0.08);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --success-border: rgba(16, 185, 129, 0.2);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --warning-border: rgba(245, 158, 11, 0.2);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --danger-border: rgba(239, 68, 68, 0.2);
    
    --info: #0284c7;
    --info-bg: rgba(2, 132, 199, 0.08);
    --info-border: rgba(2, 132, 199, 0.2);
    
    --card-shadow: 0 4px 6px -1px rgba(219, 234, 254, 0.3), 0 2px 4px -1px rgba(219, 234, 254, 0.2);
    --hover-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.1), 0 4px 6px -2px rgba(14, 165, 233, 0.05);
    --transition-speed: 0.2s;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Layout */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Double Sidebar Layout */

/* 1. Macro-Sidebar: Far left slim rail - LIGHT GRAY background */
.macro-sidebar {
    width: 60px;
    background-color: #e2e8f0; /* Light gray background for macro menu */
    border-right: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0;
    position: fixed;
    height: 100vh;
    z-index: 102;
}

.macro-brand {
    margin-bottom: 2rem;
    text-decoration: none;
}

.macro-brand .brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
    color: white;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
}

.macro-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
}

.macro-item {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.macro-link {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569; /* Slate gray icons */
    font-size: 1.25rem;
    text-decoration: none;
    transition: all var(--transition-speed);
}

.macro-link:hover {
    color: var(--primary);
    background-color: #f1f5f9;
}

.macro-item.active .macro-link {
    color: #ffffff; /* White icon on active state */
    background-color: var(--primary); /* Blue primary background */
}

/* Active indicator line on the left */
.macro-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    height: 28px;
    width: 4px;
    background-color: var(--primary);
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Tooltip for macro links */
.macro-link[title]::after {
    content: attr(title);
    position: absolute;
    left: 70px;
    background-color: #1e293b;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed);
    z-index: 110;
}

.macro-link:hover[title]::after {
    opacity: 1;
}

.macro-footer {
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

.macro-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(2, 132, 199, 0.15);
}


/* 2. Sub-Sidebar: Text secondary pane - WHITE background */
.sub-sidebar {
    width: 195px;
    background-color: #ffffff; /* White background for submenus */
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0.85rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 60px;
    height: 100vh;
    z-index: 101;
    overflow-y: auto;
}

.sub-brand-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.sub-menu-title {
    text-transform: uppercase;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

.sub-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.75rem;
}

.sub-menu-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #475569; /* Slate gray text links */
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.825rem;
    transition: all var(--transition-speed);
}

.sub-menu-item a:hover {
    color: var(--text-primary);
    background-color: #f1f5f9;
}

.sub-menu-item.active a {
    color: #0369a1; /* Active blue link text */
    background-color: #e0f2fe; /* Light azure background */
    font-weight: 600;
}


/* Main Content Container - WHITE background */
.main-content {
    margin-left: 255px;
    width: calc(100% - 255px);
    max-width: calc(100% - 255px);
    min-width: 0;
    flex: 1 1 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    box-sizing: border-box;
}

.content-body {
    padding: 1.5rem 1.5rem;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background-color: #ffffff; /* Crisp white background */
}


/* Top Navbar Header */
.top-navbar {
    position: sticky;
    top: 0;
    z-index: 99;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    height: 60px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.top-navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 420px;
    min-width: 0;
}

/* iSpring Search bar */
.top-navbar-search-wrapper {
    position: relative;
    width: 100%;
}

.top-navbar-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    background-color: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 30px;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: all var(--transition-speed);
}

.top-navbar-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.top-navbar-search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.top-navbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.top-navbar-company {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.top-navbar-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.top-navbar-divider {
    color: var(--border-color);
    font-size: 0.95rem;
    user-select: none;
}

/* Header utility buttons */
.top-navbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-speed);
}

.top-navbar-icon-btn:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

.btn-logout-top {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.btn-logout-top:hover {
    background-color: var(--danger);
    color: white !important;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
}


/* Title bars */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: none;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15);
}


/* Panel Cards - Clean white with blue left border */
.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary); /* Elegant left border in azure/blue */
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}


/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* WIDGET CARDS: Styled in a range of colors from light azure to deep blue */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background-color: rgba(255, 255, 255, 0.4);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.775rem;
    font-weight: 600;
    margin-top: 0.15rem;
}

/* Widget Color Palettes: Sky Blue, Azure, Mid-Blue, Deep Navy */
.stat-card:nth-child(4n+1) {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    color: #0369a1;
}
.stat-card:nth-child(4n+1) .stat-value { color: #0369a1; }
.stat-card:nth-child(4n+1) .stat-label { color: #0284c7; }

.stat-card:nth-child(4n+2) {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 1px solid #7dd3fc;
    color: #075985;
}
.stat-card:nth-child(4n+2) .stat-value { color: #075985; }
.stat-card:nth-child(4n+2) .stat-label { color: #0369a1; }

.stat-card:nth-child(4n+3) {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.stat-card:nth-child(4n+3) .stat-value { color: #1e40af; }
.stat-card:nth-child(4n+3) .stat-label { color: #2563eb; }

.stat-card:nth-child(4n+4) {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    color: #1e3a8a;
}
.stat-card:nth-child(4n+4) .stat-value { color: #1e3a8a; }
.stat-card:nth-child(4n+4) .stat-label { color: #1e40af; }


/* Circular Compliance Progress */
.compliance-circle-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.compliance-circle {
    position: relative;
    width: 72px;
    height: 72px;
}

.compliance-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.compliance-circle circle {
    width: 100%;
    height: 100%;
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
}

.compliance-circle .bg {
    stroke: #f1f5f9;
}

.compliance-circle .progress {
    stroke: var(--primary); /* Uses theme azure blue */
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

.compliance-circle .percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}


/* Table Redesign - Soft Azure column headers */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 0.85rem 1rem;
    font-size: 0.725rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #0369a1; /* Azure color headers */
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.05em;
    background-color: #f0f9ff; /* Soft azure table header background */
}

.table td {
    padding: 0.95rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
}

.table tbody tr {
    background-color: #ffffff;
    transition: background-color var(--transition-speed);
}

.table tbody tr:hover {
    background-color: #f1f5f9;
}


/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.725rem;
    font-weight: 600;
}

.badge-success { background-color: rgba(16, 185, 129, 0.08); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background-color: rgba(245, 158, 11, 0.08); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background-color: rgba(239, 68, 68, 0.08); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-info { background-color: rgba(2, 132, 199, 0.08); color: #0284c7; border: 1px solid rgba(2, 132, 199, 0.2); }


/* Form Styling */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: all var(--transition-speed);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
    color: #94a3b8;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2364748b' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1.25rem;
    padding-right: 2rem;
}

select.form-control option {
    background-color: #ffffff;
    color: var(--text-primary);
}


/* Alerts */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success { background-color: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
.alert-danger { background-color: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
.alert-warning { background-color: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }
.alert-info { background-color: var(--info-bg); border: 1px solid var(--info-border); color: var(--info); }


/* Animations */
.fade-in {
    animation: fadeIn var(--transition-speed) ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}


/* Auth Layout */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    flex: 1;
    padding: 2rem;
    background: radial-gradient(circle at 10% 20%, rgba(2, 132, 199, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 40%),
                #f8fafc;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 1.25rem;
}

.auth-brand-logo {
    height: 64px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-logo:hover .auth-brand-logo {
    transform: scale(1.05);
}

.auth-logo .brand-icon {
    width: 44px;
    height: 44px;
    font-size: 1.35rem;
}

.auth-logo .brand-name {
    font-size: 1.4rem;
    font-weight: 700;
}

.auth-logo .brand-name span {
    color: var(--primary);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-footer-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.auth-footer-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}


/* Documents Screen */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.25rem;
}

.doc-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 170px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
}

.doc-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--hover-shadow);
}

.doc-info {
    margin-bottom: 0.75rem;
}

.doc-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
}

.doc-desc {
    font-size: 0.775rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.4rem;
}

.doc-expiry {
    font-size: 0.775rem;
    font-weight: 500;
    margin-top: 0.4rem;
}

.doc-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 0.65rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 0.95rem;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.upload-zone:hover {
    border-color: var(--primary);
    background-color: var(--primary-glow);
}

.upload-icon {
    font-size: 1.35rem;
    color: var(--primary);
    margin-bottom: 0.15rem;
}

.upload-text {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.upload-input {
    display: none;
}


/* Meta Lists (details screens) */
.meta-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.45rem;
    font-size: 0.875rem;
}

.meta-label {
    color: var(--text-muted);
    font-weight: 500;
}

.meta-value {
    font-weight: 600;
    color: var(--text-primary);
}


/* Share overlay */
.public-container {
    width: 100%;
    max-width: 760px;
    margin: 3rem auto;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.public-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.public-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.public-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}


/* Modal structure */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
    overflow-y: auto;
    padding: 2rem 0;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 1.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin: auto;
    transform: translateY(-10px);
    transition: transform var(--transition-speed) ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Floating Modals Centered in Viewport */
.ch-floating-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 14px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

.ch-floating-modal.open,
.ch-floating-modal[style*="display: flex"] {
    display: flex !important;
}

.ch-floating-modal .ch-modal-dialog {
    background: #ffffff !important;
    border-radius: 12px !important;
    width: 100% !important;
    max-width: 620px !important;
    max-height: 90vh !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin: auto !important;
    animation: chModalZoom 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.ch-floating-modal .ch-modal-header {
    padding: 16px 20px !important;
    color: #ffffff !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.ch-floating-modal .ch-modal-body-scroll {
    padding: 20px !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    max-height: calc(90vh - 65px) !important;
}

@keyframes chModalZoom {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.modal-content h1,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content h5,
.modal-content h6 {
    color: var(--text-primary);
}

.modal-content p,
.modal-content span:not(.badge):not(.office-action-icon),
.modal-content label,
.modal-content strong,
.modal-content b,
.modal-content em,
.modal-content li,
.modal-content td,
.modal-content th {
    color: var(--text-primary);
}

.modal-content code {
    background-color: #f1f5f9;
    color: var(--primary);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.modal-content .text-muted,
.modal-content small {
    color: var(--text-muted) !important;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

/* Wide Modal Content */
.modal-content-lg {
    max-width: 960px !important;
}

/* Form layout rows */
.form-grid-row-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-grid-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-grid-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .form-grid-row-6, .form-grid-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .form-grid-row-6, .form-grid-row-2, .form-grid-row-3 {
        grid-template-columns: 1fr;
    }
}

/* Expiry Alarm High Visibility Widget */
.panel-danger-alert {
    border: 2px solid var(--danger) !important;
    border-left: 6px solid var(--danger) !important;
    background-color: #fdf2f2 !important; /* Soft rose background */
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.08) !important;
}

/* Safety styling for widget and card images / SVGs to prevent overflow */
.stat-icon img, .stat-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: inherit;
}
.stat-icon svg, .stat-card svg {
    max-width: 100%;
    max-height: 100%;
}

/* Danger Status Statistic Card (Red Style) */
.widget-danger {
    background: linear-gradient(135deg, #fdf2f2 0%, #fde2e2 100%) !important;
    border: 1px solid #fca5a5 !important;
    color: #b91c1c !important;
}
.widget-danger .stat-value {
    color: #b91c1c !important;
}
.widget-danger .stat-label {
    color: #ef4444 !important;
}

/* Table Redesign - Soft Azure column headers */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    scrollbar-width: thin;
}

.btn-actions-group {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ==========================================================================
   RESPONSIVE DESIGN OVERRIDES
   ========================================================================== */

/* Responsive Grid Layouts for OAM Plugin and general layouts */
.grid-main-side-340 {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

.grid-main-side-320 {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.grid-sidebar-content-240 {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

/* Sidebar Toggle & Overlay Menu */
.sidebar-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    margin-right: 1rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    z-index: 100;
}

/* --------------------------------------------------------------------------
   Schermi laptop e display intermedi (fino a 1366px)
   -------------------------------------------------------------------------- */
@media (max-width: 1366px) {
    /* Sidebars compatte */
    .macro-sidebar {
        width: 56px !important;
        padding: 1rem 0 !important;
    }
    .macro-brand {
        margin-bottom: 1.25rem !important;
    }
    .macro-brand .brand-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.95rem !important;
    }
    .macro-menu {
        gap: 0.75rem !important;
    }
    .macro-link {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.15rem !important;
    }
    .macro-link[title]::after {
        left: 64px !important;
    }
    .macro-user-avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.9rem !important;
    }
    
    .sub-sidebar {
        width: 180px !important;
        left: 56px !important;
        padding: 1.25rem 0.75rem 1rem 0.85rem !important;
    }
    .sub-brand-title {
        font-size: 1rem !important;
        margin-bottom: 1.25rem !important;
    }
    .sub-menu-title {
        font-size: 0.65rem !important;
        margin-bottom: 0.45rem !important;
    }
    .sub-menu-item a {
        padding: 0.4rem 0.55rem !important;
        font-size: 0.8rem !important;
        gap: 0.4rem !important;
    }
    
    /* Contenuto principale con margini ottimizzati */
    .main-content {
        margin-left: 236px !important;
        width: calc(100% - 236px) !important;
        max-width: calc(100% - 236px) !important;
        min-width: 0 !important;
    }
    .content-body {
        padding: 1.25rem 1rem !important;
        min-width: 0 !important;
    }
    
    /* Top Navbar compatta */
    .top-navbar {
        padding: 0 1rem !important;
        height: 56px !important;
    }
    .top-navbar-search-input {
        width: 140px !important;
        font-size: 0.8rem !important;
    }
    .top-navbar-company, .top-navbar-role {
        font-size: 0.775rem !important;
        max-width: 140px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: inline-block !important;
        vertical-align: middle !important;
    }
    .top-navbar-divider {
        margin: 0 0.35rem !important;
    }
    
    /* Tabelle compatte ad alta densità per 1240px */
    .table th {
        padding: 0.65rem 0.5rem !important;
        font-size: 0.68rem !important;
        letter-spacing: 0.02em !important;
    }
    .table td {
        padding: 0.7rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
    .btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.8rem;
    }
    .btn-sm {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.725rem !important;
        white-space: nowrap !important;
    }
    .btn-actions-group {
        gap: 0.25rem !important;
        min-width: 150px !important;
    }
    
    /* Dashboard & Multi-Column Layouts Stacking per schermi <= 1240px */
    .dashboard-two-col,
    .grid-two-col,
    .grid-1fr-1fr,
    .grid-main-side,
    .grid-main-side-400,
    .grid-sidebar-content-280,
    .grid-main-side-340,
    .grid-main-side-320,
    .grid-sidebar-content-240 {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    /* Pannelli e Statistiche */
    .panel {
        padding: 1.25rem !important;
        margin-bottom: 1.25rem !important;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        gap: 0.75rem !important;
    }
    .stat-card {
        padding: 0.85rem 0.75rem !important;
        gap: 0.65rem !important;
    }
    .stat-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
    }
    .stat-value {
        font-size: 1.25rem !important;
    }
    .stat-label {
        font-size: 0.7rem !important;
    }
    
    .top-bar {
        margin-bottom: 1.25rem !important;
        gap: 0.75rem !important;
    }
    .top-bar .page-title h1 {
        font-size: 1.35rem !important;
    }
    .top-bar .page-title p {
        font-size: 0.8rem !important;
    }
}

/* --------------------------------------------------------------------------
   Definizioni Standard Griglie Dashboard
   -------------------------------------------------------------------------- */
.dashboard-two-col,
.grid-two-col,
.grid-1fr-1fr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-main-side-400 {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
}

.grid-sidebar-content-280 {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
}

.grid-main-side-340 {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
}

.grid-main-side-320 {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.grid-sidebar-content-240 {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}

/* --------------------------------------------------------------------------
   Tablet e schermi piccoli (<= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .sidebar-toggle {
        display: block;
    }
    
    .macro-sidebar {
        left: -290px !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sub-sidebar {
        left: -220px !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    body.sidebar-open .macro-sidebar {
        left: 0 !important;
    }
    
    body.sidebar-open .sub-sidebar {
        left: 60px !important;
    }
    
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
}

@media (max-width: 992px) {
    .grid-main-side-340,
    .grid-main-side-320,
    .grid-sidebar-content-240 {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .top-navbar {
        padding: 0 1rem !important;
    }
    
    .top-navbar-company, 
    .top-navbar-role, 
    .top-navbar-divider {
        display: none !important;
    }
    
    .content-body {
        padding: 1.25rem 0.85rem !important;
    }
    
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}




