/* 
  ADMIN HEART - DASHBOARD STYLING
  Extends base.css with specialized layouts for empire management.
*/

/* --- Settings Expansion Styles --- */
.settings-tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2.5rem;
    padding-bottom: 0.5rem;
}

/* --- Ecosystem Settings Two-Column Layout --- */
.settings-layout-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.settings-sidebar-nav {
    width: 270px;
    min-width: 270px;
    background: #FFF;
    border: 1px solid rgba(24,23,26,0.08);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.settings-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-nav-header {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--color-stone, #8A8885);
    padding: 0 0.5rem 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(24,23,26,0.06);
    margin-bottom: 0.25rem;
}

.settings-nav-item {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: var(--color-charcoal, #18171A);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.settings-nav-item i,
.settings-nav-item svg {
    width: 16px;
    height: 16px;
    color: var(--color-stone, #8A8885);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.settings-nav-item:hover {
    background: rgba(200,154,90,0.08);
    color: var(--color-gold, #C89A5A);
}

.settings-nav-item:hover i,
.settings-nav-item:hover svg {
    color: var(--color-gold, #C89A5A);
}

.settings-nav-item.active {
    background: var(--color-charcoal, #18171A);
    color: #F8F5F0;
    box-shadow: 0 2px 8px rgba(24,23,26,0.15);
}

.settings-nav-item.active i,
.settings-nav-item.active svg {
    color: var(--color-gold, #C89A5A);
}

.settings-content-pane {
    flex: 1;
    min-width: 0;
}

@media (max-width: 1024px) {
    .settings-layout-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .settings-sidebar-nav {
        width: 100%;
        min-width: 100%;
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--color-stone);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--color-charcoal);
}

.tab-btn.active {
    color: var(--color-gold);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.6rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-gold);
}

.settings-tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.settings-tab-content.active {
    display: block;
}

/* --- Premium Loading & Feedback --- */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 1.5rem;
    color: var(--color-stone);
    animation: fadeIn 0.5s var(--ease-premium);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(200, 154, 90, 0.1);
    border-top: 3px solid var(--color-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.notification-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--color-charcoal);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-float);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s var(--ease-premium);
}

.notification-toast.active {
    transform: translateY(0);
    opacity: 1;
}

.notification-toast.success { border-left: 4px solid #27ae60; }
.notification-toast.error { border-left: 4px solid var(--color-coral); }
.notification-toast.info { border-left: 4px solid var(--color-gold); }

.settings-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.switch-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(24, 23, 26, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.switch-label h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-charcoal);
}

.switch-label p {
    font-size: 0.75rem;
    color: var(--color-stone);
}

/* Premium Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #E2E8F0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--color-gold);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

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

/* --- BRANCH MANAGEMENT STYLES --- */
.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.branch-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid rgba(184, 154, 110, 0.15);
    border-radius: 12px;
    transition: all 0.3s var(--ease-premium);
    position: relative;
    overflow: hidden;
}

.branch-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.branch-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-gold);
    opacity: 0.3;
}

.branch-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.branch-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-charcoal);
}

.branch-type-tag {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(200, 154, 90, 0.1);
    color: var(--color-gold);
    letter-spacing: 1px;
}

.branch-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-stone);
}

.meta-item i {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.branch-status-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-status-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.status-draft {
    background: rgba(24, 23, 26, 0.04);
    color: var(--color-stone);
    border: 1px solid rgba(24, 23, 26, 0.08);
}
.status-pending {
    background: rgba(200, 154, 90, 0.06);
    color: var(--color-gold);
    border: 1px solid rgba(200, 154, 90, 0.12);
}
.status-confirmed {
    background: rgba(39, 174, 96, 0.06);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.12);
}
.status-active-session {
    background: rgba(224, 90, 71, 0.06);
    color: var(--color-coral);
    border: 1px solid rgba(224, 90, 71, 0.12);
}
.status-completed {
    background: rgba(39, 174, 96, 0.12);
    color: #1e7e34;
    border: 1px solid rgba(39, 174, 96, 0.2);
}
.status-cancelled {
    background: rgba(186, 45, 37, 0.06);
    color: #ba2d25;
    border: 1px solid rgba(186, 45, 37, 0.12);
}
.status-noshow {
    background: rgba(127, 140, 141, 0.08);
    color: #7f8c8d;
    border: 1px solid rgba(127, 140, 141, 0.15);
}
.status-rescheduled {
    background: rgba(155, 89, 182, 0.06);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.12);
}

