:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Light Theme */
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-input: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: rgba(226, 232, 240, 0.8);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] {
    --bg-main: #020617;
    --bg-sidebar: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-input: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: rgba(51, 65, 85, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --glass-bg: rgba(15, 23, 42, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'DM Sans', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

/* Layout Structure */
.dashboard-layout {
    display: flex;
}

.main-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
    padding: 10px 50px 100px; /* 50px horizontal margins as requested */
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.logo-minimal {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo-minimal svg {
    width: 32px;
    height: 32px;
}

.top-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 48px;
    padding: 24px 0;
    margin-bottom: 32px;
}

.logo-minimal {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo-minimal svg {
    width: 28px;
    height: 28px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    padding: 10px 20px;
    border-radius: 12px;
    max-width: none;
    flex: 1;
    color: var(--text-muted);
}

.search-bar svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
    font-size: 14px;
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.btn-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #ff3b30;
    border-radius: 50%;
    border: 2px solid var(--bg-main);
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Theme Toggle */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-sidebar);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    position: absolute;
    transition: transform 0.5s ease, opacity 0.3s;
}

[data-theme="dark"] .theme-toggle .sun {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="light"] .theme-toggle .moon {
    opacity: 0;
    transform: rotate(-90deg);
}


.hero {
    position: relative;
    padding: 40px 0 50px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(2,132,199,0.3), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(34,211,238,0.15), transparent);
    z-index: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 18px;
}

.logo svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.account-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 11px;
    color: var(--text-muted);
}

.account-badge strong {
    color: var(--text);
    font-size: 14px;
}

.main-metric {
    text-align: center;
    position: relative;
    z-index: 1;
}

.metric-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

