:root {
    --bg-color: #0f0f13;
    --sidebar-bg: #18181f;
    --card-bg: #20202a;
    --primary-color: #6c5ce7;
    --primary-hover: #5b4cc4;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-color: #00cec9;
    --danger-color: #ff7675;
    --border-color: #2d2d3a;
    --glass-bg: rgba(32, 32, 42, 0.7);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 600;
}

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

/* Layout */
#app {
    display: flex;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.view {
    display: none;
    width: 100%;
    height: 100%;
}

.view.active {
    display: flex;
}

/* Sidebar States */
body.sidebar-closed .sidebar {
    margin-left: -260px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
}

/* Main View */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: margin-left 0.3s ease, transform 0.3s ease;
    z-index: 100;
}

.brand {
    margin-bottom: 3rem;
}

.brand h2 {
    color: var(--primary-color);
}

.nav-links li {
    list-style: none;
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: block;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}

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

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    transition: all 0.3s ease;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Components */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-small {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

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

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
}

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

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    position: relative;
    border: 1px solid var(--border-color);
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    font-size: 0.9rem;
}

#conciliation-area {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100%;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        margin-left: 0 !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

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

    body.sidebar-closed .sidebar {
        margin-left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .content-area {
        padding: 1rem;
    }

    .mobile-only-btn {
        display: block;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .top-bar .actions {
        width: 100%;
    }

    .top-bar .actions button {
        width: 100%;
    }

    /* Table Responsiveness */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

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

    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
        padding: 1.5rem;
    }
}