/* ============================================================================
   REDESIGN DASHBOARD - Full Width Layout (Desktop Only)
   ============================================================================
   
   Autor: AI Assistant
   Data: 2026-02-18
   Branch: main
   
   SCOP: Eliminare spații laterale pe desktop, layout full-width
   METODĂ: CSS overrides pentru desktop (min-width: 1024px)
   
   MODIFICĂRI:
   - Sidebar: 280px → 220px
   - Container: max-width removed, full viewport
   - Main-content: padding redus
   - Dashboard cards: full width
   
   REVERT: Șterge acest fișier și referința din index.html
   ============================================================================ */

/* ============================================================================
   DESKTOP ONLY - min-width: 1024px
   Nu afectează mobile/tablet
   ============================================================================ */
@media (min-width: 1024px) {
    
    /* ==========================================================================
       CONTAINER - FULL WIDTH
       ========================================================================== */
    .container.dashboard {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    /* Body - remove centering padding if any */
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* ==========================================================================
       SIDEBAR - MAI ÎNGUST (280px → 220px)
       ========================================================================== */
    .sidebar {
        width: 220px !important;
        min-width: 220px !important;
        padding: 20px 14px !important;
    }
    
    /* Sidebar Header - mai compact */
    .sidebar-header {
        margin-bottom: 24px !important;
        padding-bottom: 16px !important;
        text-align: center !important;
    }
    
    .sidebar-header img {
        width: 42px !important;
        margin-bottom: 8px !important;
    }
    
    .sidebar-header h2 {
        font-size: 18px !important;
        margin-bottom: 2px !important;
    }
    
    .sidebar-header p {
        font-size: 11px !important;
    }
    
    /* User Info - mai compact */
    .user-info {
        padding: 12px !important;
        margin-bottom: 16px !important;
    }
    
    .user-info .user-name {
        font-size: 13px !important;
    }
    
    .user-info .user-role {
        font-size: 10px !important;
    }
    
    .user-info .user-company {
        font-size: 10px !important;
    }
    
    /* User action buttons */
    .user-actions {
        margin-top: 8px !important;
        gap: 6px !important;
    }
    
    .user-action-btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
    /* Nav Items - mai compacte */
    .nav-item {
        padding: 10px 12px !important;
        font-size: 13px !important;
        margin-bottom: 3px !important;
    }
    
    /* Nav Group Headers */
    .nav-group-header {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
    
    .nav-group-items {
        margin-left: 12px !important;
    }
    
    .nav-group-items .nav-item {
        padding-left: 16px !important;
        font-size: 12px !important;
    }
    
    /* Logout button */
    .logout-btn {
        padding: 10px 14px !important;
        font-size: 13px !important;
        margin-top: 16px !important;
    }
    
    /* ==========================================================================
       MAIN CONTENT - FULL WIDTH, LESS PADDING
       ========================================================================== */
    .main-content {
        padding: 24px 28px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    /* Page Header - mai compact */
    .page-header {
        margin-bottom: 20px !important;
    }
    
    .page-header h1 {
        font-size: 26px !important;
    }
    
    .page-header p {
        font-size: 14px !important;
    }
    
    /* ==========================================================================
       DASHBOARD CARDS - STATS GRID
       ========================================================================== */
    .stats-grid {
        gap: 16px !important;
        margin-bottom: 24px !important;
    }
    
    .stat-card {
        padding: 20px !important;
    }
    
    .stat-value {
        font-size: 32px !important;
    }
    
    /* Dashboard specific cards grid */
    .dashboard-cards {
        gap: 16px !important;
    }
    
    .dashboard-card {
        padding: 20px !important;
    }
    
    /* ==========================================================================
       CARDS - GENERAL OPTIMIZATIONS
       ========================================================================== */
    .card {
        padding: 20px !important;
        margin-bottom: 20px !important;
        border-radius: 14px !important;
    }
    
    .card h3 {
        font-size: 18px !important;
        margin-bottom: 16px !important;
    }
    
    /* ==========================================================================
       DASHBOARD SECTIONS
       ========================================================================== */
    .dashboard-section {
        margin-bottom: 20px !important;
    }
    
    .dashboard-section h3 {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }
    
    /* Dashboard alerts */
    .dashboard-alerts {
        padding: 16px !important;
    }
    
    /* Dashboard actions row */
    .dashboard-actions {
        gap: 12px !important;
        padding: 16px !important;
    }
    
    /* ==========================================================================
       OVERVIEW SECTION - PEAK HOURS & ALERTS
       ========================================================================== */
    #overviewSection .card {
        padding: 20px !important;
    }
    
    /* Peak hours bars */
    #overviewSection .card div[style*="display: flex"][style*="margin-bottom"] {
        margin-bottom: 12px !important;
    }
    
    /* Alert boxes */
    #overviewSection > div > div[style*="background"] {
        padding: 16px !important;
        margin-bottom: 16px !important;
    }
}

/* ============================================================================
   EXTRA LARGE SCREENS - 1600px+
   Optimizări suplimentare pentru monitoare mari
   ============================================================================ */
