:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-body: #f3f4f6;
    --bg-white: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --sidebar-width: 250px;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* Global Link Reset */
a {
    text-decoration: none !important;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary);
}

/* Auth */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.brand {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.nav {
    padding: 1rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

.nav-link:hover {
    background-color: var(--bg-body);
}

.nav-link.logout {
    color: #ef4444;
    margin-top: 1rem;
}

/* Dropdown Menu */
/* Dropdown Menu */
/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    margin-bottom: 0.25rem;
}

.nav-dropdown .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.nav-dropdown .dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.nav-dropdown .dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    margin-left: 1rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-color);
    margin-top: 0;
    display: flex;
    flex-direction: column;
    /* Force vertical stacking */
}

.nav-dropdown.open .dropdown-menu {
    max-height: 500px;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Specific class for sub-links to ensure styles apply */
.sub-nav-link {
    display: block !important;
    padding: 0.6rem 1rem !important;
    color: var(--text-muted) !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    border-radius: 4px;
    transition: all 0.2s;
    width: 100%;
}

.sub-nav-link:hover,
.sub-nav-link:focus,
.sub-nav-link:active {
    color: var(--primary) !important;
    background: rgba(79, 70, 229, 0.05) !important;
    transform: translateX(5px);
    text-decoration: none !important;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.content {
    padding: 1.5rem;
}

/* Components */
.card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

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

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

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert.error {
    background: #fee2e2;
    color: #b91c1c;
}

.alert.success {
    background: #dcfce7;
    color: #15803d;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
}