/* ----------------------------------------------------------------------
   HMS — site-wide styling.  Layered on Tailwind utilities (no build step).
   Designed so every existing page upgrades visually without markup edits.
   ---------------------------------------------------------------------- */

:root {
    --hms-blue:    #2563eb;
    --hms-blue-2:  #06b6d4;
    --hms-shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
    --hms-shadow-md: 0 4px 12px -4px rgb(15 23 42 / 0.08), 0 2px 4px -2px rgb(15 23 42 / 0.04);
    --hms-shadow-lg: 0 10px 25px -8px rgb(15 23 42 / 0.12), 0 4px 10px -2px rgb(15 23 42 / 0.05);
}

html, body { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif; }
body { letter-spacing: -0.005em; }

/* ============================================================
   1. Form controls — every .hms-input gets the polished look
   ============================================================ */
.hms-input {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    color: rgb(30 41 59);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.hms-input:hover { border-color: rgb(203 213 225); }
.hms-input:focus {
    outline: none;
    border-color: var(--hms-blue);
    box-shadow: 0 0 0 4px rgb(219 234 254 / 0.7);
}
.hms-input[disabled],
.hms-input[readonly] {
    background: rgb(248 250 252);
    color: rgb(100 116 139);
}

select.hms-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
    appearance: none;
    -webkit-appearance: none;
}

input[type="file"] { font-size: 0.875rem; }
input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.45rem 0.95rem;
    border: 0;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: transform .15s, box-shadow .15s;
}
input[type="file"]::file-selector-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgb(30 41 59 / 0.25);
}

/* ============================================================
   2. Buttons (Tailwind classes still work; this just adds polish)
   ============================================================ */
button, .hms-btn {
    transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
button:not(:disabled):active { transform: translateY(0.5px) scale(.99); }
button:disabled              { cursor: not-allowed; }

/* Common Tailwind button colours get a soft shadow when colored */
button[class*="bg-blue-600"],
button[class*="bg-emerald-600"],
button[class*="bg-rose-600"],
button[class*="bg-amber-600"],
button[class*="bg-cyan-600"],
button[class*="bg-violet-600"],
button[class*="bg-slate-800"],
a[class*="bg-blue-600"],
a[class*="bg-emerald-600"],
a[class*="bg-cyan-600"],
a[class*="bg-violet-600"],
a[class*="bg-slate-800"] {
    box-shadow: 0 4px 10px -3px rgb(37 99 235 / 0.25);
}
button[class*="bg-rose-600"], a[class*="bg-rose-600"]       { box-shadow: 0 4px 10px -3px rgb(225 29 72 / 0.25); }
button[class*="bg-emerald-600"], a[class*="bg-emerald-600"] { box-shadow: 0 4px 10px -3px rgb(5 150 105 / 0.25); }
button[class*="bg-amber-600"], a[class*="bg-amber-600"]     { box-shadow: 0 4px 10px -3px rgb(217 119 6 / 0.25); }

/* ============================================================
   3. Cards — soft hover lift on every white rounded panel
   ============================================================ */
.bg-white.rounded-xl,
.bg-white.rounded-2xl {
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
    box-shadow: var(--hms-shadow-sm);
}

/* Dashboard stat tiles get an explicit class for the bigger lift */
.hms-stat-tile {
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.hms-stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--hms-shadow-lg);
    border-color: rgb(199 210 254);
}

/* ============================================================
   4. Tables — smoother dividers, gradient header, hover row tint
   ============================================================ */
table thead {
    background: linear-gradient(to bottom, rgb(248 250 252), rgb(241 245 249));
}
table tbody tr {
    transition: background-color .12s ease;
}
table tbody tr:hover {
    background-color: rgb(248 250 252 / 0.7);
}

/* ============================================================
   5. Sidebar nav micro-interactions
   ============================================================ */
.hms-nav-link {
    position: relative;
}
.hms-nav-link > span:first-of-type {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================================
   6. Tabs (used on patient profile and elsewhere)
   ============================================================ */
[data-tabs] button {
    transition: color .15s, border-color .15s, background-color .15s;
    position: relative;
}
[data-tabs] button:hover {
    background-color: rgb(248 250 252);
}

/* ============================================================
   7. Status / role chips — auto-polish any small uppercase pill
   ============================================================ */
.tracking-wider.uppercase[class*="rounded"] {
    letter-spacing: 0.06em;
    font-feature-settings: "cv11";
}

/* ============================================================
   8. Links inside tables and tab content
   ============================================================ */
table a:not(.text-rose-600):not([class*="bg-"]):hover {
    text-decoration: none;
}

/* ============================================================
   9. Scrollbar
   ============================================================ */
::-webkit-scrollbar          { width: 10px; height: 10px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: rgb(203 213 225); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184); }

/* ============================================================
   10. Toast (used by HMS.toast)
   ============================================================ */
.hms-toast {
    animation: hmsToastIn .3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes hmsToastIn {
    from { opacity: 0; transform: translateY(20px) scale(.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ============================================================
   11. Print: hide nav chrome
   ============================================================ */
@media print {
    aside, header, footer, #hms-backdrop { display: none !important; }
    main { padding: 0 !important; max-width: 100% !important; }
    body { background: white !important; }
}

/* ============================================================
   12. Small-screen safety
   ============================================================ */
@media (max-width: 640px) {
    .hms-input { font-size: 1rem; }   /* prevents iOS auto-zoom on focus */
}

/* ============================================================
   13. Loading shimmer
   ============================================================ */
.hms-shimmer {
    background: linear-gradient(90deg, rgb(241 245 249) 25%, rgb(226 232 240) 50%, rgb(241 245 249) 75%);
    background-size: 200% 100%;
    animation: hmsShimmer 1.4s linear infinite;
}
@keyframes hmsShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   14. Patient avatar bubble (used in lists and profile)
   ============================================================ */
.hms-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 600;
    background: linear-gradient(135deg, rgb(219 234 254), rgb(207 250 254));
    color: rgb(29 78 216);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.6);
}

/* ============================================================
   15. Empty state polish
   ============================================================ */
.hms-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: rgb(100 116 139);
}
.hms-empty svg {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 0.75rem;
    color: rgb(203 213 225);
}
