:root {
    /* Color Palette */
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --primary: #4f46e5;      /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --primary-light: #e0e7ff; /* Indigo 100 */
    
    --secondary: #0ea5e9;    /* Light Blue 500 */
    --success: #10b981;      /* Emerald 500 */
    --success-bg: #d1fae5;
    --warning: #f59e0b;      /* Amber 500 */
    --warning-bg: #fef3c7;
    --danger: #ef4444;       /* Red 500 */
    --danger-bg: #fee2e2;
    
    --sidebar-bg: #0f172a;   /* Slate 900 */
    --sidebar-text: #94a3b8;
    --sidebar-hover: #1e293b;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #4f46e5;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --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);
    --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.3);
    
    /* Geometry */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,0.05);
}

.sidebar-header {
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 12px;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    padding: 24px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    gap: 14px;
    transition: var(--transition);
    font-weight: 500;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}

.nav-links li a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-active);
    transform: translateX(4px);
}

.nav-links li a.active {
    background: var(--sidebar-active-bg);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.nav-links li a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-links li a:hover i {
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

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

.sidebar-footer a:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Header */
.top-header {
    height: 76px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
    position: sticky;
    top: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.toggle-btn:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    padding: 10px 20px;
    border-radius: 100px;
    gap: 12px;
    border: 1px solid transparent;
    transition: var(--transition);
    width: 300px;
}

.search-bar:focus-within {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.95rem;
}

.search-bar i {
    color: var(--text-muted);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 16px 6px 6px;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.user-profile:hover {
    background: var(--bg-main);
    border-color: var(--border-color);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid #fff;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Content Wrapper */
.content-wrapper {
    padding: 32px;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 28px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition);
    background: #fff;
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-control:disabled {
    background: var(--bg-main);
    color: var(--text-muted);
    cursor: not-allowed;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.95rem;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: #cbd5e1;
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

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

.btn-info:hover {
    background: #0284c7;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

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

.table th, .table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

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

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.02em;
}

.badge-scheduled { background: var(--warning-bg); color: #b45309; border: 1px solid #fde68a; }
.badge-completed { background: var(--success-bg); color: #047857; border: 1px solid #a7f3d0; }
.badge-cancelled { background: var(--danger-bg); color: #b91c1c; border: 1px solid #fecaca; }

/* Grid Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.stat-info h3 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-info .h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

/* Alert / Notification */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.4s ease;
}

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

.alert-success {
    background-color: var(--success-bg);
    color: #065f46;
    border: 1px solid #34d399;
}

.alert-error {
    background-color: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #f87171;
}

/* Auth Page */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0f172a;
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, transparent 70%);
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    padding: 48px;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 440px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.auth-logo {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 6px rgba(79, 70, 229, 0.3));
}

.auth-card h2 {
    margin-bottom: 32px;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

.auth-card .form-control {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 18px;
}

.auth-card .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 16px;
    border-radius: 10px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9; 
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}

/* Responsive sidebar */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100vh;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .search-bar {
        width: 200px;
    }
}