@media (min-width: 1600px) {
    .main-content {
        padding: 28px 36px !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .stat-card {
        padding: 24px !important;
    }
    
    .stat-value {
        font-size: 36px !important;
    }
}

/* ============================================================================
   ULTRA WIDE SCREENS - 1920px+
   ============================================================================ */
@media (min-width: 1920px) {
    .sidebar {
        width: 240px !important;
        min-width: 240px !important;
        padding: 24px 16px !important;
    }
    
    .main-content {
        padding: 32px 48px !important;
    }
    
    .page-header h1 {
        font-size: 28px !important;
    }
}

/* ============================================================================
   TRANSITIONS - SMOOTH RESIZE
   ============================================================================ */
.sidebar,
.main-content,
.container.dashboard {
    transition: all 0.2s ease !important;
}

/* ============================================================================
   PRINT - HIDE SIDEBAR
   ============================================================================ */
@media print {
    .sidebar {
        display: none !important;
    }
    
    .main-content {
        padding: 20px !important;
    }
    
    .container.dashboard {
        display: block !important;
    }
}

/* ============================================================================
   DASHBOARD NOU — stiluri pentru filtre, carduri, costuri
   Compatibil mobile-first, fără dependențe externe
   ============================================================================ */

/* ----- KEYFRAME spinner ----- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ----- HEADER + FILTRE ----- */
.dash-header {
    margin-bottom: 24px;
}

.dash-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.dash-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.dash-refresh-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}
.dash-refresh-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.dash-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.dash-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-filter-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-select {
    padding: 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #1f2937;
    background: white;
    cursor: pointer;
    min-width: 160px;
    outline: none;
    transition: border-color 0.2s;
}
.dash-select:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8,145,178,0.1);
}

.dash-input-date {
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #1f2937;
    background: white;
    outline: none;
    transition: border-color 0.2s;
}
.dash-input-date:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8,145,178,0.1);
}

.dash-period-badge {
    padding: 7px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 12px;
    color: #0369a1;
    font-weight: 500;
    white-space: nowrap;
}

/* ----- SECTION TITLES ----- */
.dash-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin: 20px 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-tarif-badge {
    font-size: 11px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: none;
    letter-spacing: 0;
}

/* Titlu secțiune cu buton de acțiune aliniat dreapta */
.dash-section-title-with-action {
    justify-content: space-between;
}

.dash-export-btn {
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.dash-export-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.dash-export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ----- CARDS GRID ----- */
.dash-cards {
    display: grid;
    gap: 14px;
    margin-bottom: 4px;
}

.dash-cards-4 {
    grid-template-columns: repeat(2, 1fr);
}
.dash-cards-3 {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .dash-cards-4 { grid-template-columns: repeat(4, 1fr); }
    .dash-cards-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ----- CARD BASE ----- */
.dash-card {
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    transition: transform 0.15s, box-shadow 0.15s;
    min-height: 100px;
    background: white;
    border-left: 4px solid transparent;
}
.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dash-card-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.dash-card-body {
    flex: 1;
    min-width: 0;
}

.dash-card-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-card-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
    color: #111827;
}

.dash-card-sub {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Cost styling */
.dash-cost-value {
    font-size: 22px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.dash-currency {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}
.dash-cost-total {
    color: #d97706 !important;
}

/* ----- CARD COLOR VARIANTS ----- */
.dash-card-blue   { border-left-color: #3b82f6; }
.dash-card-blue   .dash-card-value { color: #1d4ed8; }

.dash-card-teal   { border-left-color: #0891b2; }
.dash-card-teal   .dash-card-value { color: #0e7490; }

.dash-card-violet { border-left-color: #7c3aed; }
.dash-card-violet .dash-card-value { color: #6d28d9; }

.dash-card-green  { border-left-color: #10b981; }
.dash-card-green  .dash-card-value { color: #059669; }

.dash-card-slate  { border-left-color: #64748b; }
.dash-card-slate  .dash-card-value { color: #334155; }

.dash-card-orange { border-left-color: #f59e0b; background: #fffbeb; }
.dash-card-orange .dash-card-value { color: #d97706; }
.dash-card-orange .dash-card-label { color: #92400e; }

.dash-card-yellow { border-left-color: #fbbf24; }
.dash-card-yellow .dash-card-value { color: #d97706; }

.dash-card-red    { border-left-color: #ef4444; }
.dash-card-red    .dash-card-value { color: #dc2626; }

/* ----- TREND INDICATORS ----- */
.dash-trend-up     { color: #10b981 !important; font-weight: 600; }
.dash-trend-down   { color: #ef4444 !important; font-weight: 600; }
.dash-trend-neutral{ color: #6b7280 !important; }

/* ----- PEAK HOURS ----- */
.dash-peak-hours {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    margin-bottom: 4px;
}

.dash-peak-item {
    display: grid;
    grid-template-columns: 24px 100px 1fr 80px;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.dash-peak-rank {
    font-weight: 700;
    color: #9ca3af;
    text-align: center;
}

.dash-peak-time {
    color: #374151;
    font-weight: 500;
}

.dash-peak-bar-wrap {
    background: #f3f4f6;
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}

.dash-peak-bar {
    height: 100%;
    background: linear-gradient(90deg, #0891b2, #7c3aed);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.dash-peak-count {
    color: #6b7280;
    text-align: right;
    font-size: 12px;
}

/* ----- ALERTE ----- */
.dash-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.dash-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    flex-wrap: wrap;
}

.dash-alert-warn {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}
.dash-alert-info {
    background: #e0f2fe;
    color: #0369a1;
    border-left: 4px solid #0891b2;
}

/* ----- ACTION BUTTONS ----- */
.dash-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-bottom: 8px;
}

.dash-action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-action-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
.dash-action-primary {
    background: #0891b2;
    color: white;
}
.dash-action-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

/* ----- LINK BUTTON ----- */
.dash-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    opacity: 0.85;
}
.dash-link-btn:hover { opacity: 1; }

/* ----- MOBILE TWEAKS ----- */
@media (max-width: 480px) {
    .dash-card { padding: 14px 16px; }
    .dash-card-value { font-size: 22px; }
    .dash-card-icon { font-size: 22px; }
    .dash-filters-row { flex-direction: column; align-items: stretch; }
    .dash-select { min-width: unset; }
    .dash-peak-item { grid-template-columns: 20px 90px 1fr 60px; }
}