.status-active { 
    background: rgba(39, 174, 96, 0.08); 
    color: #27ae60; 
    border: 1px solid rgba(39, 174, 96, 0.15); 
}
.status-suspended { 
    background: rgba(200, 154, 90, 0.08); 
    color: var(--color-gold); 
    border: 1px solid rgba(200, 154, 90, 0.15); 
}
.status-closed { 
    background: rgba(231, 76, 60, 0.08); 
    color: var(--color-coral); 
    border: 1px solid rgba(231, 76, 60, 0.15); 
}

.branch-card.suspended {
    opacity: 0.8;
    filter: grayscale(0.5);
}

.branch-card.closed {
    opacity: 0.6;
    filter: grayscale(1);
    border-style: dashed;
}

.branch-card.suspended::before { background: var(--color-gold); }
.branch-card.closed::before { background: var(--color-coral); }

.branch-actions-menu {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(184, 154, 110, 0.05);
}

.btn-branch-action {
    background: none;
    border: 1px solid rgba(184, 154, 110, 0.1);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-stone);
}

.btn-branch-action:hover {
    background: rgba(184, 154, 110, 0.05);
    color: var(--color-gold);
    border-color: var(--color-gold);
}

.btn-branch-action.danger:hover {
    background: #fee8e6;
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-branch-action.active {
    background: rgba(200, 154, 90, 0.1);
    color: var(--color-gold);
    border-color: var(--color-gold);
}

.admin-shell {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    background-color: var(--color-ivory);
    color: var(--color-charcoal);
    overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(184, 154, 110, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
}

.sidebar-header .logo {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-charcoal);
    line-height: 1.4;
    display: block; /* Changed from flex to allow natural wrapping */
    overflow-wrap: break-word;
    max-width: 100%;
}

.sidebar-header .logo .gold {
    color: var(--color-gold);
    font-weight: 800;
    margin-right: 1px;
}

.sidebar-header .tagline {
    font-size: 0.65rem;
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 0.6rem;
    opacity: 0.8;
    font-weight: 600;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem;
}

/* Custom Scrollbar for Sidebar */
.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(184, 154, 110, 0.1);
    border-radius: 10px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(24, 23, 26, 0.5);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--color-charcoal);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.nav-item i {
    width: 18px;
    height: 18px;
    stroke-width: 1.5px;
    opacity: 0.7;
}

.nav-item:hover {
    background: rgba(184, 154, 110, 0.05);
}

.nav-item.active {
    background: var(--color-charcoal);
    color: var(--color-ivory);
}

.nav-item.active i {
    color: var(--color-gold);
    opacity: 1;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(184, 154, 110, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--color-gold);
    color: var(--color-ivory);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.user-info .name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info .role {
    font-size: 0.7rem;
    opacity: 0.6;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 46px;
    border: 1px solid rgba(24, 23, 26, 0.1);
    background: transparent;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #FF4B2B;
    color: white;
    border-color: #FF4B2B;
}

/* --- MAIN CONTENT AREA --- */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 2rem 3rem;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
}

.header-left h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: -1px;
}

.header-left p {
    color: var(--color-gold);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-bell i {
    width: 22px;
    height: 22px;
}

.notification-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-coral);
    color: white;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-date {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.7;
}

/* --- DASHBOARD WIDGETS --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(184, 154, 110, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--color-gold);
}

.card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 300;
    margin-top: 0.5rem;
}

.card-footer {
    margin-top: 1rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trend-up { color: #27ae60; }
.trend-down { color: var(--color-coral); }

/* --- REVEAL ANIMATION --- */
.reveal {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(24, 23, 26, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--color-ivory);
    width: 90%;
    max-width: 600px;
    border-radius: 14px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

/* --- SETTINGS STYLES --- */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.settings-group {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(184, 154, 110, 0.1);
}

.settings-group h2 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(184, 154, 110, 0.1);
}

