/* ============================================================
   PREMIUM LAYER v2.0 — Sultan's Medical Clinic (clinic.gensqq.cfd)
   Additive: loaded AFTER style.css. Identity: emerald #10b981
   + sky #0ea5e9 on #0f1419. "Clinical Glass" craft layer.
   ============================================================ */

/* --- safety: CSS display rules must never beat [hidden] --- */
[hidden] { display: none !important; }

:root {
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --sheen: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0) 42%);
}

/* ================= SCROLLBAR + AUTOFILL ================= */
* { scrollbar-width: thin; scrollbar-color: rgba(52, 211, 153, 0.35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(52, 211, 153, 0.3);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(52, 211, 153, 0.55); }

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary, #f1f5f9) !important;
  -webkit-background-clip: text !important;
  caret-color: var(--text-primary, #f1f5f9);
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: inset 0 0 0 1000px rgba(26, 35, 50, 0.95) !important;
  border-color: rgba(52, 211, 153, 0.5) !important;
}

/* ================= BUTTONS ================= */
.btn, button[type="submit"], .login-form .btn {
  position: relative;
  min-height: 44px;
  border-radius: var(--r-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheen);
  pointer-events: none;
  border-radius: inherit;
}
.btn:hover, button[type="submit"]:hover { transform: translateY(-1.5px); }
.btn:active, button[type="submit"]:active { transform: translateY(0) scale(0.985); }

.btn-primary, .login-form .btn, .btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 55%, #047857 100%) !important;
  border: 1px solid rgba(52, 211, 153, 0.45) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.32), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover, .login-form .btn:hover, .btn-success:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 55%, #059669 100%) !important;
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn-danger:hover { box-shadow: 0 8px 22px rgba(239, 68, 68, 0.28); transform: translateY(-1.5px); }
.btn-sm, .header-btn { min-height: 38px; }
.modal .btn, .modal-actions .btn { min-height: 42px; }

/* ================= CARDS + STATS ================= */
.card, .card.glass {
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.28s ease, border-color 0.28s ease;
  max-width: 100%;
}
.card:hover, .card.glass:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34), 0 0 32px rgba(16, 185, 129, 0.1);
}

/* decorative orbs must never create page scroll */
html, body { overflow-x: clip; }

/* dashboard grid: inline 1fr 1fr beats media queries — override with !important */
.dashboard-grid { grid-template-columns: 1fr 1fr !important; gap: 20px; }
.chart-card, .card canvas { max-width: 100%; }

.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, #10b981 0%, #0ea5e9 55%, #34d399 100%);
  opacity: 0.75;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #A7F3D0 60%, #6EE7B7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card .stat-icon {
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

/* ================= TABLES ================= */
.table-container {
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: auto;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.data-table tbody td {
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr { transition: background 0.16s ease, box-shadow 0.16s ease; }
.data-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.1);
  box-shadow: inset 3px 0 0 var(--color-primary, #10b981);
}

/* ================= HEADER / TOPBAR ================= */
.header {
  background: rgba(13, 17, 23, 0.8) !important;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.header-page-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #fff 0%, #A7F3D0 55%, #6EE7B7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================= SIDEBAR ACTIVE ================= */
.nav-item.active, .sidebar-nav .active, [class*="nav"][class*="active"] {
  background: linear-gradient(135deg, rgba(16,185,129,0.22), rgba(16,185,129,0.08)) !important;
  border: 1px solid rgba(52,211,153,0.35);
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.16);
}

/* ================= LOGIN / PORTAL ================= */
.login-card, .portal-card, .login-container .card {
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(26, 35, 50, 0.85) 0%, rgba(20, 27, 38, 0.92) 100%);
  border: 1px solid rgba(52, 211, 153, 0.22);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04),
              0 0 80px rgba(16, 185, 129, 0.1);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  animation: loginIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.login-title, .login-header h1 {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(120deg, #fff 0%, #A7F3D0 55%, #6EE7B7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-icon, .login-header .icon-box {
  border-radius: var(--r-md) !important;
  box-shadow: 0 14px 36px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255,255,255,0.16);
}

/* Demo button — on-brand emerald (was gold, clashed) */
.demo-btn {
  background: linear-gradient(135deg, rgba(16,185,129,0.16), rgba(14,165,233,0.1)) !important;
  color: #A7F3D0 !important;
  border: 1px solid rgba(52,211,153,0.45) !important;
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.18) !important;
  min-height: 46px;
}
.demo-btn:hover {
  background: linear-gradient(135deg, rgba(16,185,129,0.28), rgba(14,165,233,0.16)) !important;
  box-shadow: 0 16px 40px rgba(16, 185, 129, 0.3) !important;
}
.demo-sep { letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.68rem; font-weight: 700; }

/* ================= MODAL + TOAST ================= */
.modal, .modal-content {
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(16, 185, 129, 0.1);
  animation: modalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.975); }
  to   { opacity: 1; transform: none; }
}
.modal-overlay, .modal-backdrop {
  background: rgba(5, 8, 12, 0.72) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.toast {
  border-radius: var(--r-sm);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: none; }
}

/* ================= FORMS ================= */
input:focus, select:focus, textarea:focus, .form-input:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18), 0 0 22px rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.65) !important;
}

/* ================= MOTION SAFETY ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover, .card.glass:hover, .btn:hover, [class*="nav"]:hover { transform: none; }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 860px) {
  .btn, button[type="submit"] { min-height: 46px; }
  .stat-card .stat-value { font-size: 24px; }
  .dashboard-grid { grid-template-columns: 1fr !important; }
}
