/* =========================================
   Dr. Aman Admin Panel - PreClinic Theme
   ========================================= */

:root {
  --primary: #1565c0;
  --primary-dark: #003c8f;
  --primary-light: #5e92f3;
  --teal: #00897b;
  --teal-dark: #005b4f;
  --orange: #ef6c00;
  --red: #c62828;
  --sidebar-bg: #1a2035;
  --sidebar-hover: #283045;
  --sidebar-active: #1565c0;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --text-muted-custom: #90a4ae;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f2f5;
  color: #37474f;
  font-size: 14px;
}

/* ===== LAYOUT ===== */
.wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: all 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: #283045 transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #283045; }

.sidebar-brand {
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: var(--topbar-height);
  background: rgba(0,0,0,0.15);
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none !important;
  overflow: hidden;
  max-width: 200px;
}

.sidebar-logo {
  height: 44px;
  max-width: 190px;
  object-fit: contain;
  filter: brightness(1.05) drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

/* ── Sidebar User Panel ── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 12px 12px 4px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(21,101,192,0.4);
  letter-spacing: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-user-role {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #90a4ae;
  margin-top: 2px;
  text-transform: capitalize;
}

.sidebar-role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf50;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(76,175,80,0.25);
}

.sidebar-menu {
  list-style: none;
  padding: 10px 0;
  margin: 0;
  flex: 1;
}

.sidebar-menu .menu-label {
  padding: 14px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted-custom);
  font-weight: 600;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: #b0bec5;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 13.5px;
  border-left: 3px solid transparent;
}

.sidebar-menu li a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.sidebar-menu li a:hover {
  color: #fff;
  background: var(--sidebar-hover);
  border-left-color: var(--primary-light);
}

.sidebar-menu li.active > a {
  color: #fff;
  background: var(--sidebar-active);
  border-left-color: #fff;
  font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* ===== TOP NAVBAR ===== */
.top-navbar {
  height: var(--topbar-height);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 24px;
  box-shadow: 0 1px 0 #e8edf2, 0 2px 8px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: #546e7a;
  font-size: 17px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: #f0f4f8; color: var(--primary); }

.navbar-page-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-title {
  font-weight: 700;
  font-size: 15px;
  color: #1a2035;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-date {
  font-size: 11px;
  color: #90a4ae;
  font-weight: 400;
  line-height: 1;
  margin-top: 2px;
}

/* Navbar icon buttons */
.navbar-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #607d8b;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.navbar-icon-btn:hover { background: #f0f4f8; color: var(--primary); text-decoration: none; }

.navbar-divider {
  width: 1px;
  height: 28px;
  background: #e0e7ef;
  margin: 0 8px;
}

/* Navbar user button */
.navbar-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}
.navbar-user-btn:hover { background: #f0f4f8; }
.navbar-user-btn::after { display: none; }

.navbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(21,101,192,0.3);
}
.navbar-avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.navbar-user-text { line-height: 1; }
.navbar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a2035;
}
.navbar-user-role {
  font-size: 10.5px;
  color: #90a4ae;
  margin-top: 2px;
  text-transform: capitalize;
}

.navbar-chevron {
  font-size: 10px;
  color: #90a4ae;
  margin-left: 2px;
}

/* Navbar dropdown menu */
.navbar-dropdown-menu {
  min-width: 220px;
  border: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 6px;
}

.navbar-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
}

.font-weight-600 { font-weight: 600; font-size: 13px; color: #1a2035; }

/* ===== CONTENT AREA ===== */
.content-area {
  padding: 28px 24px;
  flex: 1;
}

/* ===== FOOTER ===== */
.admin-footer {
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 14px 24px;
  font-size: 13px;
  color: #90a4ae;
  text-align: center;
}

/* ===== CARDS ===== */
.admin-card {
  border: none;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}

.admin-card .card-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  border-radius: 10px 10px 0 0 !important;
  padding: 14px 20px;
}

