:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --border: #e2e8f0;
    --text-main: #334155;
    --text-muted: #64748b;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
}

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

body {
    font-family: 'Lexend', sans-serif;
    background-color: #f1f5f9;
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

ul {
    list-style: none;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a472a 0%, #2d6a3f 40%, #1a472a 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-bg-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

.auth-bg-logo img {
    width: 500px;
    height: 500px;
    object-fit: contain;
}

.auth-card {
    background: var(--white);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-light);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 8px;
}

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

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

.btn-block {
    width: 100%;
}

.error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
}

.sidebar-header img.sidebar-logo {
    width: 28px !important;
    height: 28px !important;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-brand {
    display: none;
}

.sidebar-brand {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-label {
    padding: 0 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 12px;
    white-space: nowrap;
}

.sidebar.collapsed .menu-label {
    display: none;
}

.menu-item {
    margin: 4px 12px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.menu-link i {
    width: 24px;
    min-width: 24px;
    text-align: center;
    font-size: 18px;
}

.sidebar.collapsed .menu-link span,
.sidebar.collapsed .ms-auto {
    display: none;
}

.sidebar.collapsed .submenu-items {
    display: none !important;
}

.menu-link:hover, .menu-link.active {
    background-color: rgba(255,255,255,0.1);
    color: var(--white);
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.topbar {
    height: 70px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
}

.user-profile:hover {
    background-color: #f8fafc;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    display: none;
}

@media (min-width: 768px) {
    .user-info {
        display: block;
    }
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.content-body {
    padding: 30px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stats-card {
    background-color: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stats-info p {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-primary-light { background-color: rgba(37, 99, 235, 0.1); color: var(--primary); }
.bg-success-light { background-color: rgba(34, 197, 94, 0.1); color: var(--success); }
.bg-warning-light { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.bg-info-light { background-color: rgba(14, 165, 233, 0.1); color: var(--info); }

/* Tables */
.card {
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

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

.card-title {
    font-size: 16px;
    font-weight: 700;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: #f8fafc;
    padding: 12px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 16px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background-color: #dcfce7; color: #166534; }
.badge-warning { background-color: #fef9c3; color: #854d0e; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-info { background-color: #e0f2fe; color: #075985; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
