@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  /* --- PROFESSIONAL PREMIUM PALETTE --- */
  --primary: #0f172a;           /* Navy Dark */
  --primary-light: #1e293b;
  --accent: #0284c7;            /* Sky Blue Premium */
  --accent-secondary: #0ea5e9;
  --accent-light: #f0f9ff;
  --accent-glow: rgba(2, 132, 199, 0.15);
  
  --secondary: #64748b;         /* Slate */
  
  /* Vibrant but Professional Colors */
  --success: #10b981;           /* Emerald */
  --success-light: #ecfdf5;
  --warning: #f59e0b;           /* Amber */
  --warning-light: #fffbeb;
  --danger: #ef4444;            /* Rose */
  --danger-light: #fef2f2;
  --info: #3b82f6;              /* Blue */
  --info-light: #eff6ff;
  --purple: #8b5cf6;            /* Violet */
  --purple-light: #f5f3ff;

  /* Backgrounds */
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  
  /* Text */
  --txt-main: #1e293b;
  --txt-soft: #475569;
  --txt-muted: #94a3b8;
  
  /* Layout */
  --sidebar-w: 280px;
  --header-h: 70px;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  
  /* Shadows - Layered for Premium Feel */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BASE --- */
html {
  zoom: 0.85;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--txt-main);
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

/* --- LOADER --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--accent-light);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- APP LAYOUT --- */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* --- SIDEBAR --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid #e2e8f0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  transition: var(--transition);
  box-shadow: 10px 0 30px rgba(0,0,0,0.02);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0.5rem 0.5rem;
  margin-bottom: 2.5rem;
}

.sidebar-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 8px 16px rgba(2, 132, 199, 0.3);
}

.brand-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  letter-spacing: -0.8px;
  line-height: 1;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.nav-menu::-webkit-scrollbar { width: 4px; }
.nav-menu::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

.nav-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--txt-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1.5rem 0.75rem 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--txt-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  margin-bottom: 4px;
  position: relative;
}

.nav-item i {
  width: 22px;
  text-align: center;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.nav-item:hover {
  background: var(--accent-light);
  color: var(--accent);
  padding-left: 1.25rem;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(2, 132, 199, 0.25);
}

.nav-item.active i { color: white; }

/* --- MAIN CONTENT --- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
  background: var(--bg-app);
}

.top-header {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  background: white;
  border: 1px solid #e2e8f0;
  transition: var(--transition);
}

.user-profile:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.user-name { font-weight: 700; font-size: 0.9rem; color: var(--primary); }
.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.2);
}

/* --- COMPONENTS --- */
.content-wrapper {
  padding: 2.5rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid #e2e8f0;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  transition: var(--transition);
  position: relative;
}

.card:hover {  box-shadow: var(--shadow-lg); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title i {
    width: 32px;
    height: 32px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* --- DASHBOARD STATS --- */
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.75rem; }

.stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-card:hover { 
    transform: translateY(-6px); 
    box-shadow: var(--shadow-xl); 
    border-color: transparent;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
    opacity: 0;
    transition: var(--transition);
}
.stat-card:hover::before { opacity: 1; }

.stat-label { 
    font-size: 0.85rem; 
    font-weight: 700; 
    color: var(--txt-soft); 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    margin-bottom: 0.5rem;
}
.stat-value { 
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem; 
    font-weight: 900; 
    color: var(--primary); 
    margin: 0.25rem 0;
    line-height: 1;
}
.stat-desc { 
    font-size: 0.85rem; 
    color: var(--txt-muted); 
    margin-top: auto;
    font-weight: 500;
}

.stat-icon-bg {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: var(--transition);
}

.stat-card:hover .stat-icon-bg {
    transform: scale(1.1) rotate(-5deg);
}

/* --- TABLES --- */
.table-responsive {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: white;
}

table { width: 100%; border-collapse: collapse; }
th {
  background: #f8fafc;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--txt-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}
td { padding: 1.25rem; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fbff; }

/* --- BUTTONS --- */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-primary { 
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%); 
    color: white; 
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}
.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
}

.btn-outline { 
    background: white; 
    border: 1.5px solid #e2e8f0; 
    color: var(--txt-main); 
}
.btn-outline:hover { 
    background: #f8fafc; 
    border-color: var(--accent); 
    color: var(--accent);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

/* --- FORMS --- */
.form-group { margin-bottom: 1.5rem; }
.form-group label { 
    display: block; 
    margin-bottom: 0.6rem; 
    font-weight: 700; 
    font-size: 0.85rem; 
    color: var(--txt-soft);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

input, select, textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--txt-main);
  transition: var(--transition);
  background: #fcfdfe;
}

input:focus, select:focus, textarea:focus { 
    outline: none; 
    border-color: var(--accent); 
    background: white;
    box-shadow: 0 0 0 5px var(--accent-glow); 
}

/* --- FOOTER --- */
.main-footer {
  padding: 2rem 2.5rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--txt-muted);
  background: white;
  font-weight: 500;
}

.main-footer a { color: var(--accent); text-decoration: none; font-weight: 700; }
.main-footer a:hover { text-decoration: underline; }

/* --- AUTH / LOGIN SPECIAL --- */
.auth-container {
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    background: var(--primary);
}

.login-side {
    background: white;
    box-shadow: 20px 0 50px rgba(0,0,0,0.05);
    z-index: 10;
}

.schedule-side {
    background: var(--primary) !important;
    position: relative;
}

.schedule-side::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* --- BADGES --- */
.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-info { background: var(--info-light); color: var(--info); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }

/* --- ANIMATIONS --- */
@keyframes fadeInUp { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}
.fade-in { animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .sidebar { 
      transform: translateX(-100%); 
      box-shadow: 20px 0 50px rgba(0,0,0,0.15);
  }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .top-header { padding: 0 1.5rem; }
  .content-wrapper { padding: 1.5rem; }
}

@media (max-width: 768px) {
  .grid-cols-4 { grid-template-columns: 1fr; }
  .grid-stack.grid-cols-2 { grid-template-columns: 1fr; }
  .top-header .page-title { font-size: 1.1rem; }
  .login-container { flex-direction: column; }
  .schedule-side { display: none; }
}

/* --- DASHBOARD SPECIAL --- */
.grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.grid-stack.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #f1f5f9;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon-bg {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--txt-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--txt-soft);
    font-weight: 500;
}

.card-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--accent);
}

.shadow-premium {
    box-shadow: 0 10px 30px rgba(0,0,0,0.04), 0 20px 60px rgba(0,0,0,0.02) !important;
}

.skeleton {
    background: linear-gradient(90deg, #f8fafc 25%, #f1f5f9 50%, #f8fafc 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

