:root {
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --surface-hover: #F8F9FA;
    --border: #EAEAEA;
    --border-hover: #D4D4D4;
    --text-main: #171717;
    --text-muted: #737373;
    --text-light: #A3A3A3;
    --accent: #171717;
    --accent-bg: #F5F5F5;
    --success: #16A34A;
    --danger: #DC2626;
    --sidebar-width: 260px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a, button {
    text-decoration: none;
    color: inherit;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.dashboard-shell {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    border-right: none;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #0f172a;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
}

.nav-section {
    margin-bottom: 36px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
    padding-left: 12px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-links a i {
    font-size: 1.1rem;
    transition: color 0.2s ease;
    color: #64748b;
}

.nav-links a:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

.nav-links a:hover i {
    color: #f8fafc;
}

.nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;
    font-weight: 600;
}

.nav-links a.active i {
    color: #ffffff;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    overflow-y: auto;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
    background: rgba(250, 250, 250, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-btn {
    display: none;
}

.search-wrapper {
    position: relative;
    width: 320px;
}

.search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
}

.search-wrapper input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 14px 10px 40px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--text-light);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

.search-wrapper input::placeholder {
    color: var(--text-light);
}

.top-bar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.top-profile {
    margin-left: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.top-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.top-profile:hover img {
    transform: scale(1.05);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
}

.dropdown-menu.show {
    display: flex;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item i {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.dropdown-item:hover {
    background: var(--surface-hover);
}

.dropdown-item:hover i {
    color: var(--text-main);
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger i {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: #FEE2E2;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 6px;
    height: 6px;
    background: var(--danger);
    border-radius: 50%;
}

.sidebar-backdrop {
    display: none;
}

/* Main Panel */
.main-panel {
    padding: 32px 48px 74px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: transparent;
    border: none;
}

.eyebrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.welcome-header h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.welcome-header p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 500px;
    line-height: 1.5;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.primary-btn {
    background: var(--text-main);
    color: var(--surface);
    border: 1px solid var(--text-main);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.primary-btn:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.primary-btn i {
    color: var(--surface);
}

.secondary-btn {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.secondary-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 16px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

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

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--bg);
}

.trend.up {
    color: var(--success);
    background: #DCFCE7;
}

.trend.down {
    color: var(--text-main);
    background: var(--bg);
}

.trend-critical {
    color: var(--danger);
    background: #FEE2E2;
}

.stat-info span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* Content Row */
.content-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

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

.card-kicker {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-pill {
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.filter-pill:hover {
    background: var(--surface-hover);
    color: var(--text-main);
}

.view-all-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.view-all-link:hover {
    background: var(--surface-hover);
}

/* Chart */
.chart-container {
    padding: 12px 0 0 0;
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot-primary {
    background: var(--text-main);
}

.legend-dot-secondary {
    background: var(--border-hover);
}

.chart-axis-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.chart-area {
    fill: url(#revenueArea);
}

.chart-line {
    fill: none;
    stroke: var(--text-main);
    stroke-width: 2;
}

.chart-points circle {
    fill: var(--surface);
    stroke: var(--text-main);
    stroke-width: 2;
    transition: all 0.2s ease;
}

.chart-points circle:hover {
    r: 6;
    fill: var(--text-main);
}

/* Transactions */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.transaction-item:hover {
    background: var(--surface-hover);
    border-color: var(--border);
}

.t-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
}

.t-info {
    flex: 1;
}

.t-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--text-main);
}

.t-info p {
    color: var(--text-light);
    font-size: 0.8rem;
    margin: 0;
}

.t-amount {
    font-weight: 600;
    font-size: 0.9rem;
}

.t-positive {
    color: var(--success);
}

.t-negative {
    color: var(--text-main);
}

.t-brand {
    color: var(--text-main);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: var(--surface-hover);
}

.badge {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #DCFCE7;
    color: var(--success);
}

.badge-warning {
    background: #FEF9C3;
    color: #CA8A04;
}

.badge-danger {
    background: #FEE2E2;
    color: var(--danger);
}

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .dashboard-shell {
        height: 100vh;
    }

    .sidebar {
        width: var(--sidebar-width);
        height: 100vh;
        padding: 24px;
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 40;
        border-bottom: none;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 30;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .main-content {
        height: 100vh;
        width: 100%;
    }

    .top-bar {
        padding: 20px 24px;
    }

    .mobile-menu-btn {
        display: inline-flex;
        margin-right: 8px;
    }

    .main-panel {
        padding: 24px 24px 48px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
        align-items: center;
    }

    .search-wrapper {
        width: 100%;
        order: 3;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .card {
        padding: 20px;
    }
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    margin-bottom: 16px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* Notifications */
.notification-wrapper {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.notification-dropdown.show {
    display: flex;
}

.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.mark-read {
    font-size: 0.8rem;
    color: var(--brand, #4f46e5);
    text-decoration: none;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--surface-hover);
}

.notification-item.unread {
    background: rgba(79, 70, 229, 0.03);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.icon-green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.icon-orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.icon-red { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.notification-content p {
    margin: 0 0 4px 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.notification-content span {
    font-size: 0.75rem;
    color: var(--text-light);
}

.notification-footer {
    padding: 12px;
    text-align: center;
    background: var(--surface-hover);
}

.view-all-notifications {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border: 2px solid var(--surface);
    border-radius: 50%;
}
