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

:root {
  --primary: #007bff;
  --secondary: #6c757d;
  --accent: #e74c3c;
  --bg-color: #f4f7f6;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --text-dark: #2d3748;
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --sidebar-width: 260px;
}

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

html, body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  padding: 1.5rem 0.8rem;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar .nav-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.4);
    margin: 1.5rem 0 0.5rem 1rem;
    font-weight: 700;
}

body.sidebar-collapsed .nav-label {
    display: none;
}

.sidebar-header {
    padding: 0 0.5rem 1.5rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin: 0;
    border: none;
    padding: 0;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}
.sidebar nav::-webkit-scrollbar { display: none; } /* Hide scrollbar Chrome */

.sidebar nav a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  margin: 0 4px;
}

.sidebar nav a i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar nav a:hover i {
    transform: scale(1.1);
}

.sidebar nav a.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-weight: 600;
  position: relative;
}

.sidebar nav a.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: #3b82f6;
    border-radius: 3px 0 0 3px;
    box-shadow: -2px 0 8px rgba(59, 130, 246, 0.5);
}

.sidebar nav a.active i {
    color: #60a5fa;
}

/* ===== MAIN CONTENT AREA ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem 2.5rem;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* Sidebar Toggle Floating Button */
.sidebar-toggle-btn {
  position: absolute;
  top: 35px;
  right: -14px;
  width: 28px;
  height: 28px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, background 0.2s;
}
.sidebar-toggle-btn:hover { background: #f7fafc; }
.sidebar-toggle-btn i { font-size: 0.85rem; color: #4a5568; transition: transform 0.3s ease; }

/* ===== COLLAPSED SIDEBAR RULES ===== */
body.sidebar-collapsed .sidebar { width: 85px; min-width: 85px; padding: 1.5rem 0.5rem; }
body.sidebar-collapsed .sidebar-header h2 span { display: none; }
body.sidebar-collapsed .sidebar-header h2 img { margin: 0; width: 40px; height: 40px; }
body.sidebar-collapsed .sidebar nav a span { display: none; }
body.sidebar-collapsed .sidebar nav a { justify-content: center; padding: 12px; margin: 0 4px 4px 4px; }
body.sidebar-collapsed .sidebar nav a i { margin: 0; font-size: 1.3rem; }
body.sidebar-collapsed .sidebar nav a.active::after { display: none; }
body.sidebar-collapsed .user-info-text, body.sidebar-collapsed .logout-text { display: none; }
body.sidebar-collapsed .user-block { justify-content: center; margin-bottom: 20px; }
body.sidebar-collapsed .logout-btn { justify-content: center; padding: 12px 0; width: 45px; margin: 0 auto; }
body.sidebar-collapsed .sidebar-toggle-btn i { transform: rotate(180deg); transition: transform 0.3s ease; }
body.sidebar-collapsed .main-content { margin-left: 85px; }

/* ===== HEADER ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.2rem 2rem;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c;
}

.doctor-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doctor-profile img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 123, 255, 0.3);
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  position: relative;
  background: white;
  padding: 1.5rem 1.5rem 1.5rem 1.8rem;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  border-left: 5px solid var(--primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 0 0 0 80px;
  opacity: 0.06;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.stat-card h3 {
  font-size: 2rem;
  margin-top: 0.4rem;
  font-weight: 700;
  color: #1a202c;
}

.stat-card p {
  color: var(--secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-card .stat-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  opacity: 0.08;
}

/* ===== CALENDAR ===== */
.calendar-container {
  background: white;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
}

.calendar-container h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a202c;
}

/* ===== TABLES ===== */
.table-container {
  background: white;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  margin-top: 1.5rem;
  overflow-x: auto;
}

.table-container h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #1a202c;
}

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

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

tbody tr:hover {
  background: #f8fafc;
}

/* ===== BADGES ===== */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #c6f6d5; color: #276749; }
.badge-warning { background: #fefcbf; color: #975a16; }
.badge-danger  { background: #fed7d7; color: #9b2c2c; }

/* ===== BUTTONS ===== */
.btn-action {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-action:hover { opacity: 0.85; }

.btn-create {
  background: #1a202c;
  padding: 10px 22px;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: all 0.25s;
}

.btn-create:hover {
  background: #2d3748;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn-save {
  background: var(--primary);
  color: #fff;
  padding: 12px 25px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-save:hover { opacity: 0.9; transform: translateY(-1px); }

.search-bar {
  width: 300px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.search-bar:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* ===== STATUS DOT ===== */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.origin-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f7fafc;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== CHATBOT FLOATING BUTTON ===== */
.chatbot-bubble {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: var(--primary);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  font-size: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.chatbot-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0, 123, 255, 0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 70px;
    min-width: 70px;
    padding: 1rem 0.5rem;
  }
  .sidebar h2 { font-size: 0; }
  .sidebar h2::after { content: '🏥'; font-size: 1.5rem; }
  .sidebar nav a span { display: none; }
  .main-content { margin-left: 70px; padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
