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

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338ca;
    --secondary-color: #6366F1;
    --bg-color: #F5F7FB;
    --sidebar-bg: #ffffff;
    --sidebar-text: #6b7280;
    --sidebar-hover-bg: #eff6ff;
    --sidebar-hover-text: #4F46E5;
    --sidebar-active-bg: #4F46E5;
    --sidebar-active-text: #ffffff;
    --sidebar-active-text: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --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);
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
    background-color: var(--sidebar-bg);
    box-shadow: var(--shadow-sm);
    z-index: 1040;
    transition: var(--transition);
    border-right: 1px solid var(--border-color);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--overlay-bg);
    z-index: 1030;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    padding: 20px 15px;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}

.sidebar-menu a.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    box-shadow: var(--shadow-md);
}

.sidebar-menu a i {
    font-size: 1.1rem;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.top-navbar {
    height: 70px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggler {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 0;
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-profile .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

.nav-profile .dropdown-toggle::after {
    margin-left: 5px;
}

.profile-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Page Content */
.page-content {
    padding: 30px;
    flex-grow: 1;
}

/* Cards & Containers */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 24px;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 24px;
}

/* Buttons */
.btn {
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Floating Labels & Forms */
.form-control, .form-select {
    border-radius: var(--radius-md);
    padding: 12px 16px;
    border: 1px solid var(--border-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}

.form-floating > .form-control,
.form-floating > .form-control-plaintext,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
}

.form-floating > label {
    padding: 1rem 1rem;
}

/* Tables */
.table-responsive {
    border-radius: var(--radius-lg);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f9fafb !important;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 16px 20px;
    vertical-align: middle;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* Table Actions */
.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 4px;
}

.btn-view { background-color: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }
.btn-view:hover { background-color: #3b82f6; color: white; }

.btn-edit { background-color: #fefce8; color: #eab308; border: 1px solid #fef08a; }
.btn-edit:hover { background-color: #eab308; color: white; }

.btn-delete { background-color: #fef2f2; color: #ef4444; border: 1px solid #fecaca; }
.btn-delete:hover { background-color: #ef4444; color: white; }

.btn-print { background-color: #f0fdf4; color: #22c55e; border: 1px solid #bbf7d0; }
.btn-print:hover { background-color: #22c55e; color: white; }

/* Dashboard Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 24px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-blue { background-color: #eff6ff; color: #3b82f6; }
.stat-green { background-color: #f0fdf4; color: #22c55e; }
.stat-purple { background-color: #f3e8ff; color: #a855f7; }
.stat-orange { background-color: #fff7ed; color: #f97316; }

.stat-content h6 {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.stat-content h3 {
    color: var(--text-main);
    font-weight: 700;
    margin: 0;
}

/* Auth Split Layout */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.auth-left h1 {
    font-weight: 700;
    margin-bottom: 16px;
}

.auth-left p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.auth-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    padding: 40px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 991.98px) {
    .sidebar { left: -260px; }
    .sidebar.show { left: 0; }
    .main-wrapper { margin-left: 0; }
    
    .auth-wrapper { flex-direction: column; }
    .auth-left { padding: 60px 20px; flex: none; }
    .auth-right { padding: 40px 20px; }
}

@media (max-width: 767.98px) {
    .page-content { padding: 15px; }
    .top-navbar { padding: 0 15px; height: 60px; }
    .card { margin-bottom: 16px; }
    .card-body { padding: 16px; }
    .card-header { padding: 16px 20px; }
    
    .stat-card .card-body { padding: 20px 16px; }
    .stat-icon { width: 48px; height: 48px; font-size: 20px; }
    .stat-content h3 { font-size: 1.5rem; }
    
    .table-responsive {
        border-radius: var(--radius-md);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn { padding: 8px 16px; font-size: 0.9rem; }
    
    /* Ensure inputs stack and don't overflow */
    .form-floating > label { padding: 1rem 0.75rem; font-size: 0.9rem; }
}
