/* ===== BATTERY PLATFORM — GLOBAL DESIGN SYSTEM ===== */

/* Google Fonts — Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bp-primary: #16A34A;
    --bp-primary-dark: #15803D;
    --bp-primary-darker: #166534;
    --bp-primary-light: #DCFCE7;
    --bp-accent: #4ADE80;
    --bp-surface: #FFFFFF;
    --bp-surface-alt: #F8FAFC;
    --bp-border: #E2E8F0;
    --bp-border-light: #F1F5F9;
    --bp-text-primary: #0F172A;
    --bp-text-secondary: #64748B;
    --bp-text-muted: #94A3B8;
    --bp-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --bp-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --bp-shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --bp-shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --bp-radius: 12px;
    --bp-radius-sm: 8px;
    --bp-radius-lg: 16px;
    --bp-radius-xl: 20px;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== APPBAR ===== */
.mud-appbar {
    background: #0F172A !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.06) !important;
}

/* ===== SIDEBAR DRAWER ===== */
.mud-drawer {
    background: #0F172A !important;
    border-right: 1px solid rgba(255,255,255,0.06) !important;
}

.mud-drawer-header {
    background: transparent !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

.mud-drawer-header .mud-typography {
    color: rgba(255,255,255,0.95) !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
}

/* Sidebar Nav Links */
.mud-nav-link {
    color: rgba(255,255,255,0.65) !important;
    border-radius: 10px !important;
    margin: 2px 8px !important;
    padding: 10px 12px !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
}

.mud-nav-link:hover {
    background: rgba(255,255,255,0.06) !important;
    color: rgba(255,255,255,0.9) !important;
}

.mud-nav-link.active {
    background: rgba(22,163,74,0.2) !important;
    color: #4ADE80 !important;
    font-weight: 600 !important;
    border-left: 3px solid #4ADE80 !important;
}

.mud-nav-link .mud-nav-link-icon {
    color: inherit !important;
}

/* ===== KPI CARDS ===== */
.bp-kpi-card {
    background: #FFFFFF;
    border-radius: var(--bp-radius);
    border: 1px solid var(--bp-border);
    padding: 20px 22px;
    box-shadow: var(--bp-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.bp-kpi-card:hover {
    box-shadow: var(--bp-shadow-md);
    transform: translateY(-1px);
}

.bp-kpi-card .bp-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--bp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bp-kpi-card .bp-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--bp-text-primary);
}

.bp-kpi-card .bp-kpi-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--bp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bp-kpi-card .bp-kpi-sub {
    font-size: 0.78rem;
    color: var(--bp-text-muted);
    margin-top: 4px;
}

.bp-kpi-card .bp-kpi-trend-up {
    color: #16A34A;
    font-size: 0.78rem;
    font-weight: 600;
}

.bp-kpi-card .bp-kpi-trend-down {
    color: #DC2626;
    font-size: 0.78rem;
    font-weight: 600;
}

/* KPI Card stripe accent */
.bp-kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
}

