:root {
  --navy-950: #071c2b;
  --navy-900: #0b2b40;
  --navy-800: #123a51;
  --teal-600: #119980;
  --teal-500: #24b59a;
  --teal-100: #dff7f1;
  --blue-50: #f3f8fb;
  --slate-700: #334155;
  --slate-500: #64748b;
  --border: #dbe6ec;
  --white: #fff;
  --shadow: 0 18px 50px rgba(11, 43, 64, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--navy-950);
  background:
    radial-gradient(circle at 85% 4%, rgba(36, 181, 154, 0.12), transparent 24rem),
    linear-gradient(180deg, #f7fbfd 0%, #eef5f8 100%);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}

.app-navbar {
  min-height: 82px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(219, 230, 236, 0.9);
  box-shadow: 0 7px 25px rgba(11, 43, 64, 0.05);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-brand { color: var(--navy-900); margin: 0; }
.navbar-brand:hover { color: var(--navy-900); }
.navbar-brand strong { display: block; font-size: 1.08rem; }
.navbar-brand small { display: block; color: var(--slate-500); font-size: 0.76rem; font-weight: 500; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: #fff url("assets/shifa-group-logo.jpg") center 31% / 240% auto no-repeat;
  border: 1px solid #d9ebe6;
  border-radius: 13px;
  box-shadow: 0 9px 22px rgba(17, 153, 128, 0.24);
}

.nav-switch { display: flex; gap: 0.4rem; padding: 0.35rem; background: var(--blue-50); border: 1px solid var(--border); border-radius: 14px; }
.nav-switch-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.58rem 0.9rem; color: var(--slate-700); border-radius: 10px; text-decoration: none; font-size: 0.9rem; font-weight: 700; transition: 0.18s ease; }
.nav-switch-link:hover { color: var(--navy-900); background: rgba(255,255,255,.7); }
.nav-switch-link.active { color: #fff; background: var(--navy-900); box-shadow: 0 6px 14px rgba(11, 43, 64, 0.16); }

.brand-hero {
  position: relative;
  aspect-ratio: 2.4 / 1;
  margin: 0 0 1.5rem;
  overflow: hidden;
  background: #edf8f5;
  border: 1px solid #d7e8e3;
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(7, 72, 55, 0.12);
}
.brand-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.surface-card { min-width: 0; background: rgba(255,255,255,.96); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.form-surface { padding: clamp(1.25rem, 3vw, 2rem); }
.surface-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1.4rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.surface-heading h1, .dashboard-heading h1, .login-card h1 { margin: 0.25rem 0 0.3rem; color: var(--navy-900); font-size: clamp(1.55rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; }
.surface-heading p, .dashboard-heading p, .login-card p { margin: 0; color: var(--slate-500); }
.eyebrow { display: inline-block; color: var(--teal-600); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; }
.secure-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.42rem 0.68rem; color: #08705f; background: var(--teal-100); border: 1px solid #bceadd; border-radius: 999px; font-size: 0.78rem; font-weight: 800; }

.section-label { display: flex; align-items: center; gap: 0.65rem; margin: 0 0 0.9rem; color: var(--navy-900); font-weight: 800; }
.section-label span { display: grid; place-items: center; width: 30px; height: 30px; color: var(--teal-600); background: var(--teal-100); border-radius: 9px; font-size: 0.76rem; }
.section-label .section-requirement { margin-inline-start: 0.15rem; color: #a33b12; font-size: 0.8rem; font-weight: 800; }
.form-label { color: var(--slate-700); font-size: 0.88rem; font-weight: 700; }
.form-control, .form-select { min-height: 46px; border-color: var(--border); border-radius: 12px; color: var(--navy-950); background-color: #fbfdfe; }
.form-control:focus, .form-select:focus { border-color: var(--teal-500); box-shadow: 0 0 0 .22rem rgba(36,181,154,.14); background-color: #fff; }
.input-with-icon { position: relative; }
.input-with-icon > i { position: absolute; right: 14px; top: 50%; z-index: 2; color: var(--slate-500); transform: translateY(-50%); }
.input-with-icon .form-control { padding-right: 2.55rem; }
.photo-upload-row { display: flex; align-items: center; gap: 0.85rem; }
.photo-upload-row .form-control { flex: 1 1 auto; }
.photo-preview { flex: 0 0 72px; width: 72px; height: 72px; object-fit: cover; border: 2px solid #d7e8e3; border-radius: 14px; background: #f3f8fb; box-shadow: 0 7px 18px rgba(11,43,64,.1); }
.doctor-photo { display: block; width: 54px; height: 54px; object-fit: cover; border: 2px solid #d7e8e3; border-radius: 13px; background: #f3f8fb; }

.appointment-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: #fff; }
.appointment-card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; background: linear-gradient(90deg, #f7fbfc, #fff); border-bottom: 1px solid var(--border); }
.appointment-card-header h2 { margin: 0; color: var(--navy-900); font-size: 1rem; font-weight: 800; }
.appointment-card-header p { margin: 0.12rem 0 0; color: var(--slate-500); font-size: 0.78rem; }
.appointment-card-header .btn { color: var(--slate-500); font-size: 0.78rem; text-decoration: none; }
.appointment-scroll { width: 100%; max-width: 100%; overflow-x: auto; scrollbar-color: #b8ccd6 transparent; }
.appointment-grid { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; text-align: center; }
.appointment-grid th { padding: 0.78rem 0.45rem; color: var(--slate-700); background: #fbfdfe; border-bottom: 1px solid var(--border); font-size: 0.82rem; font-weight: 800; }
.appointment-grid th:first-child { min-width: 116px; position: sticky; right: 0; z-index: 4; background: #f7fbfc; }
.appointment-grid td { padding: 0.48rem; border-bottom: 1px solid #edf3f6; border-left: 1px solid #edf3f6; }
.appointment-grid tr:last-child td { border-bottom: 0; }
.appointment-grid .time-cell { position: sticky; right: 0; z-index: 3; color: var(--navy-900); background: #f7fbfc; border-left: 1px solid var(--border); font-size: 0.8rem; font-weight: 800; white-space: nowrap; }
.slot-radio {
  appearance: none;
  display: block;
  width: 38px;
  height: 38px;
  margin: auto;
  border: 1.5px solid #b6c8d1;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  transition: 0.16s ease;
}
.slot-radio:hover { border-color: var(--teal-500); background-color: #f3fffc; transform: translateY(-1px); }
.slot-radio:focus-visible { outline: 3px solid rgba(36,181,154,.24); outline-offset: 2px; }
.slot-radio:checked { border-color: var(--teal-600); background: radial-gradient(circle, #fff 0 5px, transparent 6px), var(--teal-600); box-shadow: 0 6px 14px rgba(17,153,128,.22); }
.appointment-error { padding: 0 1rem 0.75rem; color: #b42318; font-size: 0.82rem; font-weight: 700; }
.table-actions { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.table-actions .btn { padding: 0.36rem 0.55rem; font-size: 0.76rem; }

.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.btn { border-radius: 11px; font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--navy-900); --bs-btn-border-color: var(--navy-900); --bs-btn-hover-bg: #123c55; --bs-btn-hover-border-color: #123c55; --bs-btn-active-bg: var(--navy-950); }
.btn-success { --bs-btn-bg: var(--teal-600); --bs-btn-border-color: var(--teal-600); --bs-btn-hover-bg: #0d816d; --bs-btn-hover-border-color: #0d816d; }
.btn-light { --bs-btn-bg: #f1f6f8; --bs-btn-border-color: #e0eaee; --bs-btn-hover-bg: #e7f0f3; }
.save-note { color: var(--slate-500); font-size: 0.76rem; }

.side-panel { top: 106px; padding: 1.5rem; color: #fff; background: linear-gradient(155deg, var(--navy-900), #0e4057 68%, #116451); border-radius: 22px; box-shadow: 0 22px 55px rgba(7,28,43,.2); overflow: hidden; }
.side-panel::before { content: ""; position: absolute; width: 190px; height: 190px; left: -80px; top: -80px; border: 38px solid rgba(255,255,255,.035); border-radius: 50%; }
.side-panel-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 1rem; color: #fff; background: rgba(36,181,154,.85); border-radius: 14px; font-size: 1.25rem; }
.side-panel h2 { font-size: 1.35rem; font-weight: 800; }
.steps-list { list-style: none; padding: 0; margin: 1.4rem 0; }
.steps-list li { display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.steps-list li:last-child { border-bottom: 0; }
.steps-list li > span { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; color: #8be3d2; border: 1px solid rgba(139,227,210,.45); border-radius: 9px; font-size: 0.8rem; font-weight: 800; }
.steps-list strong, .steps-list small { display: block; }
.steps-list small { color: rgba(255,255,255,.66); font-size: 0.78rem; }
.contact-strip { display: flex; gap: 0.65rem; padding: 0.9rem; color: rgba(255,255,255,.82); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 13px; font-size: 0.78rem; }

.login-wrap { min-height: calc(100vh - 170px); display: grid; place-items: center; }
.login-card { width: min(100%, 460px); padding: 2rem; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 28px 70px rgba(7,28,43,.14); }
.admin-brand-logo {
  width: 190px;
  height: 92px;
  margin: -0.35rem auto 0.35rem;
  background: #fff url("assets/shifa-group-logo.jpg") center 42% / 160% auto no-repeat;
  border-radius: 14px;
}
.login-card .form-label { display: block; text-align: right; }
.login-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1rem; color: #fff; background: linear-gradient(145deg, var(--navy-900), var(--teal-600)); border-radius: 18px; font-size: 1.6rem; box-shadow: 0 12px 26px rgba(11,43,64,.2); }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-left: 3rem; }
.icon-button { position: absolute; left: 8px; top: 50%; display: grid; place-items: center; width: 36px; height: 36px; color: var(--slate-500); background: transparent; border: 0; border-radius: 9px; transform: translateY(-50%); }
.demo-credentials { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1rem; color: var(--slate-500); border-top: 1px solid var(--border); font-size: 0.76rem; }
.demo-credentials code { padding: 0.18rem 0.42rem; color: var(--navy-900); background: #edf4f7; border-radius: 6px; direction: ltr; }

.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.demo-banner { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1rem; padding: 0.8rem 1rem; color: #6e4b07; background: #fff8e8; border: 1px solid #f2ddb0; border-radius: 13px; font-size: 0.84rem; }
.metric-card { height: 100%; padding: 1.15rem; background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 10px 28px rgba(11,43,64,.055); }
.metric-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--slate-500); font-size: 0.8rem; font-weight: 700; }
.metric-icon { display: grid; place-items: center; width: 36px; height: 36px; color: var(--teal-600); background: var(--teal-100); border-radius: 10px; font-size: 1rem; }
.metric-value { margin-top: 0.55rem; color: var(--navy-900); font-size: 1.55rem; font-weight: 900; }
.metric-foot { color: var(--slate-500); font-size: 0.72rem; }
.filters-card { padding: 1.25rem; box-shadow: 0 12px 34px rgba(11,43,64,.06); }
.filters-title { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 1rem; color: var(--navy-900); }
.filters-title span { margin-right: auto; color: var(--slate-500); font-size: 0.78rem; }
.table-card { overflow: hidden; }
.table-card table { min-width: 1060px; }
.table-card thead th { padding: 0.95rem 1rem; color: #426070; background: #f5f9fb; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 0.78rem; font-weight: 800; }
.table-card tbody td { padding: 0.95rem 1rem; color: var(--slate-700); border-color: #edf3f6; font-size: 0.84rem; vertical-align: middle; }
.doctor-cell strong, .doctor-cell small { display: block; }
.doctor-cell strong { color: var(--navy-900); }
.doctor-cell small { color: var(--slate-500); }
.specialty-badge { display: inline-flex; padding: 0.28rem 0.55rem; color: #28546b; background: #e9f3f7; border-radius: 8px; font-size: 0.75rem; font-weight: 700; }
.appointment-chip { display: inline-flex; gap: 0.35rem; align-items: center; color: var(--navy-900); white-space: nowrap; }
.appointment-chip i { color: var(--teal-600); }
.empty-state { padding: 4rem 1rem; text-align: center; color: var(--slate-500); }
.empty-state i { display: block; margin-bottom: 0.75rem; color: #aac0ca; font-size: 2.5rem; }
.empty-state h3 { color: var(--navy-900); font-size: 1.1rem; font-weight: 800; }
.specialty-modal-content { border: 0; border-radius: 20px; box-shadow: 0 28px 80px rgba(7,28,43,.22); }
.specialty-modal-content .modal-header { align-items: flex-start; padding: 1.2rem 1.25rem; border-color: var(--border); }
.specialty-modal-content .modal-body { padding: 1.25rem; }
.specialty-list-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.65rem; color: var(--slate-500); font-size: 0.78rem; font-weight: 800; }
.specialty-list { display: flex; flex-wrap: wrap; gap: 0.45rem; max-height: 230px; overflow-y: auto; padding: 0.2rem; }
.specialty-list span { display: inline-flex; padding: 0.38rem 0.62rem; color: #28546b; background: #edf5f8; border: 1px solid #dae8ed; border-radius: 9px; font-size: 0.76rem; font-weight: 700; }
.toast { color: #fff; background: var(--navy-900); box-shadow: 0 12px 30px rgba(7,28,43,.22); }
.toast .bi { color: #70dcc7; }

@media (max-width: 767.98px) {
  body { font-size: 0.94rem; }
  .app-navbar { min-height: auto; padding: 0.7rem 0; }
  .app-navbar .container-xl { flex-wrap: wrap; }
  .navbar-brand { max-width: 100%; }
  .navbar-brand strong { font-size: 0.98rem; }
  .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
  main.container-xl { padding: 1rem 0.75rem !important; }
  .nav-switch { width: 100%; }
  .nav-switch-link { flex: 1; justify-content: center; }
  .surface-heading, .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .surface-heading { padding-bottom: 1rem; margin-bottom: 1.15rem; }
  .surface-heading h1, .dashboard-heading h1, .login-card h1 { font-size: 1.45rem; }
  .section-label { align-items: flex-start; flex-wrap: wrap; gap: 0.5rem; }
  .section-label .section-requirement { flex: 1 1 100%; margin-inline-start: 0; padding-inline-start: 2.55rem; line-height: 1.5; }
  .secure-badge { align-self: flex-start; }
  .form-actions .btn { width: 100%; }
  .save-note { width: 100%; }
  .brand-hero { aspect-ratio: 16 / 9; margin-bottom: 1rem; border-radius: 17px; }
  .brand-hero img { object-position: center; }
  .form-surface { padding: 1rem; border-radius: 17px; }
  .appointment-card { border-radius: 14px; }
  .appointment-card-header { align-items: flex-start; flex-direction: column; gap: 0.35rem; padding: 0.85rem; }
  .appointment-card-header .btn { align-self: flex-end; margin-top: -0.2rem; }
  .appointment-grid { min-width: 640px; }
  .appointment-grid th:first-child { min-width: 102px; }
  .slot-radio { width: 34px; height: 34px; border-radius: 10px; }
  .side-panel { padding: 1.15rem; border-radius: 17px; }
  .dashboard-heading .d-flex { display: grid !important; grid-template-columns: 1fr 1fr; width: 100%; }
  .dashboard-heading .d-flex .btn { width: 100%; }
  .filters-card { padding: 1rem; border-radius: 17px; }
  .table-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .table-card .table-responsive { overflow: visible; }
  .table-card table, .table-card tbody, .table-card tr, .table-card td { display: block; width: 100%; min-width: 0; }
  .table-card thead { display: none; }
  .table-card tbody { display: grid; gap: 0.85rem; }
  .table-card tbody tr { overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 9px 25px rgba(11,43,64,.06); }
  .table-card tbody td { display: grid; grid-template-columns: minmax(105px, 38%) 1fr; align-items: center; gap: 0.75rem; padding: 0.72rem 0.85rem; text-align: right; border-bottom: 1px solid #edf3f6; }
  .table-card tbody td:last-child { border-bottom: 0; }
  .table-card tbody td::before { content: attr(data-label); color: var(--slate-500); font-size: 0.75rem; font-weight: 800; }
  .table-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .table-actions .btn { width: 100%; }
  .login-wrap { min-height: calc(100vh - 120px); }
  .login-card { padding: 1.25rem; border-radius: 18px; }
  .admin-brand-logo { width: 160px; height: 78px; }
  .modal-dialog { margin: 0.65rem; }
  .specialty-modal-content { border-radius: 17px; }
  .specialty-modal-content .modal-header, .specialty-modal-content .modal-body { padding: 1rem; }
  .photo-upload-row { align-items: stretch; flex-direction: column; }
  .photo-preview { align-self: flex-start; }
}

@media (max-width: 420px) {
  .navbar-brand small { display: none; }
  .nav-switch-link { padding-inline: .55rem; font-size: .82rem; }
  .dashboard-heading .d-flex { grid-template-columns: 1fr; }
  #summary-cards > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .table-card tbody td { grid-template-columns: 96px 1fr; }
}

@media print {
  .app-navbar, .filters-card, .dashboard-heading .d-flex, .demo-banner { display: none !important; }
  body { background: #fff; }
  .surface-card { box-shadow: none; }
}
