@charset "UTF-8";
/* ==========================================================================
   Mantiscope Modern Theme
   Loaded AFTER the legacy Bulkit/Bulma stylesheets — overrides only.
   Palette: deep navy #0f172a / teal #0d9488 / slate neutrals
   ========================================================================== */

:root {
    --m-brand: #0d9488;
    --m-brand-dark: #0f766e;
    --m-brand-light: #ccfbf1;
    --m-navy: #0f172a;
    --m-navy-2: #1e293b;
    --m-navy-3: #334155;
    --m-bg: #f1f5f9;
    --m-card: #ffffff;
    --m-border: #e2e8f0;
    --m-text: #0f172a;
    --m-text-soft: #475569;
    --m-text-muted: #94a3b8;
    --m-danger: #e11d48;
    --m-warning: #f59e0b;
    --m-success: #10b981;
    --m-info: #3b82f6;
    --m-radius: 12px;
    --m-radius-sm: 8px;
    --m-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.06);
    --m-shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 12px 28px rgba(15, 23, 42, 0.1);
}

/* --------------------------------------------------------------------------
   1. Base
   -------------------------------------------------------------------------- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    background-color: var(--m-bg) !important;
    color: var(--m-text-soft);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: var(--m-text);
    font-weight: 700;
}

a { color: var(--m-brand); }
a:hover { color: var(--m-brand-dark); }

::selection { background: var(--m-brand-light); color: var(--m-navy); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--m-text-muted); }

/* Page loaders */
.pageloader,
.infraloader {
    background: linear-gradient(135deg, var(--m-navy) 0%, var(--m-brand-dark) 100%) !important;
    background-color: var(--m-brand) !important;
}

/* --------------------------------------------------------------------------
   2. Icon sidebar (.main-menu)
   -------------------------------------------------------------------------- */
.main-menu {
    background: var(--m-navy) !important;
    border-right: 1px solid var(--m-navy) !important;
}
.main-menu .main-menu-inner ul li a { color: #cbd5e1; }
.main-menu .main-menu-inner .side-icon i { color: #64748b; transition: color .2s; }
.main-menu .main-menu-inner .side-icon.is-active i,
.main-menu .main-menu-inner .side-icon:hover i { color: #2dd4bf !important; }
.main-menu .main-menu-inner .side-icon.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 28px;
    border-radius: 0 3px 3px 0;
    background: #2dd4bf;
}
.main-menu .main-menu-inner .side-icon { position: relative; }
.main-menu .main-menu-inner .profile .dot { background: var(--m-success) !important; border: 2px solid var(--m-navy); }

/* --------------------------------------------------------------------------
   3. Child push menu (.child-menu) — was bright violet
   -------------------------------------------------------------------------- */
.child-menu {
    background: var(--m-navy-2) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.25);
}
.child-menu .child-header { border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important; }
.child-menu .sidebar-title {
    color: #94a3b8 !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
}
.child-menu .sidebar-menu li a {
    color: #e2e8f0 !important;
    font-size: 0.92rem;
    border-radius: var(--m-radius-sm);
    margin: 2px 10px;
    padding: 14px 15px !important;
    transition: background .2s, color .2s;
}
.child-menu .sidebar-menu li a span { color: #5eead4 !important; }
.child-menu .sidebar-menu li a:hover {
    background-color: rgba(45, 212, 191, 0.12) !important;
    color: #fff !important;
    padding: 14px 15px !important;
}
.child-menu li.have-children.active { background-color: transparent !important; }
.child-menu li.have-children ul { background-color: rgba(15, 23, 42, 0.45) !important; border-radius: var(--m-radius-sm); margin: 0 10px; }
.child-menu li.have-children ul li a { margin: 0; }

/* --------------------------------------------------------------------------
   4. Top navbar
   -------------------------------------------------------------------------- */
nav.dashboard-nav,
.nav.dashboard-nav {
    background: rgba(255, 255, 255, 0.92) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: none !important;
    border-bottom: 1px solid var(--m-border);
}
nav.dashboard-nav .logout-button:hover { background: var(--m-brand-light) !important; }
nav.dashboard-nav .logout-button:hover i { color: var(--m-brand-dark) !important; }
nav.dashboard-nav .chat-button { background: var(--m-brand) !important; }

.searchbox .input,
.searchbox input {
    border-radius: 999px !important;
    background: var(--m-bg) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    transition: border-color .2s, background .2s;
}
.searchbox .input:focus,
.searchbox input:focus {
    background: #fff !important;
    border-color: var(--m-brand) !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15) !important;
}

/* Notifications / organizations dropdown */
.drop-wrapper .drop-inner,
.notifications-drop .drop-inner {
    border-radius: var(--m-radius) !important;
    border: 1px solid var(--m-border) !important;
    box-shadow: var(--m-shadow-lg) !important;
    overflow: hidden;
}
.notifications-header { background: var(--m-navy) !important; }
.notifications-header h3 { color: #fff !important; font-size: 0.85rem !important; letter-spacing: 1px; text-transform: uppercase; }
ul.notifications-list li:hover { background: var(--m-bg) !important; }

/* --------------------------------------------------------------------------
   5. Cards
   -------------------------------------------------------------------------- */
.flex-card {
    border: 1px solid var(--m-border) !important;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow) !important;
    overflow: hidden;
}
.flex-card.light-raised,
.flex-card.raised { box-shadow: var(--m-shadow) !important; }
.flex-card:hover { box-shadow: var(--m-shadow-lg) !important; }

h3.card-heading, .card-heading {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--m-text-muted) !important;
    padding: 16px 20px 8px 20px;
}

/* Legacy fixed-size modal in head.php (inline styles load after us → !important) */
.modalDialog > div {
    background: #fff !important;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow-lg) !important;
    border: 1px solid var(--m-border);
}
.modalDialog { background: rgba(15, 23, 42, 0.6) !important; }
.close { background: var(--m-navy-2) !important; border-radius: 999px !important; box-shadow: var(--m-shadow) !important; }
.close:hover { background: var(--m-brand) !important; }

/* --------------------------------------------------------------------------
   6. Buttons  (Bulma + Bulkit + Bootstrap 3 legacy)
   -------------------------------------------------------------------------- */
.button {
    border-radius: var(--m-radius-sm) !important;
    font-weight: 600;
    transition: all .2s;
}
.button.secondary-btn,
.button.primary-btn,
.button.button-cta,
.button.is-primary,
.button.is-secondary {
    background: var(--m-brand) !important;
    border-color: var(--m-brand) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35) !important;
}
.button.secondary-btn:hover,
.button.primary-btn:hover,
.button.button-cta:hover,
.button.is-primary:hover,
.button.is-secondary:hover {
    background: var(--m-brand-dark) !important;
    border-color: var(--m-brand-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4) !important;
}
.button.secondary-btn.btn-outlined,
.button.primary-btn.btn-outlined {
    background: transparent !important;
    color: var(--m-brand) !important;
    border: 1.5px solid var(--m-brand) !important;
    box-shadow: none !important;
}
.button.secondary-btn.btn-outlined:hover,
.button.primary-btn.btn-outlined:hover {
    background: var(--m-brand) !important;
    color: #fff !important;
}
.button.is-danger { background: var(--m-danger) !important; border-color: var(--m-danger) !important; }
.button.is-success { background: var(--m-success) !important; border-color: var(--m-success) !important; }

/* Bootstrap 3 leftovers */
.btn { border-radius: var(--m-radius-sm); font-weight: 600; }
.btn-primary, .btn-info {
    background: var(--m-brand) !important;
    border-color: var(--m-brand) !important;
}
.btn-primary:hover, .btn-info:hover {
    background: var(--m-brand-dark) !important;
    border-color: var(--m-brand-dark) !important;
}
.btn-danger { background: var(--m-danger) !important; border-color: var(--m-danger) !important; }
.btn-success { background: var(--m-success) !important; border-color: var(--m-success) !important; }

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */
.input, .textarea, select, .form-control {
    border-radius: var(--m-radius-sm) !important;
    border: 1px solid #cbd5e1;
    color: var(--m-text);
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, select:focus, .form-control:focus,
.input.is-secondary-focus:focus {
    border-color: var(--m-brand) !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15) !important;
    outline: none;
}
label { color: var(--m-text-soft); font-weight: 500; }

/* Material inputs on login / signup */
.control-material .bar:before, .control-material .bar:after { background: var(--m-brand) !important; }
.control-material.is-secondary .material-input:focus ~ label,
.control-material.is-secondary .material-input:valid ~ label,
.control-material .material-input:focus ~ label { color: var(--m-brand) !important; }
.control-material .material-highlight { background: rgba(13, 148, 136, 0.1) !important; }

/* Checkboxes */
.checkbox-wrap input:checked + span { background: var(--m-brand) !important; border-color: var(--m-brand) !important; }

/* Chosen selects */
.chosen-container-single .chosen-single {
    border-radius: var(--m-radius-sm) !important;
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    box-shadow: none !important;
    height: 38px !important;
    line-height: 38px !important;
    color: var(--m-text);
}
.chosen-container .chosen-drop {
    border-radius: 0 0 var(--m-radius-sm) var(--m-radius-sm) !important;
    border-color: var(--m-border) !important;
    box-shadow: var(--m-shadow-lg) !important;
}
.chosen-container .chosen-results li.highlighted { background: var(--m-brand) !important; }

/* --------------------------------------------------------------------------
   8. Tables
   -------------------------------------------------------------------------- */
table { border-color: var(--m-border) !important; }
table th, .table th {
    background: #f8fafc !important;
    color: var(--m-text-muted) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--m-border) !important;
}
table td, .table td {
    border-color: #eef2f7 !important;
    color: var(--m-text-soft);
    vertical-align: middle;
}
table tbody tr { transition: background .15s; }
table tbody tr:hover { background: #f8fafc; }

/* --------------------------------------------------------------------------
   9. Lists, badges, breadcrumbs, misc
   -------------------------------------------------------------------------- */
.feed-channels.list-block li,
.list-block li {
    border-radius: var(--m-radius-sm);
    transition: background .15s;
}
.list-block li.is-active,
.list-block li.is-active:hover {
    background: var(--m-brand-light) !important;
}
.list-block li.is-active a { color: var(--m-brand-dark) !important; font-weight: 600; }
.list-block li.is-active .b-badge { background: var(--m-brand) !important; }
.feed-channels li a:hover { color: var(--m-brand) !important; }

.b-badge.is-primary, .b-badge { background: var(--m-brand) !important; }
.tag.is-primary { background: var(--m-brand) !important; }
.new-circle { background: var(--m-danger) !important; }

.breadcrumbs li a { color: var(--m-text-muted); }
.breadcrumbs li a:hover { color: var(--m-brand); }

#anloader.spinner .spinner-icon {
    border-top-color: var(--m-brand) !important;
    border-left-color: var(--m-brand) !important;
}

/* Alert blocks that used inline red/steel-blue backgrounds keep their inline
   styles; give the generic .alert a modern face where no inline bg is set */
.alert { border-radius: var(--m-radius-sm); }

/* --------------------------------------------------------------------------
   10. Login / signup / landing pages
   -------------------------------------------------------------------------- */
.hero.hero-wavy,
.hero.is-light-grey {
    background: linear-gradient(160deg, #f8fafc 0%, #e6f7f4 55%, #d3f1ec 100%) !important;
}
.clean-login-card,
.flex-card.clean-login-card {
    border-radius: 16px !important;
    border: 1px solid var(--m-border) !important;
    box-shadow: var(--m-shadow-lg) !important;
    padding: 10px 20px 20px 20px;
}
.clean-login-card h2 {
    color: var(--m-navy) !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
}
a.no-account, .no-account.is-secondary { color: var(--m-brand) !important; font-weight: 500; }
a.no-account:hover { color: var(--m-brand-dark) !important; text-decoration: underline; }

.footer.footer-light { background: #fff !important; border-top: 1px solid var(--m-border); }

/* --------------------------------------------------------------------------
   11. Fancybox / modals
   -------------------------------------------------------------------------- */
.fancybox-skin {
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow-lg) !important;
}
.modal-content { border-radius: var(--m-radius); border: 1px solid var(--m-border); box-shadow: var(--m-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--m-border); }
.modal-footer { border-top: 1px solid var(--m-border); }

/* --------------------------------------------------------------------------
   11b. Main page (dashboard feed) polish
   -------------------------------------------------------------------------- */

/* Report feed cards */
.post-item {
    border: 1px solid var(--m-border) !important;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow) !important;
    margin: 20px 0 !important;
}
.post-item > .is-flex { gap: 10px; }
.post-item .is-flex.padding-10 { padding: 14px 16px !important; }
.post-item .item-title { color: var(--m-text) !important; margin-left: 4px !important; }
.post-item .item-title a { color: var(--m-brand) !important; }
.post-item .item-title .feed-time-small { color: var(--m-text-muted) !important; font-size: 11px !important; }
.post-item p { color: var(--m-text-soft); }

/* Kill the dark wash that dimmed every report image */
.post-item .feed-image-container .soft-overlay { background: transparent !important; }

/* Report delete button reads as destructive */
.post-item button[onclick^="DeleteReport"] {
    background: #fff !important;
    color: var(--m-danger) !important;
    border: 1.5px solid var(--m-danger) !important;
    box-shadow: none !important;
}
.post-item button[onclick^="DeleteReport"]:hover {
    background: var(--m-danger) !important;
    color: #fff !important;
}

/* Image carousel band */
.jcarousel-wrapper {
    border: none !important;
    border-radius: var(--m-radius-sm) !important;
    box-shadow: none !important;
    background: var(--m-bg) !important;
    overflow: hidden;
}
.jcarousel { background: var(--m-bg) !important; }

.jcarousel li img { border-radius: var(--m-radius-sm); }

/*
 * Report image in the feed panel.
 *
 * The markup carried width="600px". The HTML width attribute takes a bare
 * number, so "600px" was invalid, browsers ignored it, and the image rendered
 * at natural size. Nothing else bounded it either: dashboard.css sets
 * `.feed-image-container img{max-width:100%}`, but jcarousel.basic.css sets
 * `.jcarousel ul{width:10000em}`, so that percentage resolves against 10000em.
 *
 * These feed carousels only ever hold ONE image (the PHP loop breaks after the
 * first row), so the carousel track can be collapsed to normal flow and the
 * image allowed to fill the panel at its natural aspect ratio - nothing
 * cropped, nothing clipped.
 *
 * Scoped to .feed-image-container on purpose: showpicture.php uses a genuine
 * two-item jcarousel (original + AI side by side) that still needs the
 * 10000em track and floated items to scroll.
 */
.post-item .feed-image-container .jcarousel-wrapper {
    width: 100% !important;
    max-width: 100%;
    margin: 0;
}

.post-item .feed-image-container .jcarousel {
    overflow: visible;
}

.post-item .feed-image-container .jcarousel ul {
    width: 100% !important;
}

.post-item .feed-image-container .jcarousel li {
    float: none !important;
    width: 100%;
}

.post-item .feed-image-container .jcarousel li a {
    display: block;
}

.post-item .feed-image-container .jcarousel li img {
    float: none !important;
    width: 100%;
    max-width: 100%;
    height: auto;          /* full image, aspect ratio preserved */
    display: block;
}

/* ---------------------------------------------------------------------------
 * Report card header
 *
 * Replaces the old single `is-flex is-start is-vcenter padding-10` row, where
 * the id, patient, date, doctor, image count and buttons were all siblings
 * jammed together with no structure (and a `style="left:20px"` on the delete
 * button that did nothing, since the element was never positioned).
 *
 * Three zones: avatar, identity (grows), actions (pinned right). Wraps to two
 * rows on narrow screens rather than overflowing.
 * ------------------------------------------------------------------------- */
.report-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--m-border);
}

/* Identity block: takes the slack, truncates instead of pushing actions off. */
.report-head-main {
    flex: 1 1 200px;
    min-width: 0;
}

.report-head-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.3;
}

.report-id {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--m-brand-dark);
    background: var(--m-brand-light);
    border-radius: var(--m-radius-sm);
    padding: 2px 8px;
}

.report-patient {
    font-weight: 600;
    color: var(--m-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.report-head-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--m-text-muted);
}

/*
 * Separator between meta items.
 *
 * This was a literal U+2022 bullet. The stylesheet is served as `text/css` with no
 * charset parameter and carried no @charset rule, so that byte sequence was
 * not decoded as UTF-8 and rendered as a question mark in every report header.
 * Drawn as a shape instead - no character, so no encoding can break it.
 */
.report-head-meta > * + * {
    position: relative;
    padding-left: 12px;
}

.report-head-meta > * + *::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    width: 3px;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.45;
}

.report-head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* Image-count chip - was previously a bare `echo "Total : N"` in the flex row */
.report-stat {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--m-text-soft);
    background: var(--m-bg);
    border: 1px solid var(--m-border);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.report-head-actions .fab-btn.mini,
.report-head-actions .notifications {
    margin: 0 !important;
    top: 0 !important;
    position: static !important;
}

.report-btn-delete {
    border: 1px solid var(--m-border);
    background: var(--m-card);
    color: var(--m-danger);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--m-radius-sm);
    padding: 5px 12px;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.report-btn-delete:hover {
    background: var(--m-danger);
    border-color: var(--m-danger);
    color: #fff;
}

@media (max-width: 640px) {
    .report-head-actions {
        margin-left: 0;      /* no avatar to indent past */
        width: 100%;
    }
}

/* The overlay sits above the image; keep it from intercepting the click. */
.post-item .feed-image-container .soft-overlay {
    pointer-events: none;
}

/* Avatars: give the placeholder silhouettes a neutral chip background */
.post-item .feed-avatar,
.user-list .user-list-avatar img,
.comment-list .media-left img {
    background: var(--m-border);
    object-fit: cover;
}
.comment-list .media-left img { border-radius: 50%; width: 36px; height: 36px; }

/* Left column profile block (w3-circle) as a card with a sane avatar size */
.w3-circle {
    background: #fff;
    border: 1px solid var(--m-border) !important;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow) !important;
    padding: 18px 12px;
}
.w3-circle .thumbnail {
    width: 120px !important;
    height: 120px;
    border-radius: 50%;
    background: var(--m-border);
    display: block;
    margin: 0 auto;
    object-fit: cover;
}
.w3-circle .header { text-align: center; }

/* User list names/positions in theme colors */
.user-list .user-list-info .name { color: var(--m-text) !important; }
.user-list .user-list-info .position { color: var(--m-text-muted) !important; }

/* Native checkboxes (system users list etc.) in brand color */
input[type="checkbox"] { accent-color: var(--m-brand); }

/* Initials avatars (replace placeholder silhouettes) */
.initials-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--m-brand);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .5px;
    user-select: none;
}
.initials-avatar.profile-initials {
    width: 120px;
    height: 120px;
    font-size: 42px;
    margin: 0 auto;
}
.initials-avatar.sidebar-initials {
    width: 48px;
    height: 48px;
    font-size: 17px;
    margin: 0 auto;
    margin-bottom: 20px;
}
.post-item .initials-avatar.feed-avatar { width: 36px; height: 36px; font-size: 13px; }
.comment-list .media-left .initials-avatar { width: 36px; height: 36px; font-size: 13px; }
.user-list .user-list-avatar .initials-avatar { width: 40px; height: 40px; }

/* Pie chart blocks */
.chart-card {
    background: #fff;
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    box-shadow: var(--m-shadow);
    margin: 14px 0;
    padding: 6px;
    overflow: hidden;
}
.alert.chart-empty-note {
    padding: 16px;
    margin: 14px 0;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--m-radius-sm);
    color: var(--m-text-muted);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   11c. Report wizard (newAddReportDoc / newAddReportTech / add_report pages)
   -------------------------------------------------------------------------- */

/* Step indicator: chips instead of the red-tinted bar */
.steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    background: transparent !important;
    padding: 10px 0 !important;
}
.steps li {
    margin: 0 !important;
    padding: 7px 18px !important;
    border-radius: 999px;
    border-bottom: none !important;
    background: #fff;
    border: 1px solid var(--m-border);
    color: var(--m-text-muted) !important;
    font-weight: 600;
    font-size: .85rem;
}
.steps li.is-active {
    background: var(--m-brand) !important;
    border-color: var(--m-brand) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
}

/* Wizard panels: white cards instead of translucent black */
.form-wrapper .section {
    background-color: #fff !important;
    border: 1px solid var(--m-border);
    border-radius: 16px;
    box-shadow: var(--m-shadow) !important;
    color: var(--m-text-soft);
}
.form-wrapper .section h3 { color: var(--m-text) !important; }

/* Old white-on-dark text now sits on white cards */
.form-wrapper font[color="white"],
.body font[color="white"] { color: var(--m-text-soft) !important; }

/* Wizard buttons: blue → brand teal */
.form-wrapper .button, .form-wrapper .submit {
    background-color: var(--m-brand) !important;
    border-radius: var(--m-radius-sm) !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
    transition: background .15s;
}
.form-wrapper .button:hover, .form-wrapper .submit:hover {
    background-color: var(--m-brand-dark) !important;
}

/* Inputs and the inline-styled gray selects */
.form-wrapper input[type="text"],
.form-wrapper input[type="password"] {
    background-color: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: var(--m-radius-sm) !important;
    color: var(--m-text);
}
.form-wrapper select {
    background-color: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: var(--m-radius-sm) !important;
    color: var(--m-text) !important;
    font-weight: 500 !important;
    padding: 0 10px;
}

/* Radio option cards */
.form-wrapper input[type="radio"] + label {
    border-radius: var(--m-radius-sm);
    transition: border-color .15s, background .15s;
}
.form-wrapper input[type="radio"] + label:before { background-color: var(--m-brand) !important; }
.form-wrapper input[type="radio"]:checked + label {
    border: 1px solid var(--m-brand) !important;
    background: var(--m-brand-light);
}
.form-wrapper input[type="radio"]:checked + label h4 { color: var(--m-brand-dark) !important; }

/* Fine Uploader drop zone */
.qq-uploader {
    border: 2px dashed #cbd5e1 !important;
    border-radius: var(--m-radius) !important;
    background: #f8fafc !important;
}
.qq-upload-button {
    background: var(--m-brand) !important;
    border-radius: var(--m-radius-sm) !important;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35) !important;
    font-weight: 600;
}
.qq-upload-button:hover { background: var(--m-brand-dark) !important; }
.qq-upload-drop-area, .qq-upload-extra-drop-area { background: transparent !important; }
.qq-upload-list li {
    border-radius: var(--m-radius-sm);
    background: #fff !important;
    border: 1px solid var(--m-border);
    color: var(--m-text-soft) !important;
}
.qq-progress-bar { background: var(--m-brand) !important; }

/* AI classification result tables (.tg) */
table.tg {
    border-collapse: collapse;
    margin: 10px auto;
    background: #fff;
    border: 1px solid var(--m-border) !important;
    border-radius: var(--m-radius-sm);
    overflow: hidden;
}
table.tg th, table.tg td {
    border: 1px solid #eef2f7 !important;
    padding: 8px 10px;
    color: var(--m-text-soft);
}
table.tg th { background: #f8fafc !important; color: var(--m-text-muted) !important; }

/* --------------------------------------------------------------------------
   11d. Add Person page (add_doctor.php)
   -------------------------------------------------------------------------- */
.person-photo-card {
    background: var(--m-card);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    box-shadow: var(--m-shadow);
    padding: 28px 20px;
    text-align: center;
}
.person-photo-card .person-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--m-bg);
    border: 3px solid var(--m-border);
    display: block;
    margin: 0 auto 14px auto;
}
.person-photo-card .photo-hint {
    font-size: 0.82rem;
    color: var(--m-text-muted);
    margin-bottom: 16px;
}
.photo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--m-brand);
    background: transparent;
    border: 1.5px solid var(--m-brand);
    border-radius: var(--m-radius-sm);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.photo-btn:hover { background: var(--m-brand); color: #fff; }

.person-form-card {
    background: var(--m-card);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    box-shadow: var(--m-shadow);
    padding: 26px 30px 30px 30px;
}
.person-form-card > h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--m-text);
    margin-bottom: 4px;
}
.person-form-card .form-sub {
    font-size: 0.84rem;
    color: var(--m-text-muted);
    margin-bottom: 22px;
}
.person-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}
.person-field { min-width: 0; }
.person-field.is-full { grid-column: 1 / -1; }
.person-field > label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--m-text-soft);
    margin-bottom: 6px;
}
.person-field .field-control { position: relative; }
.person-field input,
.person-field select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--m-text);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--m-radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
.person-field input:focus,
.person-field select:focus {
    border-color: var(--m-brand);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
    outline: none;
}
.person-field input:disabled {
    background: var(--m-bg);
    color: var(--m-text-muted);
    cursor: not-allowed;
}
.person-field input[type="password"] { padding-right: 38px; }
.person-field .field-hint {
    font-size: 0.72rem;
    color: var(--m-text-muted);
    margin-top: 5px;
    line-height: 1.4;
}
/* Password match indicators - toggled via style.visibility by legacy JS */
.pw-status {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
}
.pw-status.ok { color: var(--m-success); }
.pw-status.bad { color: var(--m-danger); }

.person-form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--m-border);
}
.person-submit {
    padding: 10px 32px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--m-brand);
    border: none;
    border-radius: var(--m-radius-sm);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
    transition: background .15s, box-shadow .15s;
}
.person-submit:hover { background: var(--m-brand-dark); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4); }
.person-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}
.person-alert {
    padding: 11px 16px;
    margin-bottom: 18px;
    font-size: 0.86rem;
    font-weight: 600;
    border-radius: var(--m-radius-sm);
}
.person-alert.is-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}
.person-alert.is-danger {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: var(--m-danger);
}
@media (max-width: 900px) {
    .person-fields { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   11e. IOT devices modal (newIOTdevice.php, opened in fancybox; the list is
        re-rendered by CreateIOTdevice.php / RemoveIOTdevice.php via AJAX)
   -------------------------------------------------------------------------- */
.iot-modal {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--m-text-soft);
    padding: 6px 4px;
    min-width: 0;
}
.iot-modal > h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--m-text);
    margin-bottom: 4px;
}
.iot-modal .form-sub {
    font-size: 0.84rem;
    color: var(--m-text-muted);
    margin-bottom: 18px;
}
.iot-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}
.iot-form-row input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--m-text);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--m-radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
.iot-form-row input[type="text"]:focus {
    border-color: var(--m-brand);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
    outline: none;
}
.iot-add-btn {
    flex: 0 0 auto;
    padding: 0 24px;
    height: 42px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    background: var(--m-brand);
    border: none;
    border-radius: var(--m-radius-sm);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
    transition: background .15s;
}
.iot-add-btn:hover { background: var(--m-brand-dark); }

.iot-list-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--m-text-muted);
    margin-bottom: 8px;
}
.iot-table-wrap {
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius-sm);
    overflow-x: auto;
    background: #fff;
}
table.iot-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-family: inherit;
}
.iot-table th {
    padding: 10px 14px;
    text-align: left;
    background: #f8fafc;
    color: var(--m-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--m-border);
    white-space: nowrap;
}
.iot-table td {
    padding: 10px 14px;
    font-size: 0.86rem;
    color: var(--m-text-soft);
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}
.iot-table tbody tr:last-child td { border-bottom: 0; }
.iot-table tbody tr:hover td { background: #f8fafc; }
.iot-table .iot-name { color: var(--m-text); font-weight: 600; white-space: nowrap; }
.iot-type-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--m-brand-dark);
    background: var(--m-brand-light);
    border-radius: 999px;
    vertical-align: middle;
}
.iot-key {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.76rem;
    color: var(--m-text-muted);
    word-break: break-all;
}
.iot-table .iot-action { text-align: right; white-space: nowrap; }
a.iot-remove {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--m-danger);
    background: #fff;
    border: 1px solid var(--m-border);
    border-radius: 999px;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
a.iot-remove:hover {
    background: var(--m-danger);
    border-color: var(--m-danger);
    color: #fff;
}
.iot-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--m-text-muted);
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--m-radius-sm);
}

/* --------------------------------------------------------------------------
   12. Legacy violet remnants → brand teal
   -------------------------------------------------------------------------- */
.fab-btn,
.fab-btn.pop-fab,
.fab-btn.mini {
    background: var(--m-brand) !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4) !important;
}
.fab-btn:hover { background: var(--m-brand-dark) !important; }

.hero.is-theme-secondary, .section.is-theme-secondary {
    background: linear-gradient(135deg, var(--m-navy) 0%, var(--m-brand-dark) 100%) !important;
}
.text-bold.dark-text { color: var(--m-navy) !important; }

/* ==========================================================================
   Report comments
   --------------------------------------------------------------------------
   Markup is identical in all nine files that render comments (mainPage,
   mainPageDoctor, the four AJAX feed renderers, plus updatecommentdb.php and
   deletecomment.php which re-render the list after add/delete), so this is
   styled purely from CSS - nothing to keep in sync per file.

   Structure:
     ul.comment-list > li.media
        > div.media-left  > img            (author avatar)
        > div.media-body
             > div.media-heading > a (name) + span.timestamp + a[onclick] (delete)
             > p (comment text)
   ========================================================================== */

.comment-list {
    list-style: none;
    margin: 0;
    padding: 4px 0 0 0;
}

.comment-list > li.media {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border: none;
    margin: 0;
}

/* Avatar - the legacy markup hides this on mobile; keep it visible but small */
.comment-list .media-left {
    flex: 0 0 auto;
    display: block !important;
    margin: 0;
}

.comment-list .media-left img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--m-bg);
}

/* The bubble */
.comment-list .media-body {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--m-bg);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius-sm);
    padding: 8px 12px;
}

.comment-list .media-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 2px 0;
}

/* Author name - was a plain link, styled the same as the Delete action */
.comment-list .media-heading > a:not([onclick]) {
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--m-text);
    text-decoration: none;
    cursor: default;
}

.comment-list .media-heading > a:not([onclick]):hover {
    color: var(--m-text);
}

.comment-list .media-heading .timestamp {
    font-size: 0.72rem;
    color: var(--m-text-muted);
    font-weight: 400;
}

/* Delete: pushed to the right, muted until hover so it stops competing
   with the author name (both were .text-semibold links before). */
.comment-list .media-heading > a[onclick] {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--m-text-muted);
    text-decoration: none;
    opacity: 0;
    transition: opacity .15s ease, color .15s ease;
}

.comment-list > li.media:hover .media-heading > a[onclick] {
    opacity: 1;
}

.comment-list .media-heading > a[onclick]:hover {
    color: var(--m-danger);
}

/* Always show the delete affordance on touch devices, where there is no hover */
@media (hover: none) {
    .comment-list .media-heading > a[onclick] { opacity: 1; }
}

.comment-list .media-body p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--m-text-soft);
    white-space: pre-wrap;      /* keep the author's line breaks */
    overflow-wrap: anywhere;    /* long tokens cannot widen the card */
}

/* --- comment composer ------------------------------------------------------
   The textarea carried inline style="max-width:300px; max-height:70px", which
   made the input far narrower than the card it sits in. */
.post-item .status-wrapper .control {
    max-width: 100% !important;
}

.post-item .status-wrapper .textarea.is-button {
    max-height: none !important;
    min-height: 44px;
    border-radius: var(--m-radius-sm) !important;
    border: 1px solid var(--m-border) !important;
    background: var(--m-card) !important;
    font-size: 0.88rem;
    resize: vertical;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.post-item .status-wrapper .textarea.is-button:focus {
    border-color: var(--m-brand) !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.13) !important;
}

/* ---------------------------------------------------------------------------
 * Hover label for report-card action buttons (CSS-only).
 * The ggtooltip plugin only binds at page load, so cards injected by
 * "Load more" / search never got a tooltip, and the one it did render was
 * 10px at 80% opacity. The label lives on a wrapper span because .fab-btn
 * carries a rotate() transform that would spin a pseudo-element on the button.
 * ------------------------------------------------------------------------- */
.report-action {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.report-action::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translate(-50%, -4px);
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 7px 10px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 30;
}
.report-action::before {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% + 3px);
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #1f2937;
    border-top: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 30;
}
.report-action:hover::after,
.report-action:focus-within::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
.report-action:hover::before,
.report-action:focus-within::before {
    opacity: 1;
}