/* ===== STAT CARDS ===== */
.stat-card {
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.stat-blue  { background: linear-gradient(135deg, #1565c0, #5e92f3); }
.stat-teal  { background: linear-gradient(135deg, #00695c, #00bfa5); }
.stat-orange{ background: linear-gradient(135deg, #e65100, #ffb74d); }
.stat-red   { background: linear-gradient(135deg, #b71c1c, #ef5350); }

.stat-icon { font-size: 36px; opacity: 0.85; }
.stat-number { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 13px; opacity: 0.9; margin-top: 4px; }

/* ===== CONTACT ITEMS ===== */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
}
.contact-item:hover { background: #fafafa; }
.contact-item.unread { background: #e3f2fd; }
.contact-avatar { color: #90a4ae; font-size: 28px; margin-top: 2px; }
.contact-name { font-weight: 600; font-size: 13px; }

/* ===== QUICK ACTIONS ===== */
.quick-action-btn {
  padding: 16px 8px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}
.quick-action-btn i { font-size: 24px; }

/* ===== TABLE ===== */
.table th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.thumb-img { width: 50px; height: 40px; object-fit: cover; border-radius: 6px; }

/* ===== GALLERY ===== */
.gallery-card { overflow: hidden; }
.gallery-img-wrap { position: relative; overflow: hidden; }
.gallery-thumb { width: 100%; height: 160px; object-fit: cover; transition: transform 0.3s; }
.gallery-img-wrap:hover .gallery-thumb { transform: scale(1.05); }
.gallery-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.gallery-img-wrap:hover .gallery-overlay { opacity: 1; }

/* ===== DOCTOR CARDS ===== */
.doctor-photo { width: 110px; height: 110px; object-fit: cover; border: 4px solid #e3f2fd; }
.doctor-photo-placeholder {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: #e3f2fd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.doctor-photo-wrap { display: flex; justify-content: center; }
.doctor-upload-area {
  width: 160px; height: 160px;
  border: 2px dashed #bdbdbd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  margin: 0 auto;
  transition: border-color 0.2s;
  overflow: hidden;
}
.doctor-upload-area:hover { border-color: var(--primary); }

/* ===== USER AVATAR ===== */
.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* ===== STATUS SELECT ===== */
.status-select {
  min-width: 110px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

/* ===== PERMISSIONS ===== */
.permission-module-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #546e7a;
  padding-bottom: 4px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 6px;
}

/* ===== LOGIN PAGE ===== */
.login-body {
  background: linear-gradient(135deg, #1a2035 0%, #1565c0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-icon {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, #1565c0, #5e92f3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  color: #fff;
}

.login-logo h2 { color: #1a2035; font-weight: 700; margin-bottom: 4px; }

.login-btn {
  background: linear-gradient(135deg, #1565c0, #5e92f3) !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
}

.login-btn:hover { opacity: 0.92; }

/* ===== BUTTONS ===== */
.btn-outline-teal {
  color: var(--teal);
  border-color: var(--teal);
}
.btn-outline-teal:hover {
  color: #fff;
  background: var(--teal);
}

/* ===== BADGE OVERRIDES ===== */
.badge { font-size: 11px; padding: 4px 8px; border-radius: 20px; }

/* ===== FORM CONTROLS ===== */
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(21,101,192,0.15);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .content-area {
    padding: 16px;
  }
  .stat-card { padding: 16px; }
  .stat-number { font-size: 24px; }
}

/* ===== SIDEBAR COLLAPSED ===== */
body.sidebar-collapsed .sidebar {
  width: 68px;
}
body.sidebar-collapsed .sidebar .sidebar-user { display: none; }
body.sidebar-collapsed .sidebar .menu-label,
body.sidebar-collapsed .sidebar li a span {
  display: none;
}
body.sidebar-collapsed .sidebar li a {
  justify-content: center;
  padding: 14px;
}
body.sidebar-collapsed .sidebar li a i {
  width: auto;
  font-size: 18px;
  margin: 0;
}
body.sidebar-collapsed .main-content {
  margin-left: 68px;
}

/* ===== DATATABLE OVERRIDES ===== */
.dataTables_wrapper .dataTables_filter input {
  border-radius: 20px;
  padding: 4px 14px;
  border: 1px solid #dee2e6;
}
.dataTables_wrapper .dataTables_length select {
  border-radius: 6px;
  padding: 4px 8px;
}

/* ===== NAV PILLS ===== */
.nav-pills .nav-link.active {
  background: var(--primary);
}
.nav-pills .nav-link {
  color: #546e7a;
}
