    /* Global Box Sizing Reset */
    *, *::before, *::after {
        box-sizing: border-box;
    }

    /* Prevent body and html from scrolling */
    html, body {
        height: 100%;
        overflow: hidden;
    }

    :root {
        --smp-primary: #1976D2;
        --smp-primary-dark: #004BA0;
        --smp-gray: #767676;
        --smp-border: #d6d6d6;
        --smp-hover: #f5f5f5;
        --smp-header-bg: #fff;
        --smp-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
        
        /* Toast Colors */
        --toast-bg: #333;
        --toast-text: #fff;
        --toast-success: #008a32;
        --toast-error: #d32f2f;
        --toast-info: #0288d1;
    }

    /* --- DARK MODE VARIABLES --- */
    body.dark-mode {
        --smp-primary: #64B5F6;
        --smp-gray: #aaa;
        --smp-border: #444;
        --smp-hover: #333;
        --smp-header-bg: #222;
        background-color: #121212;
        color: #ddd;
        
        --toast-bg: #fff;
        --toast-text: #111;
    }
    
    body.dark-mode .task-tab, body.dark-mode .sub-task-tab { background-color: #2a2a2a; color: #aaa; border-color: transparent; }
    body.dark-mode .task-tab:hover, body.dark-mode .sub-task-tab:hover { background-color: #333; }
    body.dark-mode .task-tab.active { background-color: #222; border-color: #444; border-bottom-color: #222; color: #fff; }
    body.dark-mode .sub-task-tab.active { background-color: #333; color: #fff; border: 1px solid #444; border-bottom: 2px solid var(--smp-primary); }
    
    body.dark-mode .sidenav, body.dark-mode .page-header, body.dark-mode .page-footer, body.dark-mode .auction-container, body.dark-mode .dash-card, body.dark-mode .mail-list { background-color: #222; border-color: #444; }
    body.dark-mode .sidenav-header, body.dark-mode .right-menu-header { background-color: #2a2a2a; border-color: #444; }
    body.dark-mode .app-item:hover { background-color: #333; border-color: #555; }
    body.dark-mode .app-label { color: #ddd; }
    body.dark-mode .app-desc { color: #999; }
    body.dark-mode .app-icon { color: #ccc; }
    body.dark-mode th { background-color: #2a2a2a; color: #fff; }
    body.dark-mode td, body.dark-mode td:first-child { background-color: #222; color: #ddd; }
    body.dark-mode tr:hover td { background-color: #2a2a2a; }
    body.dark-mode .form-control { background-color: #333; color: #fff; border-color: #555; }
    body.dark-mode .page-btn { background-color: #333; border-color: #555; color: #fff; }
    body.dark-mode .page-btn:hover:not(:disabled) { background-color: #444; }
    body.dark-mode .tab-context-menu { background-color: #222; border-color: #444; }
    body.dark-mode .ctx-menu-item { color: #ddd; }
    body.dark-mode .ctx-menu-item:hover { background-color: #333; }
    body.dark-mode .ctx-separator { background-color: #444; }
    body.dark-mode .ctx-close-btn { background-color: #222; }
    body.dark-mode .ctx-close-btn:hover { background-color: #300; }
    body.dark-mode .dash-stat-label { color: #aaa; }
    body.dark-mode .theme-toggle-btn { color: #fff; }
    body.dark-mode .mail-folder-item:hover { background-color: #333; }
    body.dark-mode .mail-folder-item.active { background-color: #333; color: #fff; border-left-color: var(--smp-primary); }

    body {
        font-family: var(--smp-font);
        background-color: #f9f9f9;
        margin: 0;
        padding: 0; 
        color: #111;
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
        transition: background-color 0.3s, color 0.3s;
    }

    /* --- TOAST NOTIFICATIONS --- */
    .toast-container {
        position: fixed; top: 80px; right: 20px; z-index: 4000;
        display: flex; flex-direction: column; gap: 10px; pointer-events: none;
    }
    .toast {
        background-color: var(--toast-bg); color: var(--toast-text); padding: 12px 16px; border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; font-size: 13px;
        min-width: 250px; pointer-events: auto; animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        border-left: 4px solid transparent;
        cursor: pointer;
    }
    .toast.success { border-left-color: var(--toast-success); }
    .toast.error { border-left-color: var(--toast-error); }
    .toast.info { border-left-color: var(--toast-info); }
    .toast.fade-out { opacity: 0; transform: translateX(20px); transition: all 0.3s ease-out; }
    @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

    /* --- NOTIFICATIONS CENTER --- */
    .notifications-btn {
        position: relative;
    }
    .notifications-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background-color: #d32f2f;
        color: white;
        border-radius: 50%;
        min-width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        padding: 0 4px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }
    .notifications-center {
        position: fixed;
        top: 60px;
        right: 20px;
        width: 420px;
        max-height: calc(100vh - 80px);
        background-color: var(--smp-header-bg);
        border: 1px solid var(--smp-border);
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        z-index: 4500;
        display: none;
        flex-direction: column;
        overflow: hidden;
        animation: slideInRight 0.3s ease-out;
    }
    .notifications-center.visible {
        display: flex;
    }
    @keyframes slideInRight {
        from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }
    .notifications-center-content {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    .notifications-center-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--smp-border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: var(--smp-header-bg);
        flex-shrink: 0;
    }
    .notifications-center-header h2 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
    }
    .notifications-action-btn {
        background: none;
        border: 1px solid var(--smp-border);
        border-radius: 4px;
        padding: 4px 8px;
        font-size: 11px;
        color: var(--smp-primary);
        cursor: pointer;
        transition: all 0.2s;
    }
    .notifications-action-btn:hover {
        background-color: var(--smp-primary);
        color: white;
    }
    .notifications-center-body {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .notifications-tabs {
        display: flex;
        gap: 4px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--smp-border);
        overflow-x: auto;
        flex-shrink: 0;
    }
    .notification-tab {
        background: none;
        border: 1px solid transparent;
        border-radius: 4px;
        padding: 6px 12px;
        font-size: 12px;
        color: var(--smp-gray);
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s;
    }
    .notification-tab:hover {
        background-color: var(--smp-hover);
        color: #111;
    }
    body.dark-mode .notification-tab:hover {
        background-color: #333;
        color: #ddd;
    }
    .notification-tab.active {
        background-color: var(--smp-primary);
        color: white;
        border-color: var(--smp-primary);
    }
    .notifications-list {
        flex: 1;
        overflow-y: auto;
        padding: 8px;
    }
    .notification-item {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 6px;
        border-left: 4px solid transparent;
        background-color: var(--smp-hover);
        cursor: pointer;
        transition: all 0.2s;
        position: relative;
    }
    .notification-item:hover {
        background-color: #e0e0e0;
    }
    body.dark-mode .notification-item:hover {
        background-color: #333;
    }
    .notification-item.unread {
        background-color: #e3f2fd;
        border-left-color: var(--smp-primary);
    }
    body.dark-mode .notification-item.unread {
        background-color: #1a237e;
    }
    .notification-item.success {
        border-left-color: var(--toast-success);
    }
    .notification-item.error {
        border-left-color: var(--toast-error);
    }
    .notification-item.info {
        border-left-color: var(--toast-info);
    }
    .notification-item-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 4px;
    }
    .notification-item-title {
        font-size: 13px;
        font-weight: 600;
        color: #111;
        flex: 1;
    }
    body.dark-mode .notification-item-title {
        color: #ddd;
    }
    .notification-item-time {
        font-size: 11px;
        color: var(--smp-gray);
        white-space: nowrap;
    }
    .notification-item-message {
        font-size: 12px;
        color: var(--smp-gray);
        line-height: 1.4;
    }
    .notification-item-actions {
        display: flex;
        gap: 4px;
        margin-top: 8px;
        opacity: 0;
        transition: opacity 0.2s;
    }
    .notification-item:hover .notification-item-actions {
        opacity: 1;
    }
    .notification-action-btn-small {
        background: none;
        border: 1px solid var(--smp-border);
        border-radius: 3px;
        padding: 2px 6px;
        font-size: 10px;
        color: var(--smp-gray);
        cursor: pointer;
        transition: all 0.2s;
    }
    .notification-action-btn-small:hover {
        background-color: var(--smp-hover);
        color: var(--smp-primary);
    }
    .notifications-empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        color: var(--smp-gray);
        text-align: center;
    }
    .notifications-empty.hidden {
        display: none;
    }
    @media (max-width: 768px) {
        .notifications-center {
            right: 10px;
            left: 10px;
            width: auto;
            max-height: calc(100vh - 70px);
        }
    }

    /* --- PAGE HEADER --- */
    .page-header {
        background-color: #fff;
        border-bottom: 1px solid var(--smp-border);
        padding: 0 15px; 
        height: 60px; 
        display: flex;
        justify-content: space-between; 
        align-items: center;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        z-index: 50; 
        flex-shrink: 0; 
    }

    /* --- TASK BAR (TOP) --- */
    #smp-task-bar {
        flex: 1; 
        margin: 0 15px;
        height: 100%;
        display: flex;
        align-items: flex-end;
        overflow-x: auto; 
        overflow-y: hidden;
        gap: 6px; 
        padding-bottom: 0; 
        scrollbar-width: thin;
        scrollbar-color: #ccc transparent;
    }
    #smp-task-bar::-webkit-scrollbar { height: 4px; }
    #smp-task-bar::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 4px; }

    /* --- TASK TABS (TOP) --- */
    .task-tab {
        display: flex; align-items: center; gap: 8px; background-color: #f5f5f5;
        border: 1px solid transparent; border-bottom: none; padding: 8px 12px;
        border-radius: 6px 6px 0 0; font-size: 13px; cursor: pointer; white-space: nowrap;
        user-select: none; transition: background-color 0.2s, transform 0.2s; color: #555; height: 45px; 
        margin-bottom: -1px; position: relative; min-width: 120px; max-width: 180px;
    }
    .task-tab.dragging { opacity: 0.5; transform: scale(0.95); border: 2px dashed var(--smp-primary); }
    @media (max-width: 768px) { 
        .task-tab { min-width: auto; padding: 8px 12px; max-width: none; } 
        .task-tab-label, .sub-task-label { display: none; }
        .sub-task-tab {
            padding: 0;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            justify-content: center;
        }
    }
    .task-tab:hover { background-color: #e9e9e9; }
    .task-tab.active { background-color: #fff; border: 1px solid var(--smp-border); border-bottom: 2px solid transparent; color: #000; font-weight: 600; z-index: 2; box-shadow: 0 -2px 3px rgba(0,0,0,0.05); }
    body.dark-mode .task-tab.active { border-bottom-color: #121212; }
    .task-tab.active::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background-color: var(--smp-primary); border-radius: 6px 6px 0 0; }
    
    .task-tab-icon { display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 4px; transition: background 0.2s; }
    .task-tab-icon:hover { background-color: rgba(0,0,0,0.1); }
    .task-tab-icon svg { width: 18px; height: 18px; margin: 0 !important; }
    .task-tab-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
    
    /* --- ERROR BADGE ON TASK TABS --- */
    .task-tab-error-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        background-color: #d32f2f;
        color: white;
        border-radius: 50%;
        min-width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        padding: 0 4px;
        z-index: 10;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }
    .task-tab-error-badge.hidden { display: none; }
    body.dark-mode .task-tab-error-badge { background-color: #f44336; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }

    /* --- SUB-TASK BAR (BOTTOM) --- */
    .page-footer {
        background-color: #fff;
        border-top: 1px solid var(--smp-border);
        padding: 0 20px; 
        height: 45px; 
        display: flex;
        justify-content: space-between; 
        align-items: center;
        box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
        z-index: 50; 
        flex-shrink: 0; 
        font-size: 12px;
        color: #666;
    }

    #sub-task-list {
        display: flex;
        height: 100%;
        justify-content: center;
        align-items: center;
        gap: 10px;
        overflow-x: auto;
        flex: 1;
        margin-right: 20px;
        scrollbar-width: none; 
    }
    
    .sub-task-tab {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 4px 12px;
        border-radius: 15px;
        background-color: #f0f0f0;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s;
        border: 1px solid transparent;
        height: 30px;
        display: none; /* Default hidden, toggled by JS */
    }
    
    .sub-task-tab:hover { background-color: #e0e0e0; }
    
    .sub-task-tab.active {
        background-color: #fff;
        border: 1px solid var(--smp-border);
        color: var(--smp-primary);
        font-weight: 600;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .sub-task-icon svg { width: 14px; height: 14px; margin-bottom: -2px; }

    /* --- Sub-App Close Button (V.1.036) --- */
    .sub-app-close-btn {
        background: none;
        border: 1px solid transparent;
        color: var(--smp-gray);
        font-size: 28px;
        line-height: 1;
        padding: 0 8px;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
    }
    .sub-app-close-btn:hover { background-color: var(--smp-hover); color: #d32f2f; }
    body.dark-mode .sub-app-close-btn:hover { background-color: #333; }

    /* --- TAB CONTEXT MENU --- */
    .tab-context-menu { position: fixed; background: white; border: 1px solid #ccc; box-shadow: 0 4px 12px rgba(0,0,0,0.15); border-radius: 6px; z-index: 3000; width: 200px; display: none; flex-direction: column; overflow: hidden; padding: 5px 0; }
    .tab-context-menu.visible { display: flex; animation: fadeIn 0.1s ease-out; }
    .ctx-menu-item { display: flex; align-items: center; padding: 10px 15px; cursor: pointer; font-size: 14px; color: #333; transition: background 0.2s; }
    .ctx-menu-item:hover { background-color: #f5f5f5; }
    .ctx-menu-item svg { width: 16px; height: 16px; margin-right: 12px; color: #666; }
    .ctx-separator { height: 1px; background-color: #eee; margin: 5px 0; }
    .ctx-menu-item.danger { color: #d32f2f; font-weight: 500; }
    .ctx-menu-item.danger svg { color: #d32f2f; }
    .ctx-menu-item.danger:hover { background-color: #fff0f0; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

    /* --- MAIN CONTENT & VIEWS --- */
    .main-content { padding: 0; flex: 1; overflow: hidden; display: flex; flex-direction: column; position: relative; }
    .app-view { display: none; flex-direction: column; height: 100%; overflow: hidden; /* padding moved to sub-views */ animation: fadeIn 0.2s ease-out; }
    .app-view.active-view { display: flex; }

    /* Sub-app views within a main app view */
    .sub-app-view {
        display: none;
        flex-direction: column;
        flex: 1;
        min-height: 0; /* Allows flex child to shrink below min-content */
        overflow: hidden;
        padding: 30px;
    }
    .sub-app-view.active-sub-view { display: flex; }

    /* Dashboard Styles */
    .dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; overflow-y: auto; padding-bottom: 20px; }
    .dash-card { background: white; border: 1px solid var(--smp-border); border-radius: 8px; padding: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: flex; flex-direction: column; }
    .dash-card h3 { margin-top: 0; font-size: 16px; margin-bottom: 15px; }
    .dash-stat { font-size: 28px; font-weight: bold; color: var(--smp-primary); margin-bottom: 5px; }
    .dash-stat-label { font-size: 13px; color: #777; }
    .chart-bars { display: flex; align-items: flex-end; height: 100px; gap: 10px; padding-top: 10px; }
    .bar-col { flex: 1; background-color: #e0e0e0; border-radius: 4px 4px 0 0; position: relative; transition: height 0.5s; }
    .bar-col:hover { background-color: var(--smp-primary); }
    .bar-col::after { content: attr(data-val); position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; opacity: 0; transition: opacity 0.2s; }
    .bar-col:hover::after { opacity: 1; color: var(--smp-primary); font-weight: bold; }
    .chart-pie-wrapper { display: flex; justify-content: center; margin: 10px 0; }
    .chart-pie { width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--smp-primary) 0% 65%, #2196F3 65% 85%, #FFC107 85% 100%); position: relative; }
    .chart-pie::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80px; height: 80px; background-color: var(--smp-header-bg); border-radius: 50%; }
    .chart-legend { display: flex; justify-content: center; gap: 15px; font-size: 11px; margin-top: 10px; }
    .legend-item { display: flex; align-items: center; gap: 5px; }
    .dot { width: 8px; height: 8px; border-radius: 50%; }
    .trend-svg { width: 100%; height: 80px; stroke: var(--smp-primary); stroke-width: 2; fill: none; }

    /* Mail Styles */
    .mail-list { background: white; border: 1px solid var(--smp-border); border-radius: 8px; overflow-y: auto; flex: 1; }
    .mail-item { padding: 15px; border-bottom: 1px solid var(--smp-border); display: flex; justify-content: space-between; cursor: pointer; }
    .mail-item:hover { background-color: var(--smp-hover); }
    .mail-subject { font-weight: 600; }

    /* --- PAGE FOOTER --- */
    .footer-info { font-size: 13px; color: var(--smp-gray); font-weight: 500; }
    .pagination-controls { display: flex; gap: 10px; }
    .page-btn { background-color: #fff; border: 1px solid #ccc; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; color: #333; transition: all 0.2s; }
    .page-btn:hover:not(:disabled) { background-color: #f0f0f0; border-color: #999; }
    .page-btn:disabled { opacity: 0.5; cursor: not-allowed; background-color: #eee; }

    /* --- Local App Footer for Pagination --- */
    .app-local-footer {
        flex-shrink: 0;
        padding-top: 20px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 20px;
    }

    /* --- BULK ACTION BAR --- */
    .bulk-bar { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); background-color: #333; color: white; padding: 12px 24px; border-radius: 50px; display: flex; align-items: center; gap: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 2000; transition: bottom 0.3s; min-width: 300px; justify-content: space-between; }
    .bulk-bar.visible { bottom: 60px; }
    .bulk-count { font-weight: bold; font-size: 14px; }
    .bulk-btn { background-color: var(--smp-primary); color: white; border: none; padding: 8px 16px; border-radius: 20px; font-weight: bold; cursor: pointer; font-size: 13px; transition: background 0.2s; }
    .bulk-btn:hover { background-color: var(--smp-primary-dark); }
    .bulk-close { background: none; border: none; color: #999; cursor: pointer; font-size: 18px; padding: 0; line-height: 1; margin-left: 10px; }
    .bulk-close:hover { color: #fff; }

    /* --- SIDENAVS --- */
    .sidenav { position: fixed; z-index: 1000; background-color: #fff; box-shadow: 0 0 15px rgba(0,0,0,0.15); transition: all 0.3s ease-in-out; display: flex; flex-direction: column; }
    #mySidenav { height: 100%; width: 320px; top: 0; left: -320px; }
    #mySidenav.open { left: 0; }
    #smp-apps-menu { top: 10%; right: -320px; width: 300px; height: 80%; border-radius: 8px 0 0 8px; z-index: 1001; }
    #smp-apps-menu.open { right: 0; }
    .sidenav-header, .right-menu-header { padding: 15px 20px; border-bottom: 1px solid var(--smp-border); font-weight: bold; display: flex; justify-content: space-between; align-items: center; background-color: #fcfcfc; }
    .sidenav-title { font-size: 20px; }
    .closebtn { font-size: 28px; cursor: pointer; color: #111; line-height: 1; background: none; border: none; padding: 0; }
    .closebtn:hover { color: var(--smp-primary); }
    .sidenav-content { flex: 1; overflow-y: auto; padding: 20px; }
    .theme-toggle-btn { background: none; border: 1px solid var(--smp-border); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-left: 10px; color: #555; transition: all 0.2s; }
    .theme-toggle-btn:hover { background-color: rgba(0,0,0,0.05); }
    .theme-toggle-btn svg { width: 14px; height: 14px; }
    .app-grid { padding: 20px; display: grid; grid-template-columns: 1fr; gap: 12px; overflow-y: auto; }
    .app-item { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; padding: 12px 16px; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; border: 1px solid transparent; }
    .app-item:hover { background-color: #f0f0f0; border-color: #e0e0e0; }
    .app-icon { width: 24px; height: 24px; margin-bottom: 0; margin-right: 16px; color: #444; flex-shrink: 0; }
    .app-text-container { display: flex; flex-direction: column; }
    .app-label { font-size: 14px; color: #333; font-weight: 600; }
    .app-desc { font-size: 12px; color: #777; margin-top: 2px; }
    .screen-overlay { position: fixed; display: none; width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.4); z-index: 999; cursor: pointer; }
    
    /* --- SIDEBAR CONTENT VIEWS --- */
    .sidebar-view { display: none; flex-direction: column; gap: 15px; animation: fadeIn 0.2s; }
    .sidebar-view.active-sidebar { display: flex; }
    .mail-folder-item { display: flex; align-items: center; padding: 10px; border-radius: 4px; cursor: pointer; font-size: 13px; color: #333; border-left: 3px solid transparent; }
    .mail-folder-item:hover { background-color: #f5f5f5; }
    .mail-folder-item.active { background-color: #e8f5e9; color: var(--smp-primary); border-left-color: var(--smp-primary); font-weight: 600; }
    .mail-folder-item svg { width: 16px; height: 16px; margin-right: 10px; }

    .form-grid { display: flex; flex-direction: column; gap: 15px; }
    .form-group { display: flex; flex-direction: column; width: 100%; }
    .form-group label { font-size: 12px; font-weight: 600; margin-bottom: 5px; color: #444; }
    .form-control { display: block; width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; font-size: 13px; }
    .form-control:focus { border-color: #000; outline: none; }
    fieldset { border: 1px solid var(--smp-border); border-radius: 4px; padding: 10px; margin-top: 10px; width: 100%; }
    legend { font-size: 12px; font-weight: bold; padding: 0 5px; }
    .radio-group, .checkbox-group { display: flex; align-items: center; gap: 5px; font-size: 13px; margin-bottom: 5px; }
    .action-bar { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--smp-border); display: flex; flex-direction: column; gap: 10px; }
    .btn { padding: 10px 20px; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 14px; border: none; width: 100%; }
    .btn-submit { background-color: var(--smp-primary); color: white; }
    .btn-reset { background-color: #f1f1f1; color: #111; border: 1px solid #ccc; }
    .header-btn { background-color: transparent; border: 1px solid transparent; padding: 8px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; color: #444; }
    .header-btn:hover { background-color: #f0f0f0; color: #000; border-color: #e0e0e0; }
    .header-btn svg { width: 24px; height: 24px; }
    .table-container { 
        background: white; 
        border: 1px solid var(--smp-border); 
        border-radius: 8px; 
        box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
        overflow-x: auto; 
        flex: 1; 
        overflow-y: auto; 
        min-height: 0; /* Allows flex child to shrink below min-content */
    }
    .pin-btn { display: none; } /* Hidden by default, shown on desktop */
    @media (min-width: 769px) {
        .pin-btn { display: flex; }
    }

    table { width: 100%; border-collapse: collapse; min-width: 900px; }
    th { text-align: left; padding: 12px 16px; border-bottom: 2px solid var(--smp-border); background-color: var(--smp-header-bg); color: #111; font-size: 13px; font-weight: 700; cursor: pointer; user-select: none; white-space: nowrap; position: sticky; top: 0; z-index: 10; box-shadow: inset 0 -2px 0 var(--smp-border); }
    th:first-child { left: 0; z-index: 30; box-shadow: inset -1px 0 0 var(--smp-border), inset 0 -2px 0 var(--smp-border); }
    td:first-child { position: sticky; left: 0; z-index: 5; background-color: white; border-right: 1px solid var(--smp-border); background-clip: padding-box; box-shadow: 2px 0 5px rgba(0,0,0,0.05); }
    td { padding: 14px 16px; border-bottom: 1px solid var(--smp-border); color: #111; font-size: 14px; vertical-align: middle; background-color: #fff; }
    tr:last-child td { border-bottom: none; }
    tr:hover td { background-color: var(--smp-hover); }
    th:hover { background-color: #f0f0f0; }
    th:not(:first-child)::after { content: ' \2195'; font-size: 10px; color: #999; margin-left: 5px; }
    th.sorted-asc::after { content: ' \2191'; color: #111; }
    th.sorted-desc::after { content: ' \2193'; color: #111; }
    .col-domain-wrapper { display: flex; align-items: center; }
    .domain-text { color: var(--smp-primary); font-weight: 600; cursor: pointer; }
    .domain-text:hover { text-decoration: underline; }
    .domain-check { margin-right: 10px; cursor: pointer; width: 16px; height: 16px; flex-shrink: 0; }
    .col-price, .col-val { font-family: monospace; font-size: 14px; font-weight: 500; }
    .col-time { font-weight: 500; }
    .time-urgent { color: #b91c1c; font-weight: 700; }
    .bid-btn { background-color: var(--smp-primary); color: white; border: none; padding: 8px 16px; border-radius: 4px; font-weight: bold; cursor: pointer; transition: background 0.2s; font-size: 13px; }
    .bid-btn:hover { background-color: var(--smp-primary-dark); }
    .bid-input { padding: 7px; border: 1px solid #ccc; border-radius: 4px; width: 70px; margin-right: 8px; font-size: 13px; }
    .est-val { color: var(--smp-gray); font-size: 12px; text-transform: uppercase; margin-right: 4px; }
    .status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; text-transform: capitalize; }
    .status-badge.status-active { background-color: #e8f5e9; color: #2e7d32; }
    .status-badge.status-on-leave { background-color: #fff3e0; color: #e65100; }
    .status-badge.status-terminated { background-color: #ffebee; color: #c62828; }
    .btn-small { padding: 4px 8px; font-size: 11px; }

    /* --- PINNED SIDEBAR STYLES (V.1.022) --- */
    @media (min-width: 769px) {
        body.sidenav-pinned #mySidenav {
            left: 0;
            box-shadow: none;
            border-right: 1px solid var(--smp-border);
        }
        body.sidenav-pinned .page-header,
        body.sidenav-pinned .main-content,
        body.sidenav-pinned .page-footer {
            margin-left: 320px;
            transition: margin-left 0.3s ease-in-out;
        }
        body.sidenav-pinned .screen-overlay { display: none !important; }
        body.sidenav-pinned #pinBtn { background-color: #e8f5e9; color: var(--smp-primary); }
        body.dark-mode.sidenav-pinned #pinBtn { background-color: rgba(0, 138, 50, 0.2); }
    }

    @media (max-width: 480px) { .sidenav { width: 85%; } .page-header { padding: 0 10px; } .main-content { padding: 10px; } .bulk-bar { bottom: -120px; width: 90%; min-width: auto; } .bulk-bar.visible { bottom: 60px; } #smp-apps-menu { width: 85%; } }

    /* --- KEYBOARD SHORTCUTS MODAL --- */
    .shortcuts-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 5000;
        animation: fadeIn 0.2s ease-out;
    }
    .shortcuts-modal.visible {
        display: flex;
    }
    .shortcuts-modal-content {
        background-color: var(--smp-header-bg);
        border: 1px solid var(--smp-border);
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        width: 90%;
        max-width: 700px;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .shortcuts-modal-header {
        padding: 20px 24px;
        border-bottom: 1px solid var(--smp-border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: var(--smp-header-bg);
    }
    .shortcuts-modal-header h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
    }
    .shortcuts-close-btn {
        background: none;
        border: none;
        font-size: 28px;
        line-height: 1;
        color: var(--smp-gray);
        cursor: pointer;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: all 0.2s;
    }
    .shortcuts-close-btn:hover {
        background-color: var(--smp-hover);
        color: #d32f2f;
    }
    .shortcuts-modal-body {
        padding: 20px 24px;
        overflow-y: auto;
        flex: 1;
    }
    .shortcuts-search {
        margin-bottom: 20px;
    }
    .shortcuts-search-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--smp-border);
        border-radius: 4px;
        font-size: 14px;
        font-family: inherit;
    }
    .shortcuts-search-input:focus {
        outline: none;
        border-color: var(--smp-primary);
    }
    .shortcuts-list {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .shortcuts-category {
        margin-bottom: 8px;
    }
    .shortcuts-category-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--smp-primary);
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .shortcut-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background-color: var(--smp-hover);
        border-radius: 6px;
        transition: background-color 0.2s;
    }
    .shortcut-item.hidden {
        display: none;
    }
    .shortcut-item:hover {
        background-color: #e0e0e0;
    }
    body.dark-mode .shortcut-item:hover {
        background-color: #333;
    }
    .shortcut-item-left {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
    }
    .shortcut-item-label {
        font-size: 14px;
        font-weight: 500;
        color: #111;
    }
    body.dark-mode .shortcut-item-label {
        color: #ddd;
    }
    .shortcut-item-desc {
        font-size: 12px;
        color: var(--smp-gray);
    }
    .shortcut-item-right {
        display: flex;
        gap: 6px;
        align-items: center;
    }
    .shortcut-key {
        background-color: #fff;
        border: 1px solid var(--smp-border);
        border-radius: 4px;
        padding: 6px 10px;
        font-size: 12px;
        font-weight: 600;
        font-family: monospace;
        color: #111;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        min-width: 24px;
        text-align: center;
    }
    body.dark-mode .shortcut-key {
        background-color: #2a2a2a;
        color: #ddd;
        border-color: #444;
    }
    .shortcut-item-edit {
        background: none;
        border: 1px solid var(--smp-border);
        border-radius: 4px;
        padding: 4px 8px;
        font-size: 11px;
        color: var(--smp-primary);
        cursor: pointer;
        transition: all 0.2s;
    }
    .shortcut-item-edit:hover {
        background-color: var(--smp-primary);
        color: white;
    }
    .shortcuts-footer {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid var(--smp-border);
        display: flex;
        gap: 10px;
        justify-content: flex-end;
    }
    .shortcut-item.editing .shortcut-key {
        background-color: #fff3cd;
        border-color: var(--smp-primary);
    }
    body.dark-mode .shortcut-item.editing .shortcut-key {
        background-color: #3a2a00;
    }

    /* --- UTILITY CLASSES --- */
    .d-none {
        display: none !important;
    }

    /* --- LOGGED IN CONTAINER (flex layout for sticky footer) --- */
    #loggedInContainer {
        display: flex;
        flex-direction: column;
        flex: 1;
        height: 100vh;
        min-height: 0; /* Allows flex child to shrink below min-content */
        overflow: hidden;
    }

    /* --- LOGIN FORM STYLES (matching Beta) --- */
    .login-form-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(249, 249, 249, 0.95);
        z-index: 10000;
    }
    body.dark-mode .login-form-container {
        background-color: rgba(18, 18, 18, 0.95);
    }
    .login-form-container.d-none {
        display: none;
    }
    .login-form-card {
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        padding: 40px;
        width: 100%;
        max-width: 500px;
        text-align: center;
    }
    body.dark-mode .login-form-card {
        background: #222;
        border: 1px solid #444;
    }
    .login-form-header h1 {
        margin: 0 0 20px 0;
        color: var(--smp-primary);
        font-size: 28px;
        font-weight: 600;
    }
    .login-status {
        margin: 15px 0;
        font-size: 14px;
        min-height: 20px;
    }
    .login-status.text-muted {
        color: var(--smp-gray);
    }
    .login-status.text-success {
        color: #008a32;
    }
    .login-status.text-danger {
        color: #d32f2f;
    }
    #status.text-muted {
        color: var(--smp-gray);
    }
    #status.text-success {
        color: #008a32;
    }
    #status.text-danger {
        color: #d32f2f;
    }