﻿.accounting-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.accounting-dashboard h3 {
    margin: 0 0 30px 0;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 60%, #db2777 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
}

.accounting-dashboard h3::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    border-radius: 4px;
    margin-top: 6px;
    background: linear-gradient(90deg, #6366f1, #ec4899);
}

.dashboard-filters {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(76, 29, 149, 0.08);
    border: 1px solid #ece9fe;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 700;
    color: #4338ca;
    letter-spacing: 0.02em;
}

.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.filter-group .btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.filter-group .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(30, 41, 59, 0.08);
    border: 1px solid #f1f1f4;
    border-top: 4px solid #9ca3af;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 70%);
    pointer-events: none;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(30, 41, 59, 0.14);
}

.dashboard-card h4 {
    margin: 0 0 16px 0;
    font-size: 17px;
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.card-value {
    font-size: 36px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.sales-card {
    border-top-color: #22c55e;
}

.sales-card .card-value {
    color: #16a34a;
}

.unpaid-card {
    border-top-color: #f97316;
}

.unpaid-card .card-value {
    color: #ea580c;
}

.tax-card {
    border-top-color: #3b82f6;
}

.tax-card .card-value {
    color: #2563eb;
}

.inventory-card {
    border-top-color: #f59e0b;
}

.inventory-card .card-value {
    color: #d97706;
}

.workorder-card {
    border-top-color: #a855f7;
}

.workorder-card .card-value {
    color: #9333ea;
}

.card-breakdown {
    border-top: 1px dashed #e2e8f0;
    padding-top: 16px;
    position: relative;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
    transition: background-color 0.2s, padding-left 0.2s;
}

.breakdown-item:hover {
    background-color: #f5f3ff;
    padding-left: 12px;
}

.breakdown-item span:first-child {
    color: #64748b;
}

.breakdown-item .amount {
    font-weight: 700;
    color: #1e293b;
}

.breakdown-item.returns-item span:first-child,
.breakdown-item.returns-item .amount {
    color: #dc2626;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.quick-links {
    background: linear-gradient(135deg, #ffffff 0%, #f8f7ff 100%);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(30, 41, 59, 0.08);
    border: 1px solid #ece9fe;
}

.quick-links h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.25);
}

.quick-link-card:nth-child(1) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 10px rgba(79, 172, 254, 0.3);
}

.quick-link-card:nth-child(2) {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    box-shadow: 0 4px 10px rgba(253, 160, 133, 0.3);
}

.quick-link-card:nth-child(3) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 4px 10px rgba(67, 233, 123, 0.3);
}

.quick-link-card:nth-child(4) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 4px 10px rgba(250, 112, 154, 0.3);
}

.quick-link-card:nth-child(5) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.quick-link-card:nth-child(6) {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    box-shadow: 0 4px 10px rgba(48, 207, 208, 0.3);
}

.quick-link-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    color: white;
}

.quick-link-card .icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.quick-link-card span:last-child {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .link-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ---------------------------------------------------------
   DARK MODE OVERRIDES
--------------------------------------------------------- */
html.dark .accounting-dashboard h3 {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 60%, #f472b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

html.dark .dashboard-filters {
    background: linear-gradient(135deg, #1c1c1e 0%, #232336 100%) !important;
    border: 1px solid #3a3a3c !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

html.dark .filter-group label {
    color: #a5b4fc;
}

html.dark .filter-group input[type="date"] {
    background: #1c1c1e;
    color: #f5f5f7;
    border: 1px solid #3a3a3c;
}

html.dark .filter-group input[type="date"]:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

html.dark .filter-group .btn-secondary {
    background: #2c2c2e;
    color: #f5f5f7;
    border: 1px solid #3a3a3c;
}

/* Card surfaces (including the inline-gradient link cards defined in the .razor markup) */
html.dark .dashboard-card {
    background: #1c1c1e !important;
    border: 1px solid #3a3a3c !important;
    border-top: 4px solid #6b7280 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

html.dark .dashboard-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

html.dark .dashboard-card::before {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
}

html.dark .dashboard-card h4 {
    color: #d1d5db;
}

html.dark .card-value {
    color: #f5f5f7 !important;
}

html.dark .sales-card { border-top-color: #22c55e !important; }
html.dark .sales-card .card-value { color: #4ade80; }

html.dark .unpaid-card,
html.dark .unpaid-bills-card { border-top-color: #f97316 !important; }
html.dark .unpaid-card .card-value,
html.dark .unpaid-bills-card .card-value { color: #fb923c; }

html.dark .tax-card { border-top-color: #3b82f6 !important; }
html.dark .tax-card .card-value { color: #60a5fa; }

html.dark .inventory-card { border-top-color: #f59e0b !important; }
html.dark .inventory-card .card-value { color: #fbbf24; }

html.dark .workorder-card { border-top-color: #a855f7 !important; }
html.dark .workorder-card .card-value { color: #c084fc; }

html.dark .card-breakdown {
    border-top: 1px dashed #3a3a3c;
}

html.dark .breakdown-item:hover {
    background-color: #2c2c2e;
}

html.dark .breakdown-item span:first-child {
    color: #a1a1aa;
}

html.dark .breakdown-item .amount {
    color: #f5f5f7;
}

html.dark .breakdown-item.returns-item span:first-child,
html.dark .breakdown-item.returns-item .amount {
    color: #f87171;
}

html.dark .quick-links {
    background: linear-gradient(135deg, #1c1c1e 0%, #232336 100%) !important;
    border: 1px solid #3a3a3c !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

html.dark .quick-links h4 {
    color: #f5f5f7;
}

html.dark .quick-link-card {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

html.dark .quick-link-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.55);
}
