/* ODAT Medical Center — clinic system design (v2)
   Colours come from the OMC logo: warm off-white, taupe and gold. */
:root {
    --bg: #F4F1EB;
    --surface: #FFFFFF;
    --surface-2: #FAF8F4;
    --line: #E6E0D5;
    --line-strong: #D6CEC0;
    --text: #2A2520;
    --muted: #7A7064;
    --gold: #B0935F;
    --gold-ink: #866A3C;
    --gold-soft: #F4ECDD;
    --taupe: #B6ADA1;
    --taupe-soft: #EEEAE3;
    --danger: #B04A4A;
    --danger-soft: #F8E6E4;
    --st1: #9A6A12; --st1-bg: #FCF1DC;   /* waiting */
    --st2: #285F95; --st2-bg: #E5EFF9;   /* with doctor */
    --st3: #2C7350; --st3-bg: #E2F2E8;   /* done */
    --st4: #A04556; --st4-bg: #F8E5E8;   /* cancelled */
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(60, 45, 20, .05), 0 4px 16px rgba(60, 45, 20, .05);
    --shadow-lg: 0 12px 40px rgba(40, 30, 15, .16);
    --side-w: 248px;
    --font: "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, Tahoma, Arial, sans-serif;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

html { -webkit-text-size-adjust: 100%; }
body.omc {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body.omc a { color: var(--gold-ink); }
body.omc a:hover, body.omc a:focus { color: #5E4A28; text-decoration: none; }
body.omc *:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.omc-muted { color: var(--muted); }
.omc-small { font-size: 13px; }

/* ------------------------------------------------------------------ layout */
.omc-side {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: var(--side-w);
    background: var(--surface-2);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    z-index: 1040;
    transition: transform .28s var(--ease);
}
.omc-rtl .omc-side { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); }
.omc-brand { display: block; padding: 18px 26px 8px; }
.omc-brand img { width: 100%; max-width: 150px; height: auto; display: block; }
.omc-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.omc-nav-group { margin-bottom: 8px; }
.omc-nav-title {
    font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: #A0968A; padding: 6px 12px 3px;
}
.omc-rtl .omc-nav-title { letter-spacing: 0; font-size: 12px; }
body.omc .omc-nav-link {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px; margin: 1px 0;
    border-radius: var(--radius-sm);
    color: #4A4238; font-weight: 500; font-size: 14.5px;
    transition: background .15s, color .15s;
}
body.omc .omc-nav-link .fa { color: var(--taupe); font-size: 15px; transition: color .15s; }
body.omc .omc-nav-link:hover { background: var(--taupe-soft); color: var(--text); }
body.omc .omc-nav-link.is-active { background: var(--gold-soft); color: #4D3C1E; }
body.omc .omc-nav-link.is-active .fa { color: var(--gold-ink); }
.omc-nav-link.is-active::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--gold);
}
.omc-rtl .omc-nav-link.is-active::before { left: auto; right: -12px; border-radius: 3px 0 0 3px; }
.omc-side-foot { border-top: 1px solid var(--line); padding: 10px 16px 12px; }
.omc-user { display: flex; align-items: center; gap: 10px; padding: 2px 4px 6px; font-weight: 600; font-size: 14px; }
.omc-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.omc .omc-side-small { display: inline-block; padding: 4px 4px; margin-right: 10px; color: var(--muted); font-size: 13.5px; }
body.omc .omc-side-small:hover { color: var(--text); }

.omc-page { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.omc-rtl .omc-page { margin-left: 0; margin-right: var(--side-w); }
.omc-top {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 32px;
    background: rgba(244, 241, 235, .97);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.omc-top.is-scrolled { border-bottom-color: var(--line); }
.omc-main { flex: 1; padding: 8px 32px 48px; max-width: 1360px; width: 100%; }
.omc-burger {
    display: none; border: 0; background: var(--surface); width: 42px; height: 42px; border-radius: 11px;
    box-shadow: var(--shadow); color: var(--text); font-size: 17px; flex: none;
}
.omc-scrim { display: none; }

/* ------------------------------------------------------------------ search */
.omc-search { position: relative; flex: 1; max-width: 620px; }
.omc-search input {
    width: 100%; height: 44px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface);
    padding: 0 44px 0 42px;
    font: inherit; font-size: 15px; color: var(--text);
    box-shadow: 0 1px 2px rgba(60, 45, 20, .04);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.omc-search input::placeholder { color: #A39887; }
.omc-search input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(176, 147, 95, .16); }
.omc-search-icon { position: absolute; top: 14px; left: 16px; color: var(--taupe); pointer-events: none; }
.omc-rtl .omc-search-icon { left: auto; right: 16px; }
.omc-rtl .omc-search input { padding: 0 42px 0 44px; }
.omc-kbd {
    position: absolute; top: 11px; right: 12px; font: 600 12px var(--font);
    color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
    padding: 1px 7px; box-shadow: none;
}
.omc-rtl .omc-kbd { right: auto; left: 12px; }
.omc-search input:focus ~ .omc-kbd { opacity: 0; }
.omc-search-results {
    position: absolute; top: 52px; left: 0; right: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow-lg); padding: 6px; display: none; max-height: 70vh; overflow-y: auto;
    transform-origin: top center;
}
.omc-search-results.is-open { display: block; animation: omc-pop .16s var(--ease); }
.omc-sr {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
    color: var(--text);
}
.omc-sr.is-active, .omc-sr:hover { background: var(--gold-soft); }
.omc-sr-main { flex: 1; min-width: 0; }
.omc-sr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omc-sr-meta { font-size: 12.5px; color: var(--muted); }
.omc-sr-go { font-size: 12.5px; color: var(--gold-ink); font-weight: 600; white-space: nowrap; }
.omc-sr-empty { padding: 14px; color: var(--muted); text-align: center; }
.omc-sr-visit {
    border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 4px 9px;
    font: 600 12.5px var(--font); color: var(--gold-ink); white-space: nowrap;
}
.omc-sr-visit:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ------------------------------------------------------------------ type + buttons */
.omc-h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.25; }
.omc-h2 { font-size: 16.5px; font-weight: 600; margin: 0; }
.omc-eyebrow { color: var(--muted); font-size: 13.5px; font-weight: 500; margin-bottom: 2px; }
.omc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 14px 0 22px; }
.omc-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

body.omc .omc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border: 1px solid var(--line-strong); border-radius: 10px;
    background: var(--surface); color: var(--text);
    font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
body.omc .omc-btn:hover { border-color: var(--gold); color: var(--text); }
body.omc .omc-btn:active { transform: translateY(1px); }
body.omc .omc-btn .fa { color: var(--gold-ink); }
body.omc .omc-btn-primary { background: var(--gold); border-color: var(--gold); color: #fff; box-shadow: 0 2px 8px rgba(176, 147, 95, .35); }
body.omc .omc-btn-primary .fa { color: #fff; }
body.omc .omc-btn-primary:hover { background: #9F834F; border-color: #9F834F; color: #fff; }
body.omc .omc-btn-block { width: 100%; }
body.omc .omc-btn-lg { height: 48px; font-size: 15.5px; }
body.omc .omc-link { font-weight: 600; font-size: 13.5px; }

/* ------------------------------------------------------------------ cards */
.omc-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
}
.omc-card-flush { padding: 0; overflow: hidden; }
.omc-card-flush > .omc-card-head { padding: 16px 20px 0; }
.omc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.omc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.omc-grid-2 > .omc-card { margin-bottom: 0; }
.omc-count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--taupe-soft); color: var(--muted); font-size: 12px; text-align: center; vertical-align: 2px; margin-left: 4px; }

