/* CareQueue shared design system (used by index.html, doctor.html, dashboard.html) */
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; background: #f4f7f6; color: #1f2937; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid #00a896; outline-offset: 2px; }

/* Forms */
.inp { width: 100%; padding: .62rem .8rem; border: 1px solid #d1d5db; border-radius: .6rem; font-size: .875rem; background: #fff; transition: border-color .15s, box-shadow .15s; }
.inp:focus { outline: none; border-color: #00a896; box-shadow: 0 0 0 3px rgba(0,168,150,.18); }
.inp:disabled { background: #f3f4f6; color: #9ca3af; }
.lbl { display: block; font-size: .7rem; font-weight: 700; color: #4b5563; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 700; font-size: .875rem; padding: .7rem 1.1rem; border-radius: .6rem; color: #fff; border: 0; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.12); transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(.92); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn-sm { padding: .35rem .7rem; font-size: .72rem; border-radius: .45rem; box-shadow: none; }
.btn-navy { background: #003366; } .btn-teal { background: #00a896; } .btn-red { background: #dc2626; }
.btn-green { background: #059669; } .btn-amber { background: #d97706; } .btn-gray { background: #6b7280; } .btn-dark { background: #1f2937; }
.btn-ghost { background: #fff; color: #003366; border: 1px solid #d1d5db; box-shadow: none; }
.btn-ghost:hover { background: #f3f4f6; filter: none; }

/* Avatars (photo with initials fallback) */
.av { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 9999px; overflow: hidden; background: #003366; color: #fff; font-weight: 700; line-height: 1; user-select: none; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Cards & headings */
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: .9rem; padding: 1.5rem; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.h2 { font-size: 1.1rem; font-weight: 800; color: #003366; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 2px solid #00a896; padding-bottom: .6rem; margin-bottom: 1.1rem; }
.hint { font-size: .75rem; color: #6b7280; }
.stat { background: #fff; border: 1px solid #e5e7eb; border-radius: .9rem; padding: 1rem; text-align: center; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.stat p:first-child { font-size: .68rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; }
.stat p:last-child { font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.kv dt { font-size: .66rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; }
.kv dd { font-size: .875rem; color: #1f2937; margin: 0 0 .6rem; white-space: pre-line; word-break: break-word; }

/* Status badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: .4rem; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.b-vacant { background: #d1fae5; color: #065f46; } .b-booked { background: #dbeafe; color: #1e40af; }
.b-arrived { background: #ccfbf1; color: #115e59; } .b-completed { background: #e5e7eb; color: #374151; }
.b-noshow { background: #ffe4e6; color: #9f1239; } .b-blocked { background: #fef3c7; color: #92400e; } .b-past { background: #f3f4f6; color: #9ca3af; }
.p-active { background: #d1fae5; color: #065f46; } .p-pending { background: #fef3c7; color: #92400e; }
.p-rejected { background: #ffe4e6; color: #9f1239; } .p-suspended { background: #e5e7eb; color: #374151; }

/* Slot chips */
.chip { display: block; text-align: center; font-size: .72rem; font-weight: 700; padding: .42rem .25rem; border-radius: .5rem; border: 1px solid; transition: .12s; }
.chip-vac { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; cursor: pointer; }
.chip-vac:hover { background: #059669; color: #fff; border-color: #059669; }
.chip-vac.sel { background: #00a896; color: #fff; border-color: #00a896; }
.chip-bk { background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb; text-decoration: line-through; cursor: not-allowed; }
.slot-grp { font-size: .62rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; margin: .6rem 0 .3rem; }
.day { display: flex; flex-direction: column; align-items: center; min-width: 3.4rem; padding: .4rem .5rem; border: 1px solid #e5e7eb; border-radius: .6rem; background: #fff; font-size: .68rem; font-weight: 600; color: #6b7280; cursor: pointer; transition: .12s; }
.day b { font-size: 1.05rem; color: #003366; }
.day:hover { border-color: #00a896; }
.day.on { background: #003366; border-color: #003366; color: #cbd5e1; } .day.on b { color: #fff; }

/* Tables */
.tbl { width: 100%; text-align: left; font-size: .875rem; border-collapse: collapse; }
.tbl th { background: #f9fafb; color: #4b5563; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: .75rem; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.tbl td { padding: .75rem; border-top: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tbody tr:hover td { background: #fafafa; }
.tbl .inp { min-width: 6.5rem; }
.tbl tr.off td:not(:first-child):not(:nth-child(2)) { opacity: .45; }
.bar { height: .5rem; background: #e5e7eb; border-radius: 9999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #00a896; border-radius: 9999px; }
.empty { text-align: center; color: #9ca3af; font-size: .875rem; padding: 1.5rem; }
.skel { background: linear-gradient(90deg, #eef2f1 25%, #f8faf9 37%, #eef2f1 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: .6rem; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 1rem; padding: 1.5rem; max-width: 28rem; width: 100%; border-top: 4px solid #00a896; box-shadow: 0 20px 50px rgba(0,0,0,.25); max-height: 90vh; overflow: auto; animation: pop .16s ease; }
.modal-lg { max-width: 38rem; }
.modal h3 { font-size: 1.1rem; font-weight: 800; color: #003366; margin-bottom: .5rem; }
.modal p { font-size: .875rem; color: #4b5563; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 120; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
.toast { background: #003366; color: #fff; padding: .7rem 1rem; border-radius: .6rem; font-size: .85rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); border-left: 4px solid #00a896; animation: pop .16s ease; }
.toast.err { border-left-color: #ef4444; }

/* Print */
.print-only, #printArea { display: none; }
@media print {
  .noprint { display: none !important; }
  .print-only { display: block !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  body.print-ticket > *:not(#printArea) { display: none !important; }
  body.print-ticket #printArea { display: block !important; }
}
