/* AntiGravity Clean White Theme */
:root {
    --bg-body: #f3f4f6;
    /* Light gray background */
    --bg-card: #ffffff;
    /* White cards */
    --bg-sidebar: #ffffff;
    /* White sidebar */
    --border-color: #e5e7eb;
    /* Light border */

    --primary: #4f46e5;
    /* Indigo-600 */
    --primary-hover: #4338ca;
    /* Indigo-700 */
    --secondary: #64748b;
    /* Slate-500 */

    --success: #10b981;
    /* Emerald-500 */
    --warning: #f59e0b;
    /* Amber-500 */
    --danger: #ef4444;
    /* Red-500 */

    --text-main: #1e293b;
    /* Slate-800 */
    --text-muted: #64748b;
    /* Slate-500 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 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);

    --font-family: 'Inter', system-ui, sans-serif;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout Structure */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-link.active {
    background: #e0e7ff;
    /* Indigo-100 */
    color: var(--primary);
    font-weight: 600;
}

.nav-icon {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

.user-profile {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Header */
.top-bar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--bg-card);
    /* White */
    border-bottom: 1px solid var(--border-color);
    z-index: 40;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Dashboard Grid */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.card-trend {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

/* Charts Area */
.chart-container {
    height: 300px;
    width: 100%;
}

.bar {
    flex: 1;
    background: #e0e7ff;
    /* light indigo */
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.6s ease-out;
    min-height: 4px;
}

.bar:hover {
    background: var(--primary);
}

.bar::after {
    content: attr(data-val);
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
    background: var(--text-main);
    padding: 4px 8px;
    border-radius: 4px;
}

.bar:hover::after {
    opacity: 1;
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.success-icon {
    background: #ecfdf5;
    color: var(--success);
}

.warning-icon {
    background: #fffbeb;
    color: var(--warning);
}

.danger-icon {
    background: #fef2f2;
    color: var(--danger);
}

.activity-text h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-main);
}

.activity-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-amount {
    font-weight: 600;
    font-size: 1rem;
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
}

.glass-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.glass-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.glass-table tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
}

.badge-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fef3c7;
}

.badge-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.badge-info {
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #dbeafe;
}

/* Forms */
.form-input {
    width: 100%;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    margin-bottom: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
    color: var(--text-main);
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 320px;
}

.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    margin-left: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.search-bar input:focus {
    outline: none;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    /* darkened overlay */
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: white;
    width: 500px;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: var(--text-main);
}

/* Responsive */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .grid-4,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}