@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #7c3aed; /* Refrens Purple */
    --primary-light: #f5f3ff;
    --primary-hover: #6d28d9;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-light: #f9fafb;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: all 0.3s ease;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.75rem 1.5rem;
    margin: -2rem -2rem 2rem -2rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9375rem;
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-link i {
    width: 20px;
    height: 20px;
}

.nav-text-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge-new {
    font-size: 0.7rem;
    background: #fee2e2;
    color: #ef4444;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.sub-menu {
    list-style: none;
    padding-left: 2.75rem;
    margin-bottom: 0.5rem;
    display: none; /* Hide by default */
    overflow: hidden;
    transition: all 0.3s ease;
}

.sub-menu.show {
    display: block;
}

.nav-link {
    cursor: pointer;
}

.chevron-icon {
    transition: transform 0.3s ease;
}

.nav-item.open .chevron-icon {
    transform: rotate(180deg);
}

.active-parent {
    color: var(--primary) !important;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2rem;
    width: calc(100% - 280px);
}

/* Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Table */
.data-table th {
    background-color: #f9fafb;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    border-bottom: 1px solid var(--border-color);
}

/* Inputs */
.input {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Badges */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-paid { background-color: rgba(16, 185, 129, 0.1); color: var(--secondary); }
.badge-unpaid { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-partial { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 2rem 0.5rem; }
    .logo-text, .nav-text { display: none; }
    .main-content { margin-left: 80px; width: calc(100% - 80px); }
    .nav-link { justify-content: center; }
}