/* Metric Grid for multi-meters */
.metric-grid {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.mg-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mg-lab {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.mg-val {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
}

.mg-val small {
    font-size: 16px;
    font-weight: 500;
}

.metric-period {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Common Components */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px; /* Smaller radius for smaller padding */
    padding: 10px; /* Internal padding 10px as requested */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden; /* Prevent icons from leaking */
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(min-content, max-content);
    gap: 10px; /* Grid gap 10px as requested */
    margin-top: 20px;
}

.welcome-header {
    margin-bottom: 8px;
}

.welcome-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.welcome-header h1 span {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-header p {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

/* Consolidated Grid Spans for row alignment */
.main-metric-card { grid-column: span 8; }
.bill-card-main { grid-column: span 4; }
.chart-card { grid-column: span 12; }
.readings-card { grid-column: span 6; }
.meters-grid-card { grid-column: span 6; }
.forecast-card { grid-column: span 12; }

.main-metric-card {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    padding: 15px;
}

.main-metric-card .card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.main-metric-card .card-header .label {
    opacity: 0.8;
}

.main-metric-card .metric-value {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 48px;
}

.main-metric-card .mg-val {
    color: white; /* Force white for blue card */
}

.main-metric-card .mg-lab {
    color: rgba(255, 255, 255, 0.8);
}

.main-metric-card .unit {
    font-size: 24px;
    opacity: 0.7;
    font-weight: 600;
}

/* Quick Stats Row */
.main-metric-card .quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
}

.q-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qs-val {
    font-size: 22px;
    font-weight: 700;
}

.qs-lab {
    font-size: 12px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Forecast Card */
/* Consolidating... */

/* Forecast Trend Graph */
.forecast-trend-graph {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
    margin-top: 24px;
    padding: 0 10px;
}

.ft-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
}

.ft-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ft-month {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ft-trend {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
}

.trend-up {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.trend-down {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.ft-visual {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.ft-bar {
    width: 100%;
    background: linear-gradient(to top, var(--primary), var(--primary-light));
    border-radius: 12px 12px 6px 6px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.ft-item:hover .ft-bar {
    transform: scaleY(1.05);
}

.ft-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.ft-divider {
    width: 1px;
    height: 80px;
    background: var(--border);
    align-self: center;
    opacity: 0.5;
}

/* Sections */
.card-section {
    grid-column: span 12;
    margin-top: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.tag {
    background: rgba(2,132,199,0.2);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Consolidating duplicates... */

.chart-wrapper {
    margin-top: 20px;
}

.bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 180px;
    margin-bottom: 16px;
}

.bar {
    flex: 1;
    background: var(--bg-input);
    border-radius: 6px 6px 4px 4px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.bar:hover {
    background: var(--primary-light);
    transform: scaleY(1.02);
}

.bar.active {
    background: var(--primary);
}

.bar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-main);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    margin-bottom: 8px;
}

.bar:hover .bar-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.months {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.tag {
    background: var(--primary-light);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* Consolidating duplicates... */

.btn-add {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-add:hover {
    background: var(--primary-dark);
}

.readings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.reading-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid transparent;
    gap: 12px;
    transition: all 0.3s ease;
}

.reading-item:hover {
    border-color: var(--primary-light);
    background: var(--bg-card);
    transform: translateX(4px);
}

.reading-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.reading-date {
    font-size: 14px;
    font-weight: 600;
}

.reading-meter {
    font-size: 11px;
    color: var(--text-muted);
}

.reading-value {
    text-align: right;
}

.rv-current {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.rv-diff {
    font-size: 11px;
    color: var(--text-muted);
}

.status {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.status.ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Bill Card Main */
/* Consolidating duplicates... */
.bill-card-main {
    grid-column: span 4;
    text-align: center;
}

.bill-amount {
    font-size: 40px;
    font-weight: 800;
    color: var(--primary);
    margin: 12px 0 4px;
}

.bill-amount .currency {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 4px;
}

.bill-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
}

.status-alert {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.bill-details-mini {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
}

.bill-details-mini .bd-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
}

.bill-details-mini .bd-row span:last-child {
    font-weight: 600;
}

.btn-pay-modern {
    width: 100%;
    background: var(--text-primary);
    color: var(--bg-main);
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-pay-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Meters Mini Grid */
/* Consolidating duplicates... */

.meters-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.mini-meter-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: 16px;
}

.m-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.m-icon svg {
    width: 24px;
    height: 24px;
}

.m-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.m-num {
    font-weight: 700;
    font-size: 15px;
}

.m-loc {
    font-size: 12px;
    color: var(--text-muted);
}

.m-val {
    font-weight: 800;
    color: var(--primary);
}

.footer-modern {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* Modal and Toast Redesign */
.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 40px;
}

.form-group input, .form-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.btn-submit {
    background: var(--primary);
    border-radius: 14px;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 24px 12px;
    }
    
    .sidebar .logo span, .user-info, .nav-item span {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .main-wrapper {
        margin-left: 80px;
        padding: 0 24px 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-wrapper {
        margin-left: 0;
        padding: 0 16px 16px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .main-metric-card, .forecast-card, .chart-card, .readings-card, .bill-card-main, .meters-grid-card {
        grid-column: span 12;
    }
    
    .search-bar {
        width: 100%;
        max-width: none;
    }
}

/* Forecast Card */
/* Consolidating... */

.forecast-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 24px;
}

.forecast-item {
    background: var(--bg-input);
    padding: 20px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fi-month {
    width: auto;
    font-size: 16px;
    font-weight: 700;
}

.fi-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
}

.fib-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 4px;
}

/* Animations and others... */
.mobile-menu-toggle {
    display: none;
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeInUp 0.6s ease backwards;
}

.dashboard-grid > *:nth-child(1) { animation-delay: 0.1s; }
.dashboard-grid > *:nth-child(2) { animation-delay: 0.2s; }
.dashboard-grid > *:nth-child(3) { animation-delay: 0.3s; }
.dashboard-grid > *:nth-child(4) { animation-delay: 0.4s; }
.dashboard-grid > *:nth-child(5) { animation-delay: 0.5s; }
.dashboard-grid > *:nth-child(6) { animation-delay: 0.6s; }

/* Micro-animations */
.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

@media (max-width: 768px) {
    .main-wrapper {
        padding: 16px 20px;
    }
    
    .top-nav {
        grid-template-columns: 1fr auto;
        gap: 16px;
    }
    
    .search-bar {
        order: 3;
        grid-column: span 2;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .forecast-trend-graph {
        gap: 12px;
        padding: 0;
    }
    
    .ft-divider {
        display: none;
    }
    
    .ft-bar {
        border-radius: 8px 8px 4px 4px;
    }
}

.toast.error {
    border-color: var(--error-light);
}

.toast.error .toast-icon {
    background: var(--error) !important;
}

/* Modal System */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.open .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.close-btn {
    background: var(--bg-input);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.close-btn:hover {
    background: var(--error);
    color: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group select, .form-group input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group select:focus, .form-group input:focus {
    border-color: var(--primary);
    outline: none;
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn-primary {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Toast System */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* View System */
.view {
    display: none;
    width: 100%;
    min-height: 400px;
    opacity: 0;
    visibility: hidden;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.view.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    min-height: 600px !important;
}

/* Card Tabs for Charts */
.card-tabs {
    display: flex;
    gap: 12px;
    margin: 16px 0 24px;
    background: var(--bg-input);
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.m-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-mini-action {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-mini-action:hover {
    background: var(--primary);
    color: white;
}

.view-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.view-header p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Removed fadeIn animation as it was causing issues */

/* Payment View Styles */
.summary-shelf {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 32px;
    border-radius: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
}

.shelf-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shelf-label {
    opacity: 0.8;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shelf-value {
    font-size: 44px;
    font-weight: 800;
}

.shelf-value small {
    font-size: 18px;
    opacity: 0.7;
}

.btn-pay-all {
    background: white;
    color: var(--primary);
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-pay-all:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(255,255,255,0.2);
}

.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invoice-card {
    padding: 24px;
}

.inv-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.inv-icon {
    width: 52px;
    height: 52px;
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inv-icon.paid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.inv-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inv-title {
    font-weight: 700;
    font-size: 18px;
}

.inv-serial {
    font-size: 13px;
    color: var(--text-muted);
}

.inv-amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.inv-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.inv-due {
    font-size: 13px;
    color: var(--text-muted);
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-alert {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Bottom Dock Implementation */
.bottom-dock {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-item svg {
    width: 24px;
    height: 24px;
}

.dock-item span {
    font-size: 11px;
    font-weight: 600;
}

.dock-item:hover, .dock-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.dock-item.active svg {
    transform: scale(1.1);
}

/* Desktop Dock / Sidebar */
@media (min-width: 1025px) {
    .bottom-dock {
        left: 24px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        flex-direction: column;
        padding: 24px 12px;
        gap: 16px;
        border-radius: 24px;
    }
    
    .main-wrapper {
        padding-left: 120px; /* Offset for the floating sidebar */
    }
    
    .dock-item {
        padding: 12px;
        width: 60px;
        height: 60px;
        justify-content: center;
    }
    
    .dock-item span {
        display: none; /* Icon only on desktop for extra clean look, or show on hover */
    }
    
    .dock-item:hover span {
        display: block;
        position: absolute;
        left: 100%;
        background: var(--bg-card);
        padding: 4px 12px;
        border-radius: 8px;
        margin-left: 12px;
        white-space: nowrap;
        box-shadow: var(--shadow);
    }
}

/* Fix for huge forecast bars if necessary */
.fi-bar {
    width: 100%;
}