/* ------------------------------------------------------------------ dashboard */
.omc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.omc-stat {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow);
}
.omc-stat::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c, var(--gold)); }
.omc-rtl .omc-stat::after { inset: 0 0 0 auto; }
.omc-st-1 { --c: #D9A441; } .omc-st-2 { --c: #4C8BC8; } .omc-st-3 { --c: #48A275; } .omc-st-money { --c: var(--gold); }
.omc-stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.omc-stat-num { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.omc-stat-num small { font-size: 14px; color: var(--muted); font-weight: 600; }
.omc-stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; min-height: 18px; }
.omc-stat-num.is-bump { animation: omc-bump .5s var(--ease); }

.omc-spark { display: flex; align-items: flex-end; gap: 6px; height: 240px; padding-top: 6px; }
.omc-spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.omc-spark-bar {
    width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--taupe-soft);
    transform-origin: bottom; animation: omc-grow .6s var(--ease) both; position: relative;
}
.omc-spark-col.is-today .omc-spark-bar { background: var(--gold); }
.omc-spark-col:hover .omc-spark-bar { background: #D8C7A6; }
.omc-spark-col.is-today:hover .omc-spark-bar { background: #9F834F; }
.omc-spark-n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.omc-spark-d { font-size: 10.5px; color: var(--taupe); white-space: nowrap; }

.omc-list { display: flex; flex-direction: column; }
body.omc .omc-li { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 10px; color: var(--text); }
body.omc .omc-li:hover { background: var(--surface-2); }
.omc-li-main { flex: 1; min-width: 0; }
.omc-li-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omc-li-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.omc-avatar {
    flex: none; width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gold-soft); color: var(--gold-ink); font-weight: 700; font-size: 13.5px;
}
.omc-avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.omc-avatar-lg { width: 72px; height: 72px; font-size: 25px; background: linear-gradient(140deg, #E9DCC2, #F6EFE3); box-shadow: inset 0 0 0 1px rgba(176, 147, 95, .3); }
.omc-avatar.c1 { background: #E8EEF3; color: #3F6283; }
.omc-avatar.c2 { background: #EDE7F0; color: #6A4C7B; }
.omc-avatar.c3 { background: #E4F0EA; color: #36705A; }
.omc-avatar.c4 { background: #F5E9E3; color: #8A5137; }

.omc-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--taupe-soft); color: #5C5348; }
.omc-chip-id { background: var(--surface-2); border: 1px solid var(--line); }
.omc-chip-tag { background: var(--gold-soft); color: var(--gold-ink); }
.omc-chip-alert { background: var(--danger-soft); color: var(--danger); }
.omc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }

/* ------------------------------------------------------------------ profile */
body.omc .omc-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; font-weight: 500; margin: 10px 0 12px; }
.omc-rtl .omc-back .fa { transform: scaleX(-1); }
.omc-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding: 22px 24px; }
.omc-hero-main { display: flex; gap: 18px; align-items: flex-start; min-width: 0; flex: 1; }
.omc-hero-text { min-width: 0; }
.omc-patient-name { font-size: 28px; }
.omc-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.omc-facts { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 12px 0 0; }
.omc-facts dt { font-size: 12px; color: var(--muted); font-weight: 500; }
.omc-facts dd { margin: 0; font-weight: 600; font-size: 14.5px; }
body.omc .omc-wa { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; background: #E3F5E9; color: #1E8E4E; margin-left: 4px; vertical-align: -2px; }
body.omc .omc-wa:hover { background: #1E8E4E; color: #fff; }

.omc-menu { position: relative; }
.omc-menu-list {
    position: absolute; top: 46px; right: 0; min-width: 230px; z-index: 50;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
    padding: 6px; display: none;
}
.omc-rtl .omc-menu-list { right: auto; left: 0; }
.omc-menu.is-open .omc-menu-list { display: block; animation: omc-pop .16s var(--ease); }
body.omc .omc-menu-list a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 14px; }
body.omc .omc-menu-list a:hover { background: var(--gold-soft); }
.omc-menu-list .fa { color: var(--gold-ink); margin-right: 4px; }

.omc-profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.omc-summary { display: grid; gap: 14px; }
.omc-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.omc-value { font-size: 15px; }
.omc-summary-dx .omc-value { font-size: 18px; font-weight: 600; }
.omc-missing { color: #B3A898; font-weight: 400; font-style: italic; font-size: 15px; }
.omc-report summary { cursor: pointer; list-style: none; }
.omc-report summary::-webkit-details-marker { display: none; }
.omc-report[open] summary .fa { transform: rotate(180deg); }
.omc-report summary .fa { transition: transform .2s; }
.omc-richtext { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 6px; }
.omc-richtext p:last-child { margin-bottom: 0; }

.omc-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.omc-filter {
    border: 1px solid var(--line); background: var(--surface); border-radius: 99px; height: 30px; padding: 0 11px;
    font: 500 13px var(--font); color: var(--muted); cursor: pointer; transition: all .15s;
}
.omc-filter b { font-weight: 600; color: var(--taupe); margin-left: 2px; }
.omc-filter:hover { border-color: var(--gold); color: var(--text); }
.omc-filter.is-on { background: var(--text); border-color: var(--text); color: #fff; }
.omc-filter.is-on b { color: #CFC6B8; }

.omc-timeline { list-style: none; margin: 4px 0 0; padding: 0; position: relative; }
.omc-timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 17px; width: 2px; background: var(--line); }
.omc-rtl .omc-timeline::before { left: auto; right: 17px; }
.omc-tl-year { position: relative; margin: 8px 0 6px; padding-left: 46px; }
.omc-rtl .omc-tl-year { padding-left: 0; padding-right: 46px; }
.omc-tl-year span { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); padding: 2px 0; letter-spacing: .05em; }
.omc-tl-item { position: relative; display: flex; gap: 12px; padding: 7px 0; transition: opacity .2s, transform .2s; }
.omc-tl-item.is-hidden, .omc-tl-year.is-hidden { display: none; }
.omc-tl-dot {
    position: relative; z-index: 1; flex: none; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 2px solid var(--line); color: var(--taupe); font-size: 14px;
}
.omc-tl-visit .omc-tl-dot { color: var(--gold-ink); border-color: #E3D3B4; background: var(--gold-soft); }
.omc-tl-op .omc-tl-dot { color: var(--danger); border-color: #EBC9C6; background: var(--danger-soft); }
.omc-tl-inv .omc-tl-dot { color: #4F6E8C; border-color: #CFDCE8; background: #EEF3F8; }
.omc-tl-rx .omc-tl-dot { color: #3F7A5D; border-color: #CDE4D7; background: #EDF6F1; }
.omc-tl-img .omc-tl-dot { color: #7A5E8A; border-color: #E0D3E7; background: #F4EEF7; }
.omc-tl-body { flex: 1; min-width: 0; padding: 7px 12px 9px; border-radius: 11px; transition: background .15s; }
.omc-tl-item:hover .omc-tl-body { background: var(--surface-2); }
.omc-tl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.omc-tl-title { font-weight: 600; }
.omc-tl-date { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.omc-rtl .omc-tl-date { margin-left: 0; margin-right: auto; }
.omc-tl-text { color: #50473D; font-size: 14px; margin-top: 3px; white-space: normal; overflow-wrap: anywhere; }
.omc-tl-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.omc-tl-thumb { display: block; border: 0; padding: 0; margin-top: 7px; background: none; cursor: zoom-in; }
.omc-tl-thumb img { height: 76px; width: auto; max-width: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.omc-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.omc-pill-waiting { background: var(--st1-bg); color: var(--st1); }
.omc-pill-ongoing { background: var(--st2-bg); color: var(--st2); }
.omc-pill-done { background: var(--st3-bg); color: var(--st3); }
.omc-pill-cancelled { background: var(--st4-bg); color: var(--st4); }
.omc-pill-op { background: var(--danger-soft); color: var(--danger); }
.omc-pill-print, .omc-pill-active { background: var(--gold-soft); color: var(--gold-ink); }

/* uploads + gallery */
.omc-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 2px dashed var(--line-strong); border-radius: 12px; padding: 18px 12px; text-align: center; cursor: pointer;
    background: var(--surface-2); transition: border-color .15s, background .15s, transform .15s; margin: 0; font-weight: 400;
}
.omc-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.omc-drop .fa { font-size: 26px; color: var(--gold); margin-bottom: 4px; transition: transform .2s var(--ease); }
.omc-drop-big { font-weight: 600; }
.omc-drop-small { font-size: 12.5px; color: var(--muted); }
.omc-drop:hover, .omc-drop.is-over { border-color: var(--gold); background: var(--gold-soft); }
.omc-drop.is-over { transform: scale(1.015); }
.omc-drop.is-over .fa { transform: translateY(-3px); }
.omc-upload-opts { display: grid; grid-template-columns: 140px 1fr; gap: 8px; margin: 10px 0 4px; }
.omc-upload-opts label { font-size: 12px; color: var(--muted); font-weight: 500; margin: 0; }
.omc-upload-opts input {
    display: block; width: 100%; height: 36px; margin-top: 2px; border: 1px solid var(--line); border-radius: 8px;
    padding: 0 9px; font: 14px var(--font); color: var(--text); background: var(--surface);
}
.omc-upload-opts input:focus { outline: 0; border-color: var(--gold); }
.omc-uploads:empty { display: none; }
.omc-uploads { margin: 8px 0; display: grid; gap: 6px; }
.omc-up { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.omc-up img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; background: var(--taupe-soft); }
.omc-up-main { flex: 1; min-width: 0; }
.omc-up-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omc-up-bar { height: 4px; border-radius: 4px; background: var(--taupe-soft); overflow: hidden; margin-top: 4px; }
.omc-up-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.omc-up.is-done .omc-up-bar i { background: #48A275; }
.omc-up.is-error .omc-up-bar i { background: var(--danger); width: 100% !important; }
.omc-up-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.omc-up.is-error .omc-up-state { color: var(--danger); }

.omc-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
body.omc .omc-g-item {
    position: relative; display: block; aspect-ratio: 1 / 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden;
    background: var(--taupe-soft); cursor: zoom-in; color: var(--muted);
}
.omc-g-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.omc-g-item:hover img { transform: scale(1.06); }
.omc-g-item.is-new { animation: omc-pop .4s var(--ease); }
.omc-g-date {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; font-weight: 600; color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .55)); text-align: left;
}
.omc-g-file { display: flex !important; align-items: center; justify-content: center; font-size: 28px; }
.omc-g-file .omc-g-date { color: var(--muted); background: none; }

.omc-rx { list-style: none; padding: 0; margin: 0 0 12px; }
.omc-rx li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.omc-rx li:last-child { border-bottom: 0; }
.omc-rx span { color: var(--muted); font-size: 13.5px; }

.omc-empty, .omc-empty-page { text-align: center; color: var(--muted); padding: 26px 10px; }
.omc-empty .fa, .omc-empty-page .fa { font-size: 30px; color: var(--taupe); }
.omc-empty-page { padding: 80px 10px; }
.omc-empty-page .omc-h1 { margin: 10px 0 4px; color: var(--text); }

/* lightbox */
.omc-lb {
    position: fixed; inset: 0; z-index: 2000; background: rgba(22, 19, 15, .92);
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    animation: omc-fade .2s ease;
}
.omc-lb img { max-width: 92vw; max-height: 80vh; border-radius: 6px; box-shadow: 0 10px 50px rgba(0, 0, 0, .5); animation: omc-zoom .25s var(--ease); cursor: zoom-in; touch-action: pinch-zoom; }
.omc-lb.is-full img { max-width: none; max-height: none; cursor: zoom-out; }
.omc-lb.is-full { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.omc-lb-cap { color: #EDE6DA; margin-top: 14px; font-size: 14px; text-align: center; padding: 0 60px; }
.omc-lb-cap b { color: #fff; }
.omc-lb-btn {
    position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .12); color: #fff; font-size: 20px; cursor: pointer; transition: background .15s;
}
.omc-lb-btn:hover { background: rgba(255, 255, 255, .25); }
.omc-lb-close { top: 16px; right: 16px; }
.omc-lb-prev { left: 16px; top: 50%; margin-top: -24px; }
.omc-lb-next { right: 16px; top: 50%; margin-top: -24px; }
.omc-lb-open { position: fixed; top: 16px; left: 16px; color: #EDE6DA; font-size: 13px; }
body.omc .omc-lb-open { color: #EDE6DA; }

/* toast + progress */
.omc-toast {
    position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 2100;
    background: #2A2520; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 500; font-size: 14px;
    box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease);
}
.omc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.omc-toast.is-error { background: var(--danger); }
.omc-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 3000;
    background: linear-gradient(90deg, var(--taupe), var(--gold)); box-shadow: 0 0 8px rgba(176, 147, 95, .6);
    transition: width .3s ease, opacity .3s ease; opacity: 0;
}
.omc-progress.is-on { opacity: 1; }
.omc-rtl .omc-progress { left: auto; right: 0; }
.omc-skeleton { height: 46px; margin: 8px 20px; border-radius: 9px; background: linear-gradient(90deg, #F1EDE6 25%, #F8F6F2 37%, #F1EDE6 63%); background-size: 400% 100%; animation: omc-shimmer 1.3s ease infinite; }
.omc-denied { padding: 40px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ motion */
.omc-enter { animation: omc-in .32s var(--ease) both; }
.omc-view.is-leaving { opacity: .35; transition: opacity .15s; }
@keyframes omc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes omc-pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes omc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes omc-zoom { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes omc-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes omc-bump { 0% { transform: scale(1); } 40% { transform: scale(1.15); color: var(--gold-ink); } 100% { transform: scale(1); } }
@keyframes omc-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================================================================== xCRUD screens restyled
   (the old tables and forms keep working exactly as before — only their look changes) */
#main .xcrud-container, #omc-today-list .xcrud-container { font-family: var(--font); }
#main > .xcrud-container, #main > .xcrud-ajax, #main > div > .xcrud-container {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px 20px; margin-top: 14px; animation: omc-in .32s var(--ease) both;
}
#omc-today-list .xcrud-container { padding: 6px 20px 16px; }
body.omc h2 { border-bottom: 0; }
#main .xcrud-header, #omc-today-list .xcrud-header { border: 0; }
#main .xcrud-container h2, #omc-today-list .xcrud-container h2 {
    font-family: var(--font); font-size: 22px; font-weight: 700; color: var(--text);
    border: 0; margin: 4px 0 14px; padding: 0; line-height: 1.3;
}
#main .xcrud-nested-container h2 { font-size: 17px; margin-top: 10px; }
#omc-today-list .xcrud-container h2, #omc-today-list .xcrud-top-actions:empty { display: none; }
#main .xcrud-toggle-show, #omc-today-list .xcrud-toggle-show { display: none; }
#main .xcrud-list-container, #omc-today-list .xcrud-list-container { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; border: 1px solid var(--line); }
#main table.xcrud-list, #omc-today-list table.xcrud-list { margin: 0; border: 0; background: var(--surface); font-size: 14.5px; }
#main .xcrud-list > thead > tr > th, #main .xcrud-list .xcrud-th th,
#omc-today-list .xcrud-list > thead > tr > th, #omc-today-list .xcrud-list .xcrud-th th {
    background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12.5px;
    text-transform: uppercase; letter-spacing: .04em;
    border: 0; border-bottom: 1px solid var(--line); padding: 11px 12px; white-space: nowrap;
}
.omc-rtl #main .xcrud-list th, .omc-rtl #omc-today-list .xcrud-list th { letter-spacing: 0; font-size: 13px; text-transform: none; }
#main .xcrud-list th a, #omc-today-list .xcrud-list th a { color: var(--muted); }
#main .xcrud-list > tbody > tr > td, #omc-today-list .xcrud-list > tbody > tr > td {
    border: 0; border-bottom: 1px solid #F0EBE3; padding: 11px 12px; vertical-align: middle;
}
#main .table-striped > tbody > tr:nth-of-type(odd), #omc-today-list .table-striped > tbody > tr:nth-of-type(odd) { background: transparent; }
#main .table-hover > tbody > tr:hover, #omc-today-list .table-hover > tbody > tr:hover { background: #FBF8F2; }
#main .xcrud-list > tbody > tr > td.xcrud-num, #omc-today-list .xcrud-list > tbody > tr > td.xcrud-num { color: #B9AF9F; font-size: 12.5px; width: 36px; }
#main .xcrud-list tfoot td, #main .xcrud-list .xcrud-tf td, #omc-today-list .xcrud-list tfoot td, #omc-today-list .xcrud-list .xcrud-tf td {
    background: var(--surface-2); border: 0; font-weight: 700; padding: 11px 12px;
}
#main a.omc-plink, #omc-today-list a.omc-plink { font-weight: 600; color: var(--text); border-bottom: 1px dashed transparent; transition: color .15s, border-color .15s; }
#main a.omc-plink:hover, #omc-today-list a.omc-plink:hover { color: var(--gold-ink); border-bottom-color: var(--gold); }

/* status colours from the old system -> calm pills */
#main td[style*="lightyellow"], #main td[style*="lightblue"], #main td[style*="lightgreen"], #main td[style*="pink"],
#omc-today-list td[style*="lightyellow"], #omc-today-list td[style*="lightblue"], #omc-today-list td[style*="lightgreen"], #omc-today-list td[style*="pink"] {
    background: transparent !important; font-weight: 600; font-size: 13px;
}
#main td[style*="lightyellow"], #omc-today-list td[style*="lightyellow"] { color: var(--st1); box-shadow: inset 4px 0 0 #D9A441; }
#main td[style*="lightblue"], #omc-today-list td[style*="lightblue"] { color: var(--st2); box-shadow: inset 4px 0 0 #4C8BC8; }
#main td[style*="lightgreen"], #omc-today-list td[style*="lightgreen"] { color: var(--st3); box-shadow: inset 4px 0 0 #48A275; }
#main td[style*="pink"], #omc-today-list td[style*="pink"] { color: var(--st4); box-shadow: inset 4px 0 0 #C76A7B; }
.omc-rtl #main td[style*="light"], .omc-rtl #main td[style*="pink"], .omc-rtl #omc-today-list td[style*="light"], .omc-rtl #omc-today-list td[style*="pink"] { box-shadow: none; }

/* buttons inside xCRUD */
#main .btn, #omc-today-list .btn, .omc-xmodal .btn {
    font-family: var(--font); font-weight: 600; border-radius: 9px; box-shadow: none; text-shadow: none;
    transition: background .15s, border-color .15s, color .15s;
}
#main .xcrud-actions .btn-group > .btn, #omc-today-list .xcrud-actions .btn-group > .btn { border-radius: 8px !important; margin: 0 2px; }
#main .xcrud-actions .btn-group, #omc-today-list .xcrud-actions .btn-group { display: inline-flex; float: none; }
#main .btn-default, #omc-today-list .btn-default { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
#main .btn-default:hover, #omc-today-list .btn-default:hover { border-color: var(--gold); background: var(--gold-soft); }
#main .btn-primary, #main .btn-success, #omc-today-list .btn-primary {
    background: var(--gold); border-color: var(--gold); color: #fff;
}
#main .btn-primary:hover, #main .btn-success:hover, #omc-today-list .btn-primary:hover { background: #9F834F; border-color: #9F834F; }
#main .btn-warning, #omc-today-list .btn-warning { background: var(--surface); border-color: var(--line-strong); color: var(--gold-ink); }
#main .btn-warning:hover, #omc-today-list .btn-warning:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
#main .btn-info, #omc-today-list .btn-info { background: var(--surface); border-color: var(--line-strong); color: #4F6E8C; }
#main .btn-info:hover, #omc-today-list .btn-info:hover { background: #EEF3F8; border-color: #9DB5CC; color: #3B5873; }
#main .btn-danger, #omc-today-list .btn-danger { background: var(--surface); border-color: #E7CFCB; color: var(--danger); }
#main .btn-danger:hover, #omc-today-list .btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
#main .xcrud-list .btn-sm, #omc-today-list .xcrud-list .btn-sm { height: 32px; min-width: 34px; padding: 0 9px; font-size: 13px; line-height: 30px; }
#main .xcrud-top-actions, #omc-today-list .xcrud-top-actions { margin-bottom: 12px; }
#main .xcrud-top-actions .btn, #main .xcrud-nav .btn { height: 38px; padding: 0 14px; line-height: 36px; }
#main .xcrud-fix .btn-group, #omc-today-list .xcrud-fix .btn-group { position: static; }

/* search + pagination */
#main .xcrud-nav, #omc-today-list .xcrud-nav { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#main .xcrud-search, #omc-today-list .xcrud-search { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#main .form-control, #omc-today-list .form-control, .omc-xmodal .form-control {
    font-family: var(--font); font-size: 14.5px; height: 38px; border-radius: 9px; border-color: var(--line-strong);
    box-shadow: none; color: var(--text); background-color: var(--surface);
}
#main textarea.form-control { height: auto; min-height: 90px; }
#main .form-control:focus, #omc-today-list .form-control:focus {
    border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 147, 95, .15);
}
#main .pagination > li > a, #main .pagination > li > span { color: var(--text); border-color: var(--line); font-weight: 500; }
#main .pagination > li:first-child > a, #main .pagination > li:first-child > span { border-radius: 9px 0 0 9px; }
#main .pagination > li:last-child > a, #main .pagination > li:last-child > span { border-radius: 0 9px 9px 0; }
#main .pagination > .active > a, #main .pagination > .active > span, #main .pagination > .active > a:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
#main .xcrud-limit-list .btn.active, #main .btn-group .btn.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }

/* edit forms + tabs */
#main .nav-tabs { border-bottom: 1px solid var(--line); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 2px; }
#main .nav-tabs > li { float: none; margin-bottom: -1px; }
#main .nav-tabs > li > a {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin: 0; padding: 10px 14px;
    color: var(--muted); font-weight: 600; background: none;
}
#main .nav-tabs > li > a:hover { color: var(--text); background: none; border-bottom-color: var(--line-strong); }
#main .nav-tabs > li.active > a, #main .nav-tabs > li.active > a:hover, #main .nav-tabs > li.active > a:focus {
    border: 0; border-bottom: 2px solid var(--gold); color: var(--text); background: none;
}

#main .form-horizontal .control-label { color: var(--muted); font-weight: 600; font-size: 13.5px; padding-top: 9px; }
#main .form-horizontal .form-group { margin-bottom: 14px; }
#main .xcrud-view .form-control-static { font-weight: 500; }
#main .xcrud-top-actions + .form-horizontal, #main .xcrud-view { margin-top: 6px; }
#main input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); vertical-align: middle; }
#main .xcrud-overlay { background: rgba(255, 255, 255, .6) url(../xcrud/themes/bootstrap/loading.gif) center no-repeat; border-radius: var(--radius); }
#main .alert { border-radius: 10px; }
#main .alert-success { background: var(--st3-bg); border-color: #C9E6D4; color: var(--st3); }
#main .xcrud-nested-container { border-top: 0; }
#main .xcrud-nested-container .xcrud-container { box-shadow: none; border: 0; padding: 0; margin: 0; animation: none; background: none; }
#main .autocomplete input { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 14.5px; }
#main .autocomplete-items div { font-family: var(--font); }
#main .autocomplete-active { background-color: var(--gold) !important; }

/* page wrapper that the new design adds above an old screen */
.omc-crumb { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; flex-wrap: wrap; }
.omc-crumb .omc-h1 { font-size: 24px; }

/* ================================================================== login */
.omc-login-page { background: radial-gradient(1200px 600px at 50% -10%, #FFFFFF 0%, var(--bg) 60%); }
.omc-login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.omc-login-card {
    width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
    box-shadow: 0 20px 60px rgba(60, 45, 20, .10); padding: 34px 32px 30px;
}
.omc-login-logo { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 auto 22px; }
.omc-login-title { font-size: 22px; font-weight: 700; text-align: center; margin: 0; }
.omc-login-title span { display: block; font-size: 15px; font-weight: 500; color: var(--gold-ink); margin-top: 2px; }
.omc-login-sub { text-align: center; margin: 4px 0 22px; font-size: 14px; }
.omc-field { display: block; margin-bottom: 16px; font-weight: 400; }
.omc-field > span:first-child { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #5C5348; margin-bottom: 6px; }
.omc-field em { font-style: normal; color: var(--muted); font-weight: 500; }
.omc-field input {
    display: block; width: 100%; height: 48px; border: 1px solid var(--line-strong); border-radius: 11px;
    padding: 0 14px; font: 16px var(--font); color: var(--text); background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.omc-field input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(176, 147, 95, .16); }
.omc-pass { position: relative; display: block; }
.omc-pass input { padding-right: 48px; }
.omc-pass-toggle { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.omc-pass-toggle:hover { color: var(--text); background: var(--surface-2); }
.omc-btn-ar { font-weight: 500; opacity: .85; }
.omc-alert { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 500; margin-bottom: 16px; animation: omc-shake .4s; }
.omc-login-foot { color: var(--taupe); font-size: 12.5px; margin-top: 18px; }
@keyframes omc-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ================================================================== tablet + phone */
@media (max-width: 1180px) {
    .omc-profile-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 991px) {
    .omc-side { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .omc-rtl .omc-side { transform: translateX(100%); }
    body.omc-nav-open .omc-side { transform: none; }
    .omc-scrim { display: block; position: fixed; inset: 0; background: rgba(30, 25, 18, .35); z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .25s; }
    body.omc-nav-open .omc-scrim { opacity: 1; pointer-events: auto; }
    .omc-page, .omc-rtl .omc-page { margin: 0; }
    .omc-burger { display: inline-flex; align-items: center; justify-content: center; }
    .omc-top { padding: 12px 16px; }
    .omc-main { padding: 4px 16px 40px; }
    .omc-profile-grid { grid-template-columns: 1fr; }
    .omc-col-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
    .omc-col-side > .omc-card { margin-bottom: 0; }
    .omc-col-side { margin-bottom: 18px; order: -1; }
    .omc-profile-grid { display: flex; flex-direction: column; }
}
@media (max-width: 720px) {
    body.omc { font-size: 14.5px; }
    .omc-kbd { display: none; }
    .omc-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .omc-stat { padding: 13px 14px; }
    .omc-stat-num { font-size: 26px; }
    .omc-grid-2, .omc-col-side { grid-template-columns: 1fr; }
    .omc-h1 { font-size: 22px; }
    .omc-patient-name { font-size: 23px; }
    .omc-head { margin: 8px 0 16px; }
    .omc-head-actions { width: 100%; }
    .omc-head-actions .omc-btn { flex: 1; }
    .omc-hero { padding: 18px; }
    .omc-hero-main { gap: 14px; }
    .omc-avatar-lg { width: 56px; height: 56px; font-size: 20px; }
    .omc-hero-actions { width: 100%; }
    .omc-hero-actions > .omc-btn, .omc-hero-actions > .omc-menu { flex: 1; }
    .omc-hero-actions .omc-menu > .omc-btn { width: 100%; }
    .omc-facts { gap: 8px 18px; }
    .omc-card { padding: 16px; border-radius: 12px; }
    .omc-card-flush { padding: 0; }
    .omc-card-flush > .omc-card-head { padding: 14px 16px 0; }
    #omc-today-list .xcrud-container { padding: 4px 10px 12px; }
    #main > .xcrud-container, #main > .xcrud-ajax, #main > div > .xcrud-container { padding: 12px; }
    .omc-tl-date { width: 100%; margin: 0; }
    .omc-upload-opts { grid-template-columns: 1fr; }
    .omc-spark-d { display: none; }
    .omc-lb-prev, .omc-lb-next { top: auto; bottom: 20px; margin: 0; }
    .omc-lb-cap { padding: 0 16px; margin-bottom: 60px; }
    .omc-search-results { position: fixed; top: 64px; left: 10px; right: 10px; }
    .omc-login-card { padding: 28px 22px 24px; }
}

/* text that came from the old rich-text editor */
.omc-value p, .omc-tl-text p { margin: 0 0 4px; }
.omc-value p:last-child, .omc-tl-text p:last-child { margin-bottom: 0; }

/* phones: old xCRUD tables turn into easy-to-tap cards */
@media (max-width: 720px) {
    #main .xcrud-list-container, #omc-today-list .xcrud-list-container { border: 0; overflow: visible; }
    #main table.xcrud-list, #omc-today-list table.xcrud-list,
    #main table.xcrud-list > tbody, #omc-today-list table.xcrud-list > tbody { display: block !important; width: 100%; background: none; }
    #main table.xcrud-list > thead, #omc-today-list table.xcrud-list > thead { display: none; }
    #main .xcrud-list > tbody > tr, #omc-today-list .xcrud-list > tbody > tr {
        display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px;
        background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
        padding: 12px 14px; margin-bottom: 8px; position: relative;
    }
    #main .xcrud-list > tbody > tr > td, #omc-today-list .xcrud-list > tbody > tr > td {
        display: block; border: 0 !important; padding: 0 !important; font-size: 13.5px; box-shadow: none !important;
    }
    #main .xcrud-list > tbody > tr > td[data-label]:not([data-label=""])::before,
    #omc-today-list .xcrud-list > tbody > tr > td[data-label]:not([data-label=""])::before {
        content: attr(data-label) " "; color: var(--muted); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; margin-right: 4px;
    }
    .omc-rtl #main .xcrud-list > tbody > tr > td::before, .omc-rtl #omc-today-list .xcrud-list > tbody > tr > td::before { margin: 0 0 0 4px; letter-spacing: 0; text-transform: none; }
    #main .xcrud-list > tbody > tr > td.xcrud-num, #omc-today-list .xcrud-list > tbody > tr > td.xcrud-num { display: none; }
    #main .xcrud-list > tbody > tr > td:has(.omc-plink), #omc-today-list .xcrud-list > tbody > tr > td:has(.omc-plink) { width: 100%; font-size: 16px; }
    #main .xcrud-list > tbody > tr > td:has(.omc-plink)::before, #omc-today-list .xcrud-list > tbody > tr > td:has(.omc-plink)::before { display: none; }
    #main .xcrud-list > tbody > tr > td.xcrud-actions, #omc-today-list .xcrud-list > tbody > tr > td.xcrud-actions { width: 100%; margin-top: 8px; }
    #main .xcrud-list td.xcrud-actions::before, #omc-today-list .xcrud-list td.xcrud-actions::before { display: none; }
    #main .xcrud-list td.xcrud-actions .btn-group, #omc-today-list .xcrud-list td.xcrud-actions .btn-group { position: static !important; display: flex !important; gap: 6px; }
    #main .xcrud-list td.xcrud-actions .btn-group > .btn, #omc-today-list .xcrud-list td.xcrud-actions .btn-group > .btn { flex: 1; height: 38px; line-height: 36px; margin: 0; }
    #main .xcrud-list td.xcrud-actions-fixed, #omc-today-list .xcrud-list td.xcrud-actions-fixed { position: static !important; background: none !important; }
    #main .xcrud-list > tbody > tr.xcrud-tf, #main .xcrud-list > tfoot, #omc-today-list .xcrud-list > tfoot { display: block; }
    #main .xcrud-nav, #omc-today-list .xcrud-nav { justify-content: center; }
    #main .xcrud-top-actions .btn-group.pull-right { float: none !important; display: flex; margin-top: 8px; }
}


/* ================================================================== v2.1 — motion & smoothness */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.omc-nav { overscroll-behavior: contain; }
.omc-top { will-change: transform; }

/* welcome splash (first open only) */
.omc-splash { display: none; }
.omc-first .omc-splash {
    display: flex; position: fixed; inset: 0; z-index: 5000; align-items: center; justify-content: center;
    background: radial-gradient(900px 500px at 50% 45%, #FFFFFF 0%, #F4F1EB 70%);
    transition: opacity .6s var(--ease), transform .6s var(--ease), visibility 0s .6s;
}
.omc-splash-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.omc-splash img { width: 260px; max-width: 64vw; height: auto; opacity: 0; transform: scale(.94); animation: omc-splash-logo .9s var(--ease) .05s forwards; }
.omc-splash-line { display: block; height: 2px; width: 0; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: omc-splash-line .9s var(--ease) .35s forwards; }
.omc-splash.is-out { opacity: 0; transform: translateY(-14px) scale(1.01); visibility: hidden; }
@keyframes omc-splash-logo { to { opacity: 1; transform: none; } }
@keyframes omc-splash-line { to { width: 160px; } }
.omc-first body:not(.omc-ready) .omc-side, .omc-first body:not(.omc-ready) .omc-page { opacity: 0; }

/* after the splash the app glides in piece by piece */
.omc-intro .omc-side { animation: omc-side-in .7s var(--ease) both; }
.omc-intro.omc-rtl .omc-side { animation-name: omc-side-in-rtl; }
.omc-intro .omc-nav-link { animation: omc-in .5s var(--ease) both; }
.omc-intro .omc-nav-group:nth-child(1) .omc-nav-link { animation-delay: .12s; }
.omc-intro .omc-nav-group:nth-child(2) .omc-nav-link { animation-delay: .2s; }
.omc-intro .omc-nav-group:nth-child(3) .omc-nav-link { animation-delay: .28s; }
.omc-intro .omc-nav-group:nth-child(4) .omc-nav-link { animation-delay: .36s; }
.omc-intro .omc-top { animation: omc-down .6s var(--ease) .1s both; }
.omc-intro .omc-main { animation: omc-in .7s var(--ease) .18s both; }
@keyframes omc-side-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes omc-side-in-rtl { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes omc-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@media (max-width: 991px) { .omc-intro .omc-side { animation: none; } }

/* every page: cards arrive one after another */
.omc-enter > *, .omc-stats > *, .omc-col-main > *, .omc-col-side > *, .omc-grid-2 > * { animation: omc-in .5s var(--ease) both; }
.omc-enter > *:nth-child(2), .omc-stats > *:nth-child(2), .omc-col-main > *:nth-child(2), .omc-col-side > *:nth-child(2), .omc-grid-2 > *:nth-child(2) { animation-delay: .05s; }
.omc-enter > *:nth-child(3), .omc-stats > *:nth-child(3), .omc-col-main > *:nth-child(3), .omc-col-side > *:nth-child(3) { animation-delay: .1s; }
.omc-enter > *:nth-child(4), .omc-stats > *:nth-child(4), .omc-col-side > *:nth-child(4) { animation-delay: .15s; }
.omc-enter > *:nth-child(5) { animation-delay: .2s; }
.omc-enter > *:nth-child(n+6) { animation-delay: .25s; }
.omc-enter { animation-duration: .25s; }

/* tables: rows glide in, and page changes cross-fade instead of jumping */
.omc-row-in { animation: omc-row .42s var(--ease) both; }
@keyframes omc-row { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#main .xcrud-ajax, #omc-today-list .xcrud-ajax { transition: opacity .2s ease; }
.omc-busy .xcrud-list-container { opacity: .45; transition: opacity .15s ease; }
.omc-busy .xcrud-overlay, #main .xcrud-overlay { background-image: none !important; background-color: transparent !important; }
#main .xcrud-list > tbody > tr, #omc-today-list .xcrud-list > tbody > tr { transition: background-color .18s ease; }
#main a.omc-plink, #omc-today-list a.omc-plink { transition: color .18s ease, border-color .18s ease; }

/* No | Yes switch (replaces the DM / HTN checkboxes) */
.omc-yn-native { position: absolute !important; opacity: 0 !important; width: 1px !important; height: 1px !important; pointer-events: none; }
.omc-yn {
    position: relative; display: inline-flex; padding: 3px; border-radius: 10px; background: var(--taupe-soft);
    border: 1px solid var(--line); vertical-align: middle; isolation: isolate; user-select: none;
}
.omc-yn button {
    position: relative; z-index: 1; min-width: 64px; height: 32px; border: 0; background: none; border-radius: 8px;
    font: 600 14px var(--font); color: var(--muted); cursor: pointer; transition: color .25s ease;
}
.omc-yn-thumb {
    position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 8px;
    background: var(--surface); box-shadow: 0 1px 3px rgba(60, 45, 20, .15); transition: transform .3s var(--ease), background .3s ease;
}
.omc-yn:not(.is-yes) button[data-v="0"] { color: var(--text); }
.omc-yn.is-yes .omc-yn-thumb { transform: translateX(100%); background: var(--gold); }
.omc-yn.is-yes button[data-v="1"] { color: #fff; }
.omc-rtl .omc-yn-thumb { left: auto; right: 3px; }
.omc-rtl .omc-yn.is-yes .omc-yn-thumb { transform: translateX(-100%); }
.omc-facts dd.omc-yes { color: var(--danger); }
.omc-facts dd.omc-no { color: var(--muted); font-weight: 500; }

/* login: pieces arrive one after another, logo gets a soft gold shine */
.omc-login-card { animation: omc-card-in .8s var(--ease) both; }
.omc-login-card > * { animation: omc-in .6s var(--ease) both; }
.omc-login-card > *:nth-child(1) { animation-delay: .15s; }
.omc-login-card > *:nth-child(2) { animation-delay: .25s; }
.omc-login-card > *:nth-child(3) { animation-delay: .3s; }
.omc-login-card > *:nth-child(4) { animation-delay: .35s; }
.omc-login-card > *:nth-child(5) { animation-delay: .4s; }
.omc-login-foot { animation: omc-fade 1s ease .6s both; }
@keyframes omc-card-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.omc-login-logo-wrap { position: relative; width: 210px; max-width: 70%; margin: 0 auto 22px; overflow: hidden; }
.omc-login-logo-wrap .omc-login-logo { width: 100%; max-width: none; margin: 0; }
.omc-login-logo-wrap::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
    transform: skewX(-18deg); animation: omc-shine 1.4s var(--ease) .7s both;
}
@keyframes omc-shine { from { left: -60%; } to { left: 130%; } }
body.omc .omc-btn.is-busy { opacity: .85; pointer-events: none; }
#main .xcrud-top-actions .btn-group:not(.pull-right) { display: inline-flex; gap: 6px; float: none; }
#main .xcrud-top-actions .btn-group:not(.pull-right) > .btn { border-radius: 9px !important; margin: 0; }

/* ================================================================== v2.2 — doctor & insurance */
.omc-filterbar { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 14px 0 0; animation: omc-in .4s var(--ease) both; }
.omc-fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.omc-flabel { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
body.omc .omc-fchip {
    display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 99px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 500;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .1s ease;
}
body.omc .omc-fchip:hover { border-color: var(--gold); color: var(--text); }
body.omc .omc-fchip:active { transform: scale(.97); }
body.omc .omc-fchip.is-on { background: var(--text); border-color: var(--text); color: #fff; }
.omc-chip-ins { background: #E6EFF8; color: #2F5F8C; }
.omc-ins { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.omc-ins-pick { flex: 1; min-width: 200px; max-width: 0; opacity: 0; overflow: hidden; transform: translateX(-8px);
    transition: max-width .35s var(--ease), opacity .25s ease, transform .35s var(--ease); }
.omc-ins.is-open .omc-ins-pick { max-width: 640px; opacity: 1; transform: none; }
.omc-ins:not(.is-open) .omc-ins-pick { min-width: 0; flex: 0; }
.omc-rtl .omc-ins-pick { transform: translateX(8px); }
.omc-banner {
    display: flex; align-items: center; gap: 12px; padding: 13px 16px; margin: -6px 0 18px; border-radius: 12px;
    background: linear-gradient(90deg, var(--gold-soft), #FBF7EF); border: 1px solid #E8D9BC; color: #5A4524 !important;
    animation: omc-in .5s var(--ease) both;
}
.omc-banner .fa-magic { color: var(--gold-ink); font-size: 18px; }
.omc-banner span:nth-child(2) { flex: 1; }
.omc-banner-go { font-weight: 600; color: var(--gold-ink); white-space: nowrap; }
.omc-banner:hover { border-color: var(--gold); }
.omc-setup-list { margin: 8px 0 14px; padding-left: 20px; }
.omc-setup-list li { margin: 4px 0; }
.omc-setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.omc-setup-grid > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.omc-setup-grid b { float: right; }
.omc-setup .omc-card p { margin: 0 0 10px; }
#main .xcrud-list > tbody > tr > td[data-label="Doctor"], #main .xcrud-list > tbody > tr > td[data-label="Insurance"],
#main .xcrud-list > tbody > tr > td[data-label*="Date"], #main .xcrud-list > tbody > tr > td[data-label*="Name"],
#omc-today-list .xcrud-list > tbody > tr > td[data-label="Doctor"], #omc-today-list .xcrud-list > tbody > tr > td[data-label*="Name"],
#main .xcrud-list > tbody > tr > td.xcrud-actions, #omc-today-list .xcrud-list > tbody > tr > td.xcrud-actions { white-space: nowrap; }

/* v2.3 */
#omc-today-list .omc-filterbar { padding: 4px 20px 0; margin-top: 6px; }
@keyframes omc-flash { 0% { box-shadow: 0 0 0 0 rgba(176,147,95,.6); } 100% { box-shadow: 0 0 0 10px rgba(176,147,95,0); } }
#main select.omc-flash { animation: omc-flash .8s ease-out; border-color: var(--gold); }
@media (max-width: 720px) {
    .omc-filterbar { flex-wrap: nowrap; flex-direction: column; gap: 8px; }
    .omc-fgroup { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
    .omc-fgroup::-webkit-scrollbar { display: none; }
    .omc-fchip { flex: none; }
    #omc-today-list .omc-filterbar { padding: 4px 10px 0; }
}

/* ================================================================== v2.4 — hover & tab motion */
/* patient / visit rows */
#main .xcrud-list > tbody > tr, #omc-today-list .xcrud-list > tbody > tr {
    transition: background-color .25s var(--ease), box-shadow .25s var(--ease);
}
#main .xcrud-list > tbody > tr:has(.omc-plink), #omc-today-list .xcrud-list > tbody > tr:has(.omc-plink) { cursor: pointer; }
#main .table-hover > tbody > tr:hover, #omc-today-list .table-hover > tbody > tr:hover,
#main .xcrud-list > tbody > tr:hover, #omc-today-list .xcrud-list > tbody > tr:hover {
    background-color: #F7EEDD;
    box-shadow: inset 4px 0 0 var(--gold);
}
.omc-rtl #main .xcrud-list > tbody > tr:hover, .omc-rtl #omc-today-list .xcrud-list > tbody > tr:hover { box-shadow: inset -4px 0 0 var(--gold); }
#main .xcrud-list > tbody > tr a.omc-plink, #omc-today-list .xcrud-list > tbody > tr a.omc-plink {
    display: inline-block; transition: color .25s var(--ease), transform .25s var(--ease);
}
#main .xcrud-list > tbody > tr:hover a.omc-plink, #omc-today-list .xcrud-list > tbody > tr:hover a.omc-plink {
    color: var(--gold-ink); transform: translateX(3px);
}
.omc-rtl #main .xcrud-list > tbody > tr:hover a.omc-plink, .omc-rtl #omc-today-list .xcrud-list > tbody > tr:hover a.omc-plink { transform: translateX(-3px); }
.omc-row-press { background-color: #F1E3C7 !important; transition: background-color .05s !important; }
#main .xcrud-list .btn, #omc-today-list .xcrud-list .btn { transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s var(--ease); }
#main .xcrud-list .btn:hover, #omc-today-list .xcrud-list .btn:hover { transform: translateY(-1px); }
@media (max-width: 720px) {
    #main .xcrud-list > tbody > tr:hover, #omc-today-list .xcrud-list > tbody > tr:hover { box-shadow: inset 4px 0 0 var(--gold); }
}

/* sidebar */
body.omc .omc-nav-link .fa { transition: color .2s ease, transform .25s var(--ease); }
body.omc .omc-nav-link:hover .fa { transform: translateX(2px) scale(1.08); color: var(--gold-ink); }
.omc-rtl .omc-nav-link:hover .fa { transform: translateX(-2px) scale(1.08); }
.omc-nav-link.is-active::before { animation: omc-ink-in .35s var(--ease) both; transform-origin: center; }
@keyframes omc-ink-in { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }

/* cards, buttons, chips */
.omc-stat, .omc-grid-2 > .omc-card, .omc-col-side > .omc-card { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s ease; }
.omc-stat:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(60, 45, 20, .10); border-color: #E3D6BF; }
body.omc .omc-btn { transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s var(--ease), box-shadow .2s ease; }
body.omc .omc-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(60, 45, 20, .10); }
body.omc .omc-btn-primary:hover { box-shadow: 0 6px 16px rgba(176, 147, 95, .4); }
body.omc .omc-li { transition: background .2s ease, transform .25s var(--ease); }
body.omc .omc-li:hover { transform: translateX(3px); }
body.omc .omc-li .fa-angle-right { transition: transform .25s var(--ease), color .2s; }
body.omc .omc-li:hover .fa-angle-right { transform: translateX(3px); color: var(--gold-ink); }
.omc-sr { transition: background .18s ease; }
.omc-tl-item:hover .omc-tl-dot { transform: scale(1.08); }
.omc-tl-dot { transition: transform .25s var(--ease); }
body.omc .omc-fchip:hover { transform: translateY(-1px); }

/* tabs: gliding gold line + sliding content */
#main .nav-tabs.omc-tabs { position: relative; }
#main .nav-tabs.omc-tabs > li.active > a, #main .nav-tabs.omc-tabs > li.active > a:hover, #main .nav-tabs.omc-tabs > li.active > a:focus { border-bottom-color: transparent; }
#main .nav-tabs.omc-tabs > li > a { transition: color .25s ease, background .25s ease; border-radius: 8px 8px 0 0; }
#main .nav-tabs.omc-tabs > li > a:hover { background: var(--surface-2); border-bottom-color: transparent; }
.omc-tab-ink {
    position: absolute; left: 0; top: 0; height: 2px; width: 0; border-radius: 2px; background: var(--gold);
    pointer-events: none; transition: transform .38s var(--ease), width .38s var(--ease);
}
.omc-pane-right { animation: omc-pane-r .38s var(--ease) both; }
.omc-pane-left { animation: omc-pane-l .38s var(--ease) both; }
@keyframes omc-pane-r { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes omc-pane-l { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.omc-main { overflow-x: clip; }

/* history filter chips: the dark pill eases between choices */
.omc-filter { transition: background .25s var(--ease), color .25s ease, border-color .25s ease, transform .15s ease; }
.omc-filter:active { transform: scale(.96); }

/* moving between pages: old page eases out */
.omc-view.is-leaving { opacity: .25; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; }

/* ================================================================== v2.5 — diagnosis / complaint suggestions */
.omc-sug {
    position: absolute; z-index: 4000; max-width: 560px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; font-family: var(--font);
    opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none; transition: opacity .16s ease, transform .2s var(--ease);
}
.omc-sug.is-open { opacity: 1; transform: none; pointer-events: auto; }
.omc-sug-head { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 8px 6px; display: flex; justify-content: space-between; gap: 12px; }
.omc-sug-head span { text-transform: none; letter-spacing: 0; font-weight: 500; color: #A99E8E; }
.omc-sug-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14.5px; color: var(--text); transition: background .12s ease; }
.omc-sug-item b { color: var(--gold-ink); font-weight: 700; }
.omc-sug-item em { font-style: normal; font-size: 11.5px; color: var(--muted); background: var(--taupe-soft); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.omc-sug-item.is-active, .omc-sug-item:hover { background: var(--gold-soft); }
@media (max-width: 720px) { .omc-sug-head span { display: none; } }

/* v2.6 — dated notes */
.omc-tl-note .omc-tl-dot { color: #8A6F42; border-color: #E8D9BC; background: #FBF5EA; }
body.omc .omc-linkbtn { background: none; border: 0; padding: 0; margin-top: 6px; cursor: pointer; font-family: var(--font); color: var(--gold-ink); }

/* v2.7 — visit form: patient name + link to the patient file */
body.omc .omc-vpatient { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 38px; }
body.omc .omc-vpatient-name { font-weight: 600; }
body.omc .omc-btn.omc-btn-sm { padding: 5px 12px; font-size: 13px; min-height: 0; }

/* v2.8: photos card on the reception patient file */
.omc-reception-photos { max-width: 760px; margin-top: 18px; }
.omc-up .omc-up-pdf { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--gold); flex: none; }
.omc-g-file .fa-file-pdf-o { font-size: 26px; }
.omc-reception-photos .omc-gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }


/* v3.8: Diabetes 3-way switch (No | Type 1 | Type 2) + allergy warnings */
.omc-yn3 button { min-width: 76px; transition: color .25s ease, background .25s ease, box-shadow .25s ease; }
.omc-yn.omc-yn3 button.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(60, 45, 20, .15); }
.omc-yn.omc-yn3.is-yes button.is-on { background: var(--gold); color: #fff; }
.omc-yn-note { margin-inline-start: 10px; font-size: 13px; font-weight: 600; color: #b3261e; vertical-align: middle; }
.omc-chip.omc-chip-allergy { background: #fdecea; color: #b3261e; border: 1px solid #f1aca5; font-weight: 700; }
.omc-allergy-dd { color: #b3261e !important; font-weight: 700; }