/* ==========================================================================
   DASHBOARD SPECIFIC STYLES (Fully Independent)
   ========================================================================== */

/* Dashboard Layout */
.ultra-dashboard {
    overflow-x: hidden; 
    width: 100%;
}

/* --- Base Structural Cards (Restored) --- */
.glass-card-wrapper {
    padding: 12px;
    min-width: 0; 
}
.pure-card {
    background: var(--ink-900);
    border: 1px solid rgba(228, 220, 203, 0.08);
    border-radius: 6px; 
    height: 100%;
    overflow: hidden;
    min-width: 0; 
    transition: all 0.3s ease;
}
.pure-card:hover { border-color: var(--accent); background: var(--ink-850); }

/* Card Modifiers */
.pure-card.stat-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.pure-card.chart-card {
    padding: 24px;
    display: block; 
}

/* Stat Card Inner Layout */
.stat-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.stat-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    margin-right: 8px;
    word-break: break-word;
}

/* Typography inside Stat Cards */
.pure-stat-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--mist-300);
    margin-bottom: 8px;
}

.pure-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--mist-100);
    line-height: 1;
    margin: 0;
    letter-spacing: -1px;
}
.pure-stat-value.text-red { 
    color: #FF3B30; 
}

/* Icons inside Stat Cards */
.pure-icon-wrapper {
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pure-icon-wrapper.orange-icon { background: var(--accent-soft); }
.pure-icon-wrapper.orange-icon md-icon { color: var(--accent); }

.pure-icon-wrapper.red-icon { background: rgba(255, 59, 48, 0.1); }
.pure-icon-wrapper.red-icon md-icon { color: #FF3B30; }

.pure-icon-wrapper md-icon {
    font-size: 26px;
    height: 26px;
    width: 26px;
    text-shadow: none !important;
}

/* --- Trend Badges (Restored) --- */
.pure-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 4px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pure-trend md-icon {
    font-size: 14px; height: 14px; width: 14px; min-height: 14px; min-width: 14px; margin-right: 6px;
}
.trend-green { background: rgba(52, 199, 89, 0.1); color: #34C759; border: 1px solid rgba(52, 199, 89, 0.2); }
.trend-green md-icon { color: #34C759; }
.trend-red { background: rgba(255, 59, 48, 0.1); color: #FF3B30; border: 1px solid rgba(255, 59, 48, 0.2); }
.trend-red md-icon { color: #FF3B30; }
.trend-orange { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(199, 166, 107, 0.24); }
.trend-orange md-icon { color: var(--accent); }


/* Special Out of Stock card faint border */
.border-red { border-color: #4a1310; }
.border-red:hover { border-color: #FF3B30; }

/* Chart Containers */
.chart-title { 
    color: var(--mist-100); 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    margin-top: 0; 
    margin-bottom: 30px; 
    font-weight: 600; 
    text-align: center;
}
.chart-container { 
    position: relative; 
    height: 300px; 
    width: 100%; 
    min-width: 0; 
    flex-grow: 1; 
}
.margin-top-large { margin-top: 16px; }
canvas { display: block; max-width: 100%; }

/* System Info Bottom Card */
.system-info-card { 
    background: var(--ink-900); 
    border: 1px solid rgba(228, 220, 203, 0.08); 
    border-radius: 4px; 
    padding: 30px 24px; 
}
.info-block { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    padding: 10px; 
    border-right: 1px solid rgba(228, 220, 203, 0.08); 
    overflow: hidden; 
}
.info-block:last-child { border-right: none; }
.info-label { 
    color: var(--mist-300); 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    font-weight: 600; 
    letter-spacing: 1.5px; 
    margin-bottom: 12px; 
}
.info-data { 
    font-size: 1.8rem; 
    font-weight: 700; 
    color: var(--accent); 
}


/* ==========================================================================
   FORCE MOBILE RESPONSIVENESS VIA PURE CSS
   ========================================================================== */
@media (max-width: 959px) {
    /* Force top cards to stack completely */
    .glass-card-wrapper {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Force system info blocks to wrap into a 2x3 grid on tablet */
    .system-info-card {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }
    .info-block {
        flex: 1 1 50% !important;
        max-width: 50% !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(228, 220, 203, 0.08) !important;
        padding: 20px 10px !important;
    }
    .info-block:nth-child(odd) {
        border-right: 1px solid rgba(228, 220, 203, 0.08) !important;
    }
    .info-block:last-child, .info-block:nth-last-child(2) {
        border-bottom: none !important;
    }
}

@media (max-width: 599px) {
    /* On tiny mobile phones, force info blocks to stack completely */
    .info-block {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        border-right: none !important;
    }
    .info-block:nth-child(odd) {
        border-right: none !important;
    }
    .info-block:nth-last-child(2) {
        border-bottom: 1px solid rgba(228, 220, 203, 0.08) !important;
    }
}