.bp-kpi-card.accent-green::before { background: #16A34A; }
.bp-kpi-card.accent-red::before   { background: #DC2626; }
.bp-kpi-card.accent-orange::before { background: #F59E0B; }
.bp-kpi-card.accent-blue::before  { background: #3B82F6; }
.bp-kpi-card.accent-purple::before { background: #8B5CF6; }

/* ===== SECTION HEADERS ===== */
.bp-page-header {
    margin-bottom: 24px;
}

.bp-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bp-text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
}

.bp-page-subtitle {
    font-size: 0.88rem;
    color: var(--bp-text-secondary);
    margin: 4px 0 0 0;
}

/* ===== CARD / PAPER OVERRIDES ===== */
.mud-paper {
    border-radius: var(--bp-radius) !important;
    border: 1px solid var(--bp-border-light) !important;
}

/* ===== DATA TABLE STYLING ===== */
.mud-table {
    border-radius: var(--bp-radius) !important;
}

.mud-table-head .mud-table-cell {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: var(--bp-text-secondary) !important;
    background: var(--bp-surface-alt) !important;
    border-bottom: 1px solid var(--bp-border) !important;
    padding: 10px 16px !important;
}

.mud-table-body .mud-table-row {
    transition: background 0.12s ease;
}

.mud-table-body .mud-table-row:hover {
    background: var(--bp-surface-alt) !important;
}

.mud-table-body .mud-table-cell {
    font-size: 0.875rem !important;
    color: var(--bp-text-primary) !important;
    border-bottom: 1px solid var(--bp-border-light) !important;
    padding: 12px 16px !important;
}

/* ===== CHIP STYLING ===== */
.mud-chip {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.02em !important;
}

/* ===== STATUS BADGES ===== */
.bp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bp-badge-success { background: #DCFCE7; color: #15803D; }
.bp-badge-error   { background: #FEE2E2; color: #DC2626; }
.bp-badge-warning { background: #FEF9C3; color: #CA8A04; }
.bp-badge-info    { background: #DBEAFE; color: #2563EB; }
.bp-badge-gray    { background: #F1F5F9; color: #475569; }

/* ===== SECTION DIVIDERS ===== */
.bp-section-divider {
    height: 1px;
    background: var(--bp-border-light);
    margin: 24px 0;
}

/* ===== LIVE STATUS INDICATOR ===== */
.bp-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16A34A;
    animation: bp-pulse 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes bp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

/* ===== ACTION BUTTONS ===== */
.bp-btn-primary {
    background: var(--bp-primary) !important;
    color: #FFFFFF !important;
    border-radius: var(--bp-radius-sm) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    font-size: 0.875rem !important;
    box-shadow: 0 2px 8px rgba(22,163,74,0.25) !important;
    transition: all 0.2s ease !important;
}

.bp-btn-primary:hover {
    background: var(--bp-primary-dark) !important;
    box-shadow: 0 4px 12px rgba(22,163,74,0.35) !important;
}

/* ===== CHARTS SECTION ===== */
.bp-chart-card {
    background: #FFFFFF;
    border-radius: var(--bp-radius);
    border: 1px solid var(--bp-border-light);
    padding: 20px;
    box-shadow: var(--bp-shadow);
}

.bp-chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bp-text-primary);
    margin-bottom: 4px;
}

.bp-chart-subtitle {
    font-size: 0.78rem;
    color: var(--bp-text-muted);
    margin-bottom: 16px;
}

/* ===== DASHBOARD SPECIFIC ===== */
.bp-dashboard-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bp-text-muted);
    margin-bottom: 12px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ===== FORM CONTROLS OVERRIDE ===== */
.mud-input-outlined .mud-input-root {
    border-radius: var(--bp-radius-sm) !important;
}


.kpi-card { height: 100%; }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }
.border-left-4 { border-left: 4px solid currentColor !important; }
.border-primary { border-left-color: var(--bp-primary) !important; }
.border-warning { border-left-color: #F59E0B !important; }
.border-info { border-left-color: #0EA5E9 !important; }
.border-error { border-left-color: #EF4444 !important; }
.border-success { border-left-color: #22C55E !important; }
.border-secondary { border-left-color: #64748B !important; }

/* ===== Energy Flow Animations ===== */
.flow-line { stroke-dasharray: 10 5; }
.flow-line-active { animation: flowAnimation 1s linear infinite; }
.flow-line-reverse { animation: flowAnimationReverse 1s linear infinite; }
@keyframes flowAnimation { to { stroke-dashoffset: -15; } }
@keyframes flowAnimationReverse { to { stroke-dashoffset: 15; } }

/* ===== Empty State ===== */
.bp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    opacity: 0.7;
}
.bp-empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* ===== Breadcrumbs ===== */
.bp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: #64748B;
}
.bp-breadcrumb a {
    color: #16A34A;
    text-decoration: none;
}
.bp-breadcrumb a:hover {
    text-decoration: underline;
}
.bp-breadcrumb-sep {
    color: #CBD5E1;
}

/* ===== Calendar Grid ===== */
.bp-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
}
.bp-calendar-header {
    background: #0F172A;
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.bp-calendar-day {
    background: white;
    min-height: 80px;
    padding: 0.375rem;
    cursor: pointer;
    transition: background 0.15s;
}
.bp-calendar-day:hover {
    background: #F0FDF4;
}
.bp-calendar-day.today {
    border: 2px solid #16A34A;
    border-radius: 4px;
}
.bp-calendar-day.selected {
    background: #DCFCE7;
}
.bp-calendar-day.other-month {
    opacity: 0.35;
}
.bp-calendar-day-num {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 2px;
}
.bp-calendar-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 1px;
}

/* ===== Keyboard Shortcuts Modal ===== */
.bp-shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-family: monospace;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}


