/* GTC QB Admin Dashboard Theme */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-header: #1e293b;
  --header-text: #ffffff;
  --bg-app: #f4f6f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-blue: #0284c7;
  --accent-blue-hover: #0369a1;
  --danger-red: #ef4444;
  --danger-red-hover: #dc2626;
  --success-green: #10b981;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.admin-header {
  background-color: var(--bg-header);
  color: var(--header-text);
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 11px;
  color: #94a3b8;
  font-family: monospace;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Main Layout */
.admin-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

/* Login Pane */
.login-pane {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
  padding: 34px 28px;
  text-align: center;
}

.login-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.login-card-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.login-card-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* Forms */
.form-group {
  text-align: left;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.form-error {
  color: var(--danger-red);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  margin-bottom: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--accent-blue-hover);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: #334155;
}
.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: var(--border-hover);
}

.btn-danger-outline {
  background-color: #ffffff;
  border-color: #fecaca;
  color: var(--danger-red);
}
.btn-danger-outline:hover {
  background-color: #fef2f2;
  border-color: var(--danger-red);
}

.btn-warning-outline {
  background-color: #ffffff;
  border-color: #fed7aa;
  color: #c2410c;
}
.btn-warning-outline:hover {
  background-color: #fff7ed;
  border-color: #ea580c;
}

.btn-block {
  width: 100%;
  padding: 11px;
}

.btn-sm {
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 7px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

/* Toolbar */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  font-size: 13.5px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  outline: none;
  transition: all 0.15s ease;
}

.search-box input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

/* Table Card */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow-x: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

.table-card::-webkit-scrollbar {
  height: 6px;
}
.table-card::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.doctors-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  text-align: left;
}

.doctors-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.doctors-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

.doctors-table tr:hover td {
  background-color: #fafbfd;
}

.doctor-name-cell {
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.doctor-email-sub {
  color: #64748b;
  font-family: monospace;
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-blue {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-green {
  background-color: #ecfdf5;
  color: #047857;
}

.badge-gray {
  background-color: #f1f5f9;
  color: #64748b;
}

.badge-red {
  background-color: #fef2f2;
  color: #dc2626;
}

.badge-amber {
  background-color: #fffbeb;
  color: #b45309;
}

.device-sub {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
}

.actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.table-empty {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  padding: 24px;
  animation: fadeIn 0.15s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text-main);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .actions-cell {
    flex-direction: column;
    align-items: flex-end;
  }
}