.form-group, .form-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Increased gap for better vertical rhythm */
    margin-bottom: 2rem; /* Consistent spacing between groups */
}

.form-group label, .form-row label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-stone);
}

.form-group input, 
.form-group select,
.form-row input,
.form-row select {
    height: 46px; /* 46px Rule */
    padding: 0 1.25rem;
    border: 1px solid rgba(24, 23, 26, 0.12);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.9rem;
    background: #FFF;
    color: var(--color-charcoal);
    transition: all 0.3s var(--ease-premium);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.form-group input:hover,
.form-row input:hover {
    border-color: rgba(24, 23, 26, 0.2);
}

.form-group input:focus,
.form-row input:focus {
    outline: none;
    border-color: var(--color-gold);
    background: #FFF;
    box-shadow: 0 0 0 4px rgba(200, 154, 90, 0.1);
}

.btn-primary {
    height: 46px;
    background: var(--color-charcoal);
    color: #fff;
    border: none;
    padding: 0 2rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(24, 23, 26, 0.15);
}

.btn-primary:hover {
    background: var(--color-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 154, 90, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    height: 46px;
    background: #fff;
    color: var(--color-charcoal);
    border: 1px solid rgba(24, 23, 26, 0.1);
    padding: 0 2rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-secondary:hover {
    background: rgba(24, 23, 26, 0.02);
    border-color: var(--color-gold);
    color: var(--color-gold);
}

/* --- DATA TABLES --- */
.table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(184, 154, 110, 0.1);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    background: rgba(184, 154, 110, 0.05);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(184, 154, 110, 0.1);
    font-size: 0.9rem;
}

.badge-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-success { background: #e8f8f0; color: #27ae60; }
.badge-warning { background: #fff8e6; color: #f39c12; }
.badge-danger { background: #fee8e6; color: #e74c3c; }

/* --- ACTIVITY FEED --- */
.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon i {
    width: 20px;
    height: 20px;
}

.activity-icon.sale { background: #E8F8F0; color: #27AE60; }
.activity-icon.appointment { background: #EEF2FF; color: #4F46E5; }
.activity-icon.stock { background: #FFF7ED; color: #EA580C; }

/* Radical Alignment: The Golden Grid Pulse (Stacked Intelligence) */
.pulse-row {
    display: grid;
    /* Icon (40px) | Activity (1.5fr) | Context (1.3fr) | Staff (2fr) | Source (1.1fr) | Value (1.1fr) | Time (1.4fr) */
    grid-template-columns: 40px 1.5fr 1.3fr 2fr 1.1fr 1.1fr 1.4fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
    min-height: 80px; /* Standardized height for 2-line snapshots */
}

.activity-header {
    background: rgba(184, 154, 110, 0.05);
    border-bottom: 1px solid rgba(184, 154, 110, 0.1);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-stone);
    letter-spacing: 1px;
    padding-top: 1rem;
    padding-bottom: 1rem;
    min-height: auto; /* Header doesn't need 2-line height */
}

.activity-item {
    border-bottom: 1px solid rgba(184, 154, 110, 0.08);
    transition: all 0.3s var(--ease-premium);
}

.activity-item:hover {
    background: rgba(184, 154, 110, 0.03);
}

.snapshot-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
}

.snapshot-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snapshot-secondary {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-stone);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(24, 23, 26, 0.05);
    color: var(--color-charcoal);
    display: inline-block;
    letter-spacing: 0.5px;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    text-align: center;
    color: var(--color-coral);
}

.error-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(24, 23, 26, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

body.modal-open,
body.body-scroll-lock {
    overflow: hidden !important;
    touch-action: none !important;
    overscroll-behavior: contain !important;
}

.modal-window {
    background: var(--color-ivory);
    width: 100%;
    max-width: 650px;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(184, 154, 110, 0.2);
    transition: max-width 0.4s var(--ease-premium);
}

.modal-window.wide {
    max-width: min(92vw, 1280px);
    width: 90vw;
    box-sizing: border-box;
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(24, 23, 26, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-stone);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: var(--color-coral);
    color: #fff;
    transform: rotate(90deg);
}

.modal-close-btn i {
    width: 18px;
    height: 18px;
}

.modal-content-inner {
    padding: 3rem; /* More generous padding for luxury feel */
}

.modal-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(184, 154, 110, 0.1);
    padding-bottom: 1.5rem;
}

.modal-header h2, .modal-header h3 {
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--color-charcoal);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.modal-header p {
    color: var(--color-gold);
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- RECEIPTS --- */
.receipt-container {
    padding: 3rem;
    background: #fff;
    color: #000;
    font-family: 'Inter', sans-serif;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #eee;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.receipt-header h2 {
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.receipt-info {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.receipt-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.receipt-table td {
    padding: 0.75rem 0;
    font-size: 0.9rem;
}

.receipt-total {
    border-top: 2px solid #eee;
    padding-top: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.total-row.main {
    font-weight: 800;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

.receipt-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #666;
}

.receipt-actions {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* --- ACTION BUTTONS --- */
.btn-activity-view {
    width: 60px; /* Fixed width for alignment precision */
    height: 32px;
    background: rgba(184, 154, 110, 0.1);
    color: var(--color-gold);
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-activity-view:hover {
    background: var(--color-gold);
    color: #fff;
}

.activity-detail {
    font-size: 0.85rem;
    color: var(--color-stone);
    margin: 0.25rem 0;
}

/* --- RISK BADGES --- */
.risk-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
}

.risk-high { background: #fee2e2; color: #ef4444; }
.risk-medium { background: #ffedd5; color: #f97316; }
.risk-low { background: #f0fdf4; color: #22c55e; }

@media print {
    .sidebar, header, .receipt-actions, .modal-close-btn {
        display: none !important;
    }
    .modal-overlay {
        position: absolute;
        background: white;
        padding: 0;
    }
    .modal-window {
        box-shadow: none;
        border: none;
        max-height: none;
    }
}

/* Administrative Action Buttons */
.btn-action-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(184, 154, 110, 0.2);
    background: white;
    color: var(--color-charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-premium);
}

.btn-action-sm:hover {
    background: var(--color-gold);
    color: white;
    border-color: var(--color-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 154, 90, 0.2);
}

.btn-action-sm i {
    width: 14px;
    height: 14px;
}

/* --- NESTED INVENTORY SYSTEM (POS MIRROR) --- */
.product-master-row {
    cursor: pointer;
    transition: background 0.2s var(--ease-premium);
}

.product-master-row:hover {
    background: rgba(184, 154, 110, 0.05) !important;
}

.toggle-arrow {
    display: inline-flex;
    transition: transform 0.3s var(--ease-premium);
    color: var(--color-gold);
}

.toggle-arrow.expanded {
    transform: rotate(90deg);
}

.sku-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(24, 23, 26, 0.03);
    border-radius: 4px;
    border: 1px solid rgba(24, 23, 26, 0.05);
}

.batch-details-nested {
    background: rgba(248, 245, 240, 0.6); /* Soft Ivory backdrop */
}

.batch-container-nested {
    padding: 1.5rem 2.5rem 1.5rem 4rem;
    border-left: 3px solid var(--color-gold);
    margin: 0.5rem 0 0.5rem 1.5rem;
    background: white;
    border-radius: 0 12px 12px 0;
    box-shadow: inset 5px 0 15px rgba(0,0,0,0.02);
}

.batch-header-nested {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr 1fr 1.5fr;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--color-stone);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(184, 154, 110, 0.1);
    margin-bottom: 0.75rem;
}

.batch-nested-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr 1fr 1.5fr;
    font-size: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(184, 154, 110, 0.05);
    align-items: center;
}

.batch-nested-row:last-child {
    border-bottom: none;
}

.batch-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.low-stock-badge {
    background: #fee8e6;
    color: #e74c3c;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --- POS Status Mirrors --- */
.status-critical { background: rgba(231, 76, 60, 0.1); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.2); }
.status-warning { background: rgba(243, 156, 18, 0.1); color: #f39c12; border: 1px solid rgba(243, 156, 18, 0.2); }
.status-safe { background: rgba(39, 174, 96, 0.1); color: #27ae60; border: 1px solid rgba(39, 174, 96, 0.2); }

.expiry-status {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Improved Form Layouts --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group-full {
    grid-column: span 2;
}

.modal-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(184, 154, 110, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-trash:hover {
    background: var(--color-coral) !important;
    border-color: var(--color-coral) !important;
}

/* --- POS-IDENTICAL DATE PICKER (LIGHT THEME ADAPTED) --- */
.date-picker-wrapper {
    position: relative;
    width: 100%;
}

.date-picker-popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 260px;
    background: white;
    border: 1px solid rgba(184, 154, 110, 0.2);
    border-radius: 12px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
    padding: 1rem;
    z-index: 1000;
    margin-bottom: 10px;
}

.dp-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dp-select {
    flex: 1;
    height: 36px !important;
    padding: 0 0.5rem !important;
    font-size: 0.8rem !important;
    background: rgba(24, 23, 26, 0.03) !important;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dp-day-label {
    font-size: 0.65rem;
    opacity: 0.5;
    text-align: center;
    padding: 0.5rem 0;
    font-weight: 700;
    text-transform: uppercase;
}

.dp-day {
    font-size: 0.8rem;
    padding: 0.6rem 0;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.dp-day:hover:not(.empty) {
    background: rgba(184, 154, 110, 0.1);
    color: var(--color-gold);
}

.dp-day.selected {
    background: var(--color-gold);
    color: white;
    font-weight: 700;
}

.dp-day.empty {
    cursor: default;
}

/* --- FINANCIAL PREVIEW BOX --- */
.financial-preview-box {
    background: rgba(24, 23, 26, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(24, 23, 26, 0.05);
}

.preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.preview-row:last-child {
    margin-bottom: 0;
}

.preview-label {
    font-size: 0.7rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preview-value {
    font-weight: 600;
    color: var(--color-charcoal);
}

.preview-value.highlight {
    color: var(--color-gold);
    font-size: 1.1rem;
    font-weight: 800;
}

.preview-divider {
    height: 1px;
    background: rgba(24, 23, 26, 0.05);
    margin: 0.75rem 0;
}

/* --- ICON COLORS --- */
.fa-edit { color: var(--color-gold); }
.fa-trash { color: var(--color-coral); }
.fa-download { margin-right: 6px; }


/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ENGINE (RULE 18 & RULE 9 STANDARDS)
   ========================================================================== */

@media screen and (max-width: 1024px) {
    /* Main layout adjustment */
    .admin-shell {
        flex-direction: column;
        position: relative;
    }

    /* Convert Sidebar into dynamic Off-Canvas touch-activated Drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 1000;
        background: var(--color-ivory);
        box-shadow: 10px 0 30px rgba(0,0,0,0.15);
        border-right: 1px solid rgba(200, 154, 90, 0.2);
    }

    /* Active State of Sidebar on Mobile */
    .sidebar.mobile-active {
        transform: translateX(0);
    }

    /* Prevent total body/viewport horizontal sheared scrolling (Rule 24 absolute mobile safety) */
    body, html, .admin-shell {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Content Area full width */
    .content-area {
        padding: 1.25rem 1rem;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        min-height: calc(100vh - 70px);
        overflow-x: hidden !important;
    }

    /* Ensure card tables convert to elegant full-width stacked blocks on mobile (Rule 24 Zero-Scroll Standard) */
    .card, .table-container {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    /* Transform Table structure to Block flow */
    .card table, .table-container table,
    .card thead, .table-container thead,
    .card tbody, .table-container tbody,
    .card th, .table-container th,
    .card td, .table-container td,
    .card tfoot, .table-container tfoot {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Only stack visible table rows. Nested detail rows keep their inline display-toggle rules */
    .card tr, .table-container tr {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Hide standard headers to avoid redundant empty blocks on mobile */
    .card thead tr, .table-container thead tr {
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
    }

    .card tr.batch-details-nested, .table-container tr.batch-details-nested {
        display: none; /* Stays toggled off until clicked */
    }

    /* Add beautiful card styling for individual database table rows */
    .card tbody tr:not(.batch-details-nested), .table-container tbody tr:not(.batch-details-nested),
    .product-master-row {
        background: #FFF !important;
        border: 1px solid rgba(200, 154, 90, 0.15) !important;
        border-radius: 10px !important;
        margin-bottom: 1.25rem !important;
        padding: 1.25rem !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important;
        height: auto !important;
        position: relative !important;
        transition: transform 0.2s ease !important;
        display: block !important;
    }

    /* Cell layout alignments */
    .card td, .table-container td {
        border-bottom: none !important;
        padding: 0.5rem 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
        font-size: 0.88rem !important;
    }

    /* Dynamic Label generation via CSS before cells */
    .card td::before, .table-container td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.72rem;
        color: var(--color-stone);
        letter-spacing: 0.05em;
        float: left;
        text-align: left;
    }

    /* Remove column spacing issues inside inline td containers */
    .card td > *, .table-container td > * {
        text-align: right !important;
    }

    /* Adjust nested table detail blocks specifically */
    .batch-details-nested {
        border: none !important;
        box-shadow: none !important;
        background: rgba(24, 23, 26, 0.02) !important;
        margin-top: -0.75rem !important;
        margin-bottom: 1rem !important;
        padding: 0.75rem !important;
        border-radius: 0 0 10px 10px !important;
    }

    .batch-container-nested {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .batch-nested-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.35rem !important;
        border-bottom: 1px dashed rgba(24,23,26,0.08) !important;
        padding-bottom: 0.75rem !important;
        align-items: stretch !important;
    }

    .batch-nested-row:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .batch-nested-row > span {
        display: flex !important;
        justify-content: space-between !important;
    }

    .batch-nested-row > span::before {
        font-weight: 700;
        font-size: 0.7rem;
        text-transform: uppercase;
        color: var(--color-stone);
    }

    .batch-nested-row > span:nth-child(1)::before { content: "Batch Number:"; }
    .batch-nested-row > span:nth-child(2)::before { content: "Quantity:"; }
    .batch-nested-row > span:nth-child(3)::before { content: "Expiry Date:"; }
    .batch-nested-row > span:nth-child(4)::before { content: "Batch Status:"; }

    .batch-actions {
        margin-top: 0.5rem !important;
        justify-content: flex-end !important;
    }

    /* Total footer totalizer block display */
    .card tfoot tr {
        border: none !important;
        padding: 1rem 0 !important;
        background: transparent !important;
    }

    .card tfoot td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border: 1px dashed rgba(200, 154, 90, 0.3) !important;
        background: rgba(200, 154, 90, 0.05) !important;
        border-radius: 8px !important;
        padding: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .card tfoot td::before {
        content: "Portfolio Total:";
        font-weight: 800;
        color: var(--color-charcoal);
    }

    /* Content Header alignment */
    .content-header {
        padding-bottom: 1.25rem;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid rgba(24, 23, 26, 0.05);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    /* Show Mobile Hamburger Toggle */
    #mobile-hamburger-btn {
        display: flex !important;
    }

    /* Show Mobile Close Button inside Drawer Header */
    #mobile-sidebar-close-btn {
        display: block !important;
    }

    /* Hide redundant elements or stack them */
    .header-right {
        gap: 1rem !important;
    }

    .top-user-pill {
        padding: 0.3rem 0.6rem !important;
    }

    .top-user-meta {
        display: none !important; /* Hide name/role on tiny displays to conserve space */
    }

    .current-date {
        display: none !important; /* Conserve horizontal line space */
    }

    /* Dynamic grids become stacks beautifully */
    .dashboard-grid,
    #inventory-snapshot-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Action & Selector bars wrapping flow */
    .action-bar {
        flex-direction: column !important;
        gap: 1.25rem !important;
        padding: 1.25rem !important;
        align-items: stretch !important;
    }

    .action-bar > div {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 1rem !important;
    }

    .action-bar .form-row {
        width: 100% !important;
    }

    .action-bar button,
    .action-bar select,
    .action-bar input {
        width: 100% !important;
    }

    /* Scrollable responsive tables so dynamic columns never overlap */
    .table-container {
        overflow-x: hidden !important;
        border-radius: 8px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .data-table {
        min-width: 100% !important; /* Allow tables to scale down fully to match block transformation card bounds */
    }

    /* Settings Tab items wrap gracefully */
    .settings-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.75rem;
        gap: 0.75rem;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.78rem;
    }

    /* Form rows stacking */
    .settings-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

@media screen and (max-width: 480px) {
    .content-header {
        gap: 0.5rem;
    }

    .header-left {
        min-width: 0;
        gap: 0.4rem !important;
    }

    .header-left h1 {
        font-size: clamp(1.15rem, 6vw, 1.45rem);
        letter-spacing: -0.03em;
    }

    .header-left p {
        display: none;
    }

    .header-right {
        flex: 0 0 auto;
        gap: 0.35rem !important;
    }

    .notification-bell {
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .top-user-pill {
        width: 46px;
        height: 46px;
        padding: 0 !important;
        justify-content: center;
    }

    .top-avatar,
    .top-btn-logout span {
        display: none !important;
    }

    .top-btn-logout {
        width: 46px;
        height: 46px;
        padding: 0 !important;
        margin: 0 !important;
        border-left: 0 !important;
        justify-content: center;
    }

    /* Tiny Phone Snapshot grids */
    .dashboard-grid,
    #inventory-snapshot-grid {
        grid-template-columns: 1fr !important;
    }

    .metric-value {
        font-size: 1.45rem !important;
    }
}

/* ==========================================================================
   🖨️ EXECUTIVE PRINT OVERRIDES (Rule 20 / Rule 6)
   Transforms the digital command dashboard into a pristine paper/PDF report.
   ========================================================================== */
@media print {
    body, html {
        background: #FFFFFF !important;
        color: #18171A !important;
        font-family: 'Plus Jakarta Sans', Arial, sans-serif !important;
        font-size: 10pt !important;
    }

    /* 🚫 Hide Interactive/Non-Report UI Controls */
    .sidebar,
    header,
    .action-bar,
    .modal-overlay,
    .modal,
    button,
    .btn-primary,
    .btn-secondary,
    .cta-btn,
    .export-bar,
    .toast,
    .notification-toast,
    #customToast,
    .current-date,
    .top-user-pill,
    .filters,
    form {
        display: none !important;
    }

    /* 📦 Expand main content container to full page width */
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
    }

    /* 🏷️ Render luxury titles neatly */
    h1, h2, h3, h4 {
        color: #18171A !important;
        page-break-after: avoid;
    }

    h1 {
        font-size: 20pt !important;
        border-bottom: 2px solid #5B4033 !important;
        padding-bottom: 5px !important;
        margin-bottom: 20px !important;
    }

    /* 📊 Convert grids and cards to elegant tables/lists */
    .dashboard-grid,
    #inventory-snapshot-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
        margin-bottom: 30px !important;
        page-break-inside: avoid;
    }

    .metric-card {
        background: #FFFFFF !important;
        border: 1px solid #7A7672 !important;
        box-shadow: none !important;
        padding: 15px !important;
        color: #18171A !important;
    }

    .metric-title {
        color: #5B4033 !important;
        font-size: 8pt !important;
        text-transform: uppercase !important;
    }

    .metric-value {
        color: #18171A !important;
        font-size: 16pt !important;
    }

    /* 📋 Pristine tabular reports */
    .table-container {
        border: 1px solid #7A7672 !important;
        box-shadow: none !important;
        margin-bottom: 30px !important;
        page-break-inside: avoid;
    }

    .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .data-table th {
        background: #F8F5F0 !important;
        color: #18171A !important;
        border-bottom: 2px solid #5B4033 !important;
        font-weight: bold !important;
        font-size: 9pt !important;
        padding: 8px !important;
    }

    .data-table td {
        border-bottom: 1px solid #7A7672 !important;
        font-size: 8.5pt !important;
        padding: 8px !important;
        color: #18171A !important;
    }

    /* 📄 Prevent split tables or cut-offs */
    tr {
        page-break-inside: avoid !important;
    }

    img {
        max-width: 150px !important;
    }
}

/* --- Homecare Sidebar Accordion Tree --- */
.nav-item-accordion {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-item-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--color-charcoal);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    user-select: none;
}

.nav-item-parent:hover {
    background: rgba(184, 154, 110, 0.05);
}

.nav-item-accordion.expanded .accordion-chevron {
    transform: rotate(90deg);
}

.nav-submenu-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding-left: 1.25rem;
    gap: 0.25rem;
}

.nav-item-accordion.expanded .nav-submenu-list {
    max-height: 500px; /* Fully expands child submenus and nested subaccordions smoothly */
}

.submenu-nav-item {
    font-size: 0.88rem !important;
    padding: 0.6rem 0.85rem !important;
    opacity: 0.85;
}

.submenu-nav-item:hover {
    opacity: 1;
}

.submenu-nav-item.active {
    background: rgba(200, 154, 90, 0.15) !important;
    color: var(--color-charcoal) !important;
    font-weight: 600;
}

.submenu-nav-item.active i {
    color: var(--color-gold) !important;
    opacity: 1 !important;
}

/* Sub-Accordion for Home Page Editor Sections */
.nav-item-subaccordion {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-item-subparent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: var(--color-charcoal);
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.3s ease;
    user-select: none;
    opacity: 0.85;
}

.nav-item-subparent:hover {
    background: rgba(184, 154, 110, 0.05);
    opacity: 1;
}

.nav-item-subaccordion.expanded .subaccordion-chevron {
    transform: rotate(90deg);
}

.nav-subsubmenu-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding-left: 1.25rem;
    gap: 0.2rem;
}

.nav-item-subaccordion.expanded .nav-subsubmenu-list {
    max-height: 200px;
}

.subsubmenu-nav-item {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.75rem !important;
    opacity: 0.75;
}

.subsubmenu-nav-item:hover {
    opacity: 1;
}

.subsubmenu-nav-item.active {
    background: rgba(200, 154, 90, 0.1) !important;
    color: var(--color-charcoal) !important;
    font-weight: 600;
}

/* ==============================================================================
   EXECUTIVE GENERAL PULSE DASHBOARD STYLING
   ============================================================================== */
.pulse-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.pulse-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.pulse-card-clickable {
    background: #FFFFFF;
    border: 1px solid rgba(24,23,26,0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all 0.25s var(--ease-premium);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(24,23,26,0.02);
}

.pulse-card-clickable:hover {
    transform: translateY(-4px);
    border-color: var(--color-gold);
    box-shadow: 0 10px 25px rgba(200, 154, 90, 0.15);
}

.pulse-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.pulse-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-stone);
}

.pulse-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(200, 154, 90, 0.08);
    color: var(--color-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-card-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-charcoal);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.pulse-sub-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(24,23,26,0.08);
    font-size: 0.78rem;
}

.pulse-sub-tag {
    background: rgba(24,23,26,0.04);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: var(--color-charcoal);
    font-weight: 600;
}

.pulse-sub-tag.highlight {
    background: rgba(200,154,90,0.12);
    color: var(--color-gold);
}

.pulse-sub-tag.alert {
    background: rgba(224,90,71,0.12);
    color: #E05A47;
}

/* Branch Performance & Progress Bars */
.pulse-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(24,23,26,0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.4rem;
    margin-bottom: 0.25rem;
}

.pulse-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold), #E05A47);
    border-radius: 4px;
    transition: width 0.6s var(--ease-premium);
}

/* Urgent Task List */
.pulse-urgent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pulse-urgent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(24,23,26,0.02);
    border: 1px solid rgba(24,23,26,0.06);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.pulse-urgent-item:hover {
    background: rgba(200,154,90,0.05);
    border-color: rgba(200,154,90,0.2);
}

@media (max-width: 768px) {
    .pulse-grid-2 {
        grid-template-columns: 1fr;
    }
}

