/* ============================================
   PRODUCTIONPLANNERPRO - UNIVERSAL DARK THEME
   FINAL PRODUCTION VERSION - ALL ISSUES FIXED
   Version: 3.0 - January 2026
   ✅ Sidebar flexbox layout
   ✅ Logout at bottom
   ✅ NO red borders
   ✅ Clean professional design
   ============================================ */

:root {
    /* Primary Colors */
    --primary: #00f5d4;
    --secondary: #9b5de5;
    --accent: #fee440;
    
    /* Status Colors */
    --success: #06ffa5;
    --warning: #ffd60a;
    --danger: #ff006e;
    --info: #00b4d8;
    
    /* Dark Theme */
    --dark: #0a0e27;
    --slate: #1a1f3a;
    --card-bg: #242945;
    --border-color: rgba(0, 245, 212, 0.2);
    
    /* Layout */
    --sidebar-width: 280px;
    
    /* Typography */
    --font-primary: 'Outfit', 'Rajdhani', sans-serif;
    --font-mono: 'Space Mono', 'IBM Plex Mono', monospace;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--dark) 0%, var(--slate) 100%);
    color: #fff;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Grid Background Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 245, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 212, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   SIDEBAR - FIXED FLEXBOX LAYOUT
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #1a1f3a;
    border-right: 1px solid rgba(0, 245, 212, 0.15);
    z-index: 1000;
    /* FLEXBOX FOR BOTTOM LOGOUT */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 245, 212, 0.3);
    border-radius: 3px;
}

/* ============================================
   SIDEBAR HEADER - NO BORDERS
   ============================================ */

.sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(0, 245, 212, 0.15);
    flex-shrink: 0;
    background: transparent;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #00f5d4 0%, #fee440 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    border: none;
    outline: none;
    box-shadow: none;
}

.logo-subtitle {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    border: none;
    outline: none;
}

/* ============================================
   NAVIGATION MENU - SCROLLABLE
   ============================================ */

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-section {
    padding: 16px 0 8px 0;
}

.nav-section-title {
    padding: 8px 24px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.nav-item {
    padding: 11px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(0, 245, 212, 0.08);
    color: #00f5d4;
    border-left-color: #00f5d4;
    padding-left: 28px;
}

.nav-item.active {
    background: rgba(0, 245, 212, 0.12);
    color: #00f5d4;
    border-left-color: #00f5d4;
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

/* ============================================
   LOGOUT BUTTON - STICKY AT BOTTOM
   ============================================ */

.sidebar-footer {
    flex-shrink: 0;
    padding: 16px 20px 20px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(0, 245, 212, 0.15);
}

.logout-btn {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #ff006e 0%, #d90368 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 0, 110, 0.2);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #ff0080 0%, #e0037a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 110, 0.35);
}

.logout-btn .nav-icon {
    font-size: 18px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    position: relative;
    z-index: 1;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    background: rgba(36, 41, 69, 0.6);
    backdrop-filter: blur(10px);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.page-title {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.page-subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 24px;
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(36, 41, 69, 0.6);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 245, 212, 0.3);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    color: var(--success);
}

/* ============================================
   SECTION CARDS
   ============================================ */

.section-card {
    background: rgba(36, 41, 69, 0.4);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 245, 212, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(0, 245, 212, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #05d68a 100%);
    color: var(--dark);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #d90368 100%);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #fca311 100%);
    color: var(--dark);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    background: rgba(36, 41, 69, 0.4);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(0, 245, 212, 0.05);
}

.data-table tbody tr {
    transition: all 0.3s;
}

.data-table tbody tr:hover {
    background: rgba(0, 245, 212, 0.05);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: var(--font-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0, 245, 212, 0.3);
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 40px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    position: relative;
}

.modal-header {
    padding: 32px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
}

.modal-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-body {
    padding: 32px;
}

.modal-close {
    position: absolute;
    top: 32px;
    right: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(241, 91, 181, 0.2);
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(241, 91, 181, 0.4);
    transform: rotate(90deg);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: rgba(36, 41, 69, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    display: none;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast.active {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast.warning {
    border-color: var(--warning);
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 245, 212, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success {
    background: rgba(6, 255, 165, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-warning {
    background: rgba(255, 214, 10, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge-danger {
    background: rgba(255, 0, 110, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.badge-info {
    background: rgba(0, 180, 216, 0.2);
    color: var(--info);
    border: 1px solid var(--info);
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.3s;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 32px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }