/* MediBook v2 – auth, navigation, appointments, pharmacy, admin */

/* Auth */
body.auth-mode .navbar { display: none; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.auth-brand h1 { font-size: 52px; font-weight: 800; background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; color: transparent; margin: 14px 0 8px; }
.auth-brand p { font-size: 19px; color: var(--muted); line-height: 1.5; max-width: 460px; }
.logo.big { width: 72px; height: 72px; font-size: 46px; }
.auth-points { list-style: none; margin-top: 24px; display: grid; gap: 10px; }
.auth-points li { background: var(--card); box-shadow: var(--shadow); padding: 12px 16px; border-radius: 12px; font-weight: 600; width: fit-content; animation: rise .5s ease both; }
.auth-points li:nth-child(2) { animation-delay: .08s; } .auth-points li:nth-child(3) { animation-delay: .16s; } .auth-points li:nth-child(4) { animation-delay: .24s; }
.auth-card { padding: 28px; max-width: 440px; width: 100%; justify-self: center; }
.auth-card h2 { font-size: 26px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; }
.auth-switch a { color: var(--primary); font-weight: 700; }
.demo { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.demo-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.demo-grid .chip { cursor: pointer; }
.demo-grid .chip:hover { background: var(--primary); color: #fff; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.role-opt input { display: none; }
.role-opt span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 20px; text-align: center; transition: all .2s; }
.role-opt b { font-size: 12px; }
.role-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* Navbar additions */
.nav-links { display: flex; gap: 4px; margin-left: 12px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .2s; border-bottom: 3px solid transparent; }
.nav-link:hover { background: var(--hover); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.badge { position: absolute; top: 2px; right: 4px; background: var(--danger); color: #fff; font-style: normal; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.user-wrap { position: relative; }
button.doc-chip { color: var(--text); }
.uc-text { display: flex; flex-direction: column; text-align: left; line-height: 1.1; }
.uc-text small { color: var(--muted); font-weight: 500; font-size: 11px; }
.user-menu { position: absolute; right: 0; top: 50px; width: 280px; background: var(--card); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.2); padding: 8px; display: none; animation: pop .2s; }
.user-menu.open { display: block; }
.um-head { display: flex; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.um-head .tag { display: inline-block; margin-top: 6px; }
.um-item { width: 100%; text-align: left; background: none; padding: 10px; border-radius: 8px; font-weight: 600; color: var(--text); }
.um-item:hover { background: var(--hover); }

/* Status pills */
.status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; text-transform: capitalize; }
.st-booked { background: var(--primary-soft); color: var(--primary); }
.st-in { background: var(--warn-soft); color: var(--warn); }
.st-consult { background: #f3e8ff; color: #9333ea; }
[data-theme="dark"] .st-consult { background: #2e1065; color: #d8b4fe; }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-cancel { background: var(--hover); color: var(--muted); text-decoration: line-through; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Appointment rows */
.appt-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; transition: background .2s; }
.appt-row:hover { background: var(--hover); }
.appt-time { font-weight: 800; width: 50px; text-align: center; line-height: 1.1; }
.appt-time small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.appt-main { flex: 1; min-width: 0; }
.appt-main b { display: block; font-size: 14px; }
.appt-main .muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-mini { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-left: 3px solid var(--primary); background: var(--hover); border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.appt-mini .status { align-self: flex-start; margin-top: 4px; }
.appt-detail { display: flex; align-items: center; gap: 12px; }

/* Pages */
.page { max-width: 1240px; margin: 20px auto; padding: 0 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-in { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.seg { display: flex; background: var(--hover); border-radius: 8px; padding: 3px; }
.seg button { background: none; padding: 6px 14px; border-radius: 6px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); box-shadow: var(--shadow); border-radius: 12px; padding: 14px 16px; color: var(--muted); font-weight: 600; font-size: 13px; text-align: left; }
.kpi b { display: block; font-size: 26px; color: var(--text); }
.kpi-btn { cursor: pointer; border: 2px solid transparent; transition: transform .15s; }
.kpi-btn:hover { transform: translateY(-2px); }
.kpi-btn.on { border-color: var(--primary); }

/* Calendar */
.cal-wrap { overflow-x: auto; padding: 0; }
.cal-day { display: grid; min-width: 100%; }
.cal-h { position: sticky; top: 0; background: var(--card); z-index: 2; padding: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--line); }
.cal-t { font-size: 12px; color: var(--muted); text-align: right; padding: 0 8px; height: 38px; transform: translateY(-7px); }
.cal-c { height: 38px; border-top: 1px dashed var(--line); border-left: 1px solid var(--line); position: relative; }
.cal-c.free[data-slot] { cursor: pointer; }
.cal-c.free[data-slot]:hover { background: var(--primary-soft); }
.cal-c.free[data-slot]:hover::after { content: '+ Book'; position: absolute; left: 8px; top: 9px; font-size: 12px; font-weight: 700; color: var(--primary); }
.appt-chip { position: relative; z-index: 1; margin: 2px 4px; padding: 5px 8px; border-radius: 8px; font-size: 12px; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; border-left: 4px solid currentColor; transition: transform .15s, box-shadow .15s; min-height: 34px; }
.appt-chip:hover { transform: scale(1.02); box-shadow: var(--shadow); }
.appt-chip span { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); }
.wk-col { border-left: 1px solid var(--line); min-height: 420px; }
.wk-col.today { background: var(--primary-soft); }
.wk-h { padding: 10px; text-align: center; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid var(--line); }
.wk-h b { display: block; font-size: 22px; color: var(--text); }
.wk-col .appt-chip { margin: 6px; }

/* Rx workflow */
.rx-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; font-size: 12px; }
.rx-card h4 .status { margin-left: 6px; }

/* Admin tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; }
.who { display: flex; gap: 10px; align-items: center; }
.perm-tbl th { text-align: center; } .perm-tbl th:first-child { text-align: left; }
.perm-tbl td.c { text-align: center; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { text-align: center; } .auth-brand p, .auth-points li { margin: 0 auto; }
  .cover { height: 90px; }
  .avatar.xl { width: 100px; height: 100px; }
  .profile-top { margin-top: -50px; }
  .nav-links span, .uc-text, .search { display: none; }
  .tbl { display: block; overflow-x: auto; }
}

/* Profile banner (replaces cover image) */
.profile-head { margin-top: 16px; border-radius: var(--radius); overflow: hidden; padding: 0; }
.banner { position: relative; display: flex; align-items: center; gap: 24px; padding: 28px 32px; color: #fff; background: var(--g); flex-wrap: wrap; }
.banner::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% -20%, rgba(255,255,255,.28), transparent 55%), linear-gradient(0deg, rgba(0,0,0,.18), transparent); pointer-events: none; }
.banner > * { position: relative; z-index: 1; }
.banner-photo { cursor: pointer; }
.banner .avatar.xl { border: 4px solid rgba(255,255,255,.85); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.banner-info { flex: 1; min-width: 240px; }
.banner-info h1 { font-size: 30px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.15); }
.banner-sub { opacity: .92; font-size: 15px; margin-top: 2px; }
.banner .tag { background: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(6px); }
.banner-alert { display: inline-block; margin-top: 10px; background: #fff; color: var(--danger); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255,255,255,.25); } }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; align-self: flex-end; }
.banner .btn-primary { background: #fff; color: var(--primary); }
.banner .btn-ghost { background: rgba(255,255,255,.2); color: #fff; }
.banner .btn-ghost:hover { background: rgba(255,255,255,.32); }
.summary { display: grid; grid-template-columns: repeat(6, 1fr); border-bottom: 1px solid var(--line); }
.sum { padding: 14px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.sum:last-child { border-right: none; }
.sum span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.sum b { font-size: 18px; margin-top: 2px; }
.sum small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum.danger b { color: var(--danger); }
.profile-head .tabs { padding: 0 16px; border-top: none; }
@media (max-width: 900px) {
  .profile-head { margin: 0; border-radius: 0; }
  .banner { flex-direction: column; text-align: center; padding: 22px 16px; }
  .banner .tags, .banner-actions { justify-content: center; align-self: center; }
  .summary { grid-template-columns: repeat(3, 1fr); }
  .sum:nth-child(3n) { border-right: none; }
}

.danger-txt { color: var(--danger) !important; }
.danger-txt:hover { background: var(--danger-soft) !important; }
.tbl .acts { flex-wrap: wrap; }