/* ---------------------------------------------------------------------------
 * Report list screens (Approved / Waiting / Ongoing).
 * The tables used to carry per-cell inline styles (translucent white cells on
 * a purple/teal gradient). Those inline styles were removed from the markup;
 * everything below is what styles them now.
 * ------------------------------------------------------------------------- */
.report-table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    background: var(--m-card);
}
.report-table thead th {
    padding: 12px 14px !important;
    white-space: nowrap;
    border-bottom: 1px solid var(--m-border) !important;
}
.report-table thead th a {
    color: inherit !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.report-table thead th a::after {
    content: "\2195";            /* up-down arrow: sortable */
    font-size: 0.8em;
    opacity: .35;
}
.report-table thead th a:hover { color: var(--m-text) !important; }
.report-table thead th.sort-active a { color: var(--m-brand-dark) !important; }
.report-table thead th.sort-active a::after {
    content: "\2193";            /* down arrow: current sort */
    opacity: 1;
}
.report-table tbody td {
    padding: 12px 14px !important;
    font-size: 0.9rem;
    color: var(--m-text-soft) !important;
    background: transparent !important;
    border-bottom: 1px solid #eef2f7 !important;
    vertical-align: middle !important;
}
.report-table tbody tr:last-child td { border-bottom: 0 !important; }
.report-table tbody tr:hover td { background: #f8fafc !important; }
.report-table td[data-th="Creator"],
.report-table td[data-th="Patient"],
.report-table td[id="Patient"] { color: var(--m-text) !important; font-weight: 600; }
.report-table td[id="Date"] { white-space: nowrap; color: var(--m-text-muted) !important; font-size: 0.82rem; }
.report-table td .report-id { display: inline-block; white-space: nowrap; }
.report-table td[id="nofimages"],
.report-table td[id="TotalImage"],
.report-table td[id="ImageUploaded"] { text-align: center; }
.report-table td[id="nofimages"] { font-weight: 700; color: var(--m-text) !important; }

/* Action cell: one tidy row of small buttons, colour-coded by verb */
.report-table td[data-th="Actions"] { white-space: nowrap; }
.report-table td[data-th="Actions"] form,
.report-table tr > form { display: contents; }
.report-table td[data-th="Actions"] .button,
.report-table td[data-th="Actions"] a.button {
    height: 30px !important;
    padding: 0 12px !important;
    margin: 2px 6px 2px 0 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 999px !important;
    border: 1.5px solid var(--m-border) !important;
    background: #fff !important;
    color: var(--m-text-soft) !important;
    box-shadow: none !important;
    transition: background .15s, color .15s, border-color .15s;
}
.report-table td[data-th="Actions"] .button:hover { border-color: var(--m-text-muted) !important; color: var(--m-text) !important; }
/* View */
.report-table td[data-th="Actions"] [id^="View"] { border-color: var(--m-brand) !important; color: var(--m-brand-dark) !important; }
.report-table td[data-th="Actions"] [id^="View"]:hover { background: var(--m-brand) !important; color: #fff !important; }
/* Analyze (AI) */
.report-table td[data-th="Actions"] [id^="analyze_btn"] { background: var(--m-brand) !important; border-color: var(--m-brand) !important; color: #fff !important; }
.report-table td[data-th="Actions"] [id^="analyze_btn"]:hover { background: var(--m-brand-dark) !important; }
/* Approve / Recover */
.report-table td[data-th="Actions"] [id^="Approve"],
.report-table td[data-th="Actions"] [id^="Recover"] { border-color: var(--m-success) !important; color: #047857 !important; }
.report-table td[data-th="Actions"] [id^="Approve"]:hover,
.report-table td[data-th="Actions"] [id^="Recover"]:hover { background: var(--m-success) !important; color: #fff !important; }
/* Delete */
.report-table td[data-th="Actions"] [id^="Delete"] { border-color: var(--m-danger) !important; color: var(--m-danger) !important; }
.report-table td[data-th="Actions"] [id^="Delete"]:hover { background: var(--m-danger) !important; color: #fff !important; }
.report-table td[data-th="Actions"] .button[disabled] { opacity: .4; cursor: not-allowed; }

/* Per-row analysis status (shown by the AI buttons) */
.report-table .bold-red { color: var(--m-danger); font-weight: 700; font-size: 0.75rem; margin-top: 4px; }
.report-table .loader { width: 18px; height: 18px; border-width: 3px; display: inline-block; vertical-align: middle; margin-left: 6px; }

/* Inline patient picker on the Waiting screen's Edit row */
.report-table .chosen-container { min-width: 220px; font-size: 0.85rem; }

/* Empty state */
.report-table tbody:empty::after,
.report-table tbody tr.report-empty td {
    text-align: center;
    color: var(--m-text-muted) !important;
    padding: 32px 16px !important;
}
