/* =================================================================
   iCare – Orthopaedic Emergency Shift Manager  |  v1.0.1
   Alexia Technology Sdn Bhd
   ================================================================= */

:root {
    --ic-primary:   #1a73e8;
    --ic-primary-d: #1557b0;
    --ic-danger:    #d93025;
    --ic-success:   #1e8e3e;
    --ic-warning:   #f9ab00;
    --ic-purple:    #7c3aed;
    --ic-teal:      #00796b;
    --ic-orange:    #e65100;
    --ic-gray:      #5f6368;
    --ic-border:    #dadce0;
    --ic-bg:        #f8f9fa;
    --ic-card:      #ffffff;
    --ic-text:      #202124;
    --ic-text2:     #5f6368;
    --ic-shadow:    0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
    --ic-shadow-md: 0 4px 12px rgba(0,0,0,.12);
    --ic-r:         8px;
    --ic-r-sm:      5px;
}

/* ---- Reset & wrap ---- */
.icare-wrap * { box-sizing: border-box; }
.icare-wrap {
    max-width: 1100px;
    padding: 0 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ic-text);
    font-size: 14px;
}

/* ---- Header ---- */
.icare-header {
    display: flex;
    align-items: center;
    padding: 14px 0 12px;
    border-bottom: 2px solid var(--ic-primary);
    margin-bottom: 18px;
}
.icare-logo { display: flex; align-items: center; gap: 8px; }
.icare-logo-icon { font-size: 26px; }
.icare-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--ic-primary);
    letter-spacing: -0.5px;
}
.icare-logo-sub {
    font-size: 12px;
    color: var(--ic-text2);
    border-left: 1px solid var(--ic-border);
    padding-left: 10px;
    margin-left: 4px;
}

/* ---- No shift ---- */
.icare-no-shift {
    text-align: center;
    padding: 80px 20px;
    background: var(--ic-card);
    border-radius: var(--ic-r);
    box-shadow: var(--ic-shadow);
}
.icare-no-shift-icon { font-size: 64px; margin-bottom: 16px; }
.icare-no-shift h2 { font-size: 22px; color: var(--ic-text); margin-bottom: 8px; }
.icare-no-shift p  { color: var(--ic-text2); margin-bottom: 24px; }

/* ---- Shift bar ---- */
.icare-shift-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ic-card);
    border: 1px solid var(--ic-border);
    border-radius: var(--ic-r);
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: var(--ic-shadow);
    flex-wrap: wrap;
    gap: 10px;
}
.icare-shift-info { font-size: 13px; }
.icare-shift-actions { display: flex; gap: 8px; }
.icare-shift-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    margin-right: 6px;
}
.icare-shift-badge.active { background: #e6f4ea; color: #1e8e3e; }
.icare-shift-badge.closed { background: #f1f3f4; color: #5f6368; }

/* ---- Stats row ---- */
.icare-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.icare-stat-card {
    background: var(--ic-card);
    border-radius: var(--ic-r);
    padding: 10px 8px;
    text-align: center;
    box-shadow: var(--ic-shadow);
    border-top: 3px solid transparent;
    cursor: default;
    transition: transform .15s;
}
.icare-stat-card:hover { transform: translateY(-2px); box-shadow: var(--ic-shadow-md); }
.icare-stat-value { font-size: 26px; font-weight: 800; line-height: 1; margin-bottom: 3px; }
.icare-stat-label { font-size: 10px; color: var(--ic-text2); text-transform: uppercase; letter-spacing: .3px; }

.icare-stat-blue   { border-color: var(--ic-primary); } .icare-stat-blue   .icare-stat-value { color: var(--ic-primary); }
.icare-stat-red    { border-color: var(--ic-danger);  } .icare-stat-red    .icare-stat-value { color: var(--ic-danger);  }
.icare-stat-red2   { border-color: #b71c1c;           } .icare-stat-red2   .icare-stat-value { color: #b71c1c;           }
.icare-stat-orange { border-color: var(--ic-orange);  } .icare-stat-orange .icare-stat-value { color: var(--ic-orange);  }
.icare-stat-gray   { border-color: var(--ic-gray);    } .icare-stat-gray   .icare-stat-value { color: var(--ic-gray);    }
.icare-stat-green  { border-color: var(--ic-success); } .icare-stat-green  .icare-stat-value { color: var(--ic-success); }
.icare-stat-teal   { border-color: var(--ic-teal);    } .icare-stat-teal   .icare-stat-value { color: var(--ic-teal);    }
.icare-stat-yellow { border-color: var(--ic-warning); } .icare-stat-yellow .icare-stat-value { color: #b06000; }
.icare-stat-purple { border-color: var(--ic-purple);  } .icare-stat-purple .icare-stat-value { color: var(--ic-purple);  }

/* ---- Toolbar ---- */
.icare-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.icare-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.icare-filter-tab {
    background: none;
    border: 1px solid var(--ic-border);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    color: var(--ic-text2);
    transition: all .15s;
    font-family: inherit;
}
.icare-filter-tab.active,
.icare-filter-tab:hover {
    background: var(--ic-primary);
    border-color: var(--ic-primary);
    color: #fff;
}

/* ---- Patient list ---- */
.icare-patient-list { display: flex; flex-direction: column; gap: 7px; }

.icare-patient-row {
    display: flex;
    align-items: stretch;
    background: var(--ic-card);
    border-radius: var(--ic-r);
    border: 1px solid var(--ic-border);
    box-shadow: var(--ic-shadow);
    overflow: hidden;
    transition: box-shadow .15s;
}
.icare-patient-row:hover { box-shadow: var(--ic-shadow-md); }

.icare-patient-cat {
    width: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.icare-cat-red    { background: #fce8e6; }
.icare-cat-orange { background: #fef3e2; }
.icare-cat-gray   { background: #f1f3f4; }

.icare-patient-main { flex: 1; padding: 9px 12px; min-width: 0; }
.icare-patient-header {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}
.icare-patient-name { font-size: 14px; font-weight: 700; color: var(--ic-text); }
.icare-patient-time { font-size: 11px; color: var(--ic-text2); margin-left: auto; white-space: nowrap; }
.icare-patient-meta { font-size: 11px; color: var(--ic-text2); margin-bottom: 2px; }
.icare-patient-dx   { font-size: 12px; color: var(--ic-text); margin-bottom: 1px; }
.icare-patient-plan { font-size: 11px; color: var(--ic-text2); }

.icare-patient-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border-left: 1px solid var(--ic-border);
    min-width: 44px;
}
.icare-img-badge {
    font-size: 10px;
    color: var(--ic-text2);
    background: var(--ic-bg);
    padding: 2px 4px;
    border-radius: 4px;
}

.icare-empty-list {
    text-align: center;
    padding: 50px 20px;
    color: var(--ic-text2);
    background: var(--ic-card);
    border-radius: var(--ic-r);
    border: 2px dashed var(--ic-border);
}
.icare-empty-list span { font-size: 40px; display: block; margin-bottom: 10px; }

/* ---- Badges ---- */
.icare-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .2px;
    white-space: nowrap;
}
.icare-badge-green  { background: #e6f4ea; color: #1e8e3e; }
.icare-badge-yellow { background: #fef7e0; color: #b06000; }
.icare-badge-red    { background: #fce8e6; color: #c5221f; }
.icare-badge-blue   { background: #e8f0fe; color: #1a73e8; }
.icare-badge-purple { background: #f3e8fd; color: #6d28d9; }
.icare-badge-teal   { background: #e0f5f5; color: #00796b; }
.icare-badge-orange { background: #fff3e0; color: #e65100; }
.icare-badge-gray   { background: #f1f3f4; color: #5f6368; }

/* ---- Buttons ---- */
.icare-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: var(--ic-r-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .15s;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}
.icare-btn:focus { outline: 2px solid var(--ic-primary); outline-offset: 2px; }

.icare-btn-primary   { background: var(--ic-primary);   color: #fff; }
.icare-btn-primary:hover { background: var(--ic-primary-d); color: #fff; }

.icare-btn-secondary { background: #fff; color: var(--ic-text); border: 1px solid var(--ic-border); }
.icare-btn-secondary:hover { background: var(--ic-bg); }

.icare-btn-danger    { background: var(--ic-danger); color: #fff; }
.icare-btn-danger:hover { background: #b71c1c; }

.icare-btn-sm   { padding: 5px 12px; font-size: 12px; }
.icare-btn-xs   { padding: 3px 7px;  font-size: 11px; }
.icare-btn-lg   { padding: 12px 24px; font-size: 15px; }
.icare-btn-full { width: 100%; }

/* ---- Card ---- */
.icare-card {
    background: var(--ic-card);
    border-radius: var(--ic-r);
    padding: 22px;
    box-shadow: var(--ic-shadow);
    margin-bottom: 18px;
}
.icare-card h2 { margin-top: 0; font-size: 18px; }

/* ---- Form ---- */
.icare-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.icare-form-full { grid-column: 1 / -1; }
.icare-form-group { display: flex; flex-direction: column; gap: 4px; }
.icare-form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ic-text2);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.req { color: var(--ic-danger); }
.icare-input {
    padding: 9px 11px;
    border: 1px solid var(--ic-border);
    border-radius: var(--ic-r-sm);
    font-size: 14px;
    color: var(--ic-text);
    background: #fff;
    width: 100%;
    transition: border-color .15s;
    font-family: inherit;
}
.icare-input:focus {
    outline: none;
    border-color: var(--ic-primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}
select.icare-input { appearance: auto; }
.icare-textarea     { min-height: 76px; resize: vertical; }

/* ---- Modal ---- */
.icare-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.icare-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
}
.icare-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow: hidden;          /* clip border-radius only — body is the sole scroller */
    box-shadow: 0 24px 48px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
}
.icare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ic-border);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 12px 12px 0 0;
}
.icare-modal-header h3 { margin: 0; font-size: 16px; }
.icare-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--ic-text2);
    padding: 4px 6px;
    border-radius: 4px;
    font-family: inherit;
}
.icare-modal-close:hover { background: var(--ic-bg); }
.icare-modal-body { padding: 18px; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.icare-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--ic-border);
    background: var(--ic-bg);
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;             /* never pushed off-screen by body content */
}

/* ---- OCR section ---- */
.icare-progress-bar {
    background: #c5d9f8;
    border-radius: 10px;
    height: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}
.icare-progress-fill {
    height: 100%;
    background: var(--ic-primary);
    border-radius: 10px;
    width: 0%;
    transition: width .3s;
}
/* ---- Image section ---- */
.icare-image-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--ic-border);
}
.icare-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--ic-text2);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 8px;
}
.icare-image-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.icare-image-thumb {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: var(--ic-r-sm);
    border: 2px solid var(--ic-border);
    cursor: pointer;
    transition: border-color .15s;
}
.icare-image-thumb:hover { border-color: var(--ic-primary); }
.icare-image-note { font-size: 11px; color: var(--ic-text2); margin-top: 6px; }

/* ---- Export modal ---- */
.icare-export-tabs {
    display: flex;
    border-bottom: 1px solid var(--ic-border);
    margin-bottom: 14px;
}
.icare-export-tab {
    padding: 7px 14px;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--ic-text2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s;
    font-family: inherit;
}
.icare-export-tab.active { color: var(--ic-primary); border-bottom-color: var(--ic-primary); font-weight: 600; }
.icare-export-hint { font-size: 12px; color: var(--ic-text2); margin-bottom: 8px; }
.icare-export-textarea {
    width: 100%;
    height: 260px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    padding: 12px;
    border: 1px solid var(--ic-border);
    border-radius: var(--ic-r-sm);
    resize: vertical;
    background: var(--ic-bg);
    margin-bottom: 10px;
    color: var(--ic-text);
}

/* ---- Table ---- */
.icare-table-wrap { overflow-x: auto; }
.icare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.icare-table th {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 2px solid var(--ic-border);
    color: var(--ic-text2);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}
.icare-table td { padding: 9px 12px; border-bottom: 1px solid var(--ic-border); }
.icare-table tr:last-child td { border-bottom: none; }
.icare-table tr:hover td { background: var(--ic-bg); }

/* ---- Alerts ---- */
.icare-alert {
    padding: 10px 14px;
    border-radius: var(--ic-r-sm);
    font-size: 13px;
    line-height: 1.5;
}
.icare-alert-success { background: #e6f4ea; color: #1e8e3e; border: 1px solid #b3dfbd; }
.icare-alert-error   { background: #fce8e6; color: #c5221f; border: 1px solid #f5c6c3; }
.icare-alert-info    { background: #e8f0fe; color: #1a73e8; border: 1px solid #c5d9f8; }

/* ---- Settings ---- */
.icare-settings-box {
    background: var(--ic-bg);
    border-radius: var(--ic-r-sm);
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
}
.icare-settings-box p { margin: 0; }

/* ---- Spinner ---- */
.icare-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--ic-border);
    border-top-color: var(--ic-primary);
    border-radius: 50%;
    animation: ic-spin .6s linear infinite;
    vertical-align: middle;
}
@keyframes ic-spin { to { transform: rotate(360deg); } }

/* ---- Responsive ---- */
@media (max-width: 782px) {
    .icare-logo-sub { display: none; }
    .icare-stats-row { grid-template-columns: repeat(4, 1fr); }
    .icare-shift-bar { flex-direction: column; align-items: flex-start; }
    .icare-modal { align-items: flex-end; padding: 0; }
    .icare-modal-box { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; overflow: hidden; }
    .icare-patient-header { gap: 4px; }
}
@media (max-width: 540px) {
    .icare-form-grid { grid-template-columns: 1fr; }
    .icare-form-full { grid-column: 1; }
    .icare-stats-row { grid-template-columns: repeat(3, 1fr); }
    .icare-wrap { padding: 0 10px 60px; }
    .icare-card { padding: 16px; }
}

/* ================================================================
   iCare CSS additions v1.1.0 — census panel, flags, new zones
   ================================================================ */

/* Census Panel */
.icare-census-panel {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}
.icare-census-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #1a73e8;
    background: #f8f9ff;
    border-bottom: 1px solid #e8eaed;
    user-select: none;
}
.icare-census-header:hover { background: #eef2ff; }
.icare-census-chevron { font-size: 11px; transition: transform .2s; }
.icare-census-chevron.open { transform: rotate(180deg); }

.icare-census-body { padding: 16px; }
.icare-census-section { margin-bottom: 16px; }
.icare-census-section:last-child { margin-bottom: 0; }
.icare-census-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 10px;
}
.icare-census-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}
.icare-census-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #5f6368;
    margin-bottom: 4px;
}
.icare-census-input { text-align: center; padding: 6px 8px !important; }

/* Flag toggle buttons on patient row */
.icare-flag-group {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}
.icare-flag-btn {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    padding: 3px 6px;
    line-height: 1;
    transition: all .15s;
    opacity: .45;
}
.icare-flag-btn:hover { opacity: .75; border-color: #1a73e8; }
.icare-flag-btn.active {
    background: #e8f0fe;
    border-color: #1a73e8;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(26,115,232,.15);
}

/* Flag checkboxes in modal */
.icare-flag-section {
    margin: 16px 0 0;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}
.icare-flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}
.icare-flag-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.icare-flag-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* Small textarea for contact */
.icare-textarea-sm { min-height: 60px !important; }

/* Export modal actions row */
.icare-export-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.icare-export-actions .icare-btn { flex: 1; }

/* 4-tab export tab bar */
.icare-export-tabs { flex-wrap: wrap; }
.icare-export-tab {
    font-size: 12px;
    padding: 7px 10px;
}

/* Badge color for new zones */
.icare-badge-orange { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }

/* Ward group visibility tweak */
#icare-ward-group, #icare-ward-bed-group { transition: opacity .2s; }

/* ================================================================
   Location management (Settings page) — v1.1.0
   ================================================================ */

.icare-add-location-form {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e8eaed;
}

.icare-location-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 16px;
}

/* Zebra stripe for location table */
#icare-location-table tbody tr:nth-child(even) { background: #f8f9fa; }
#icare-location-table tbody tr:hover { background: #eef2ff; }
#icare-location-table td { vertical-align: middle; }

/* Badge orange — already in existing CSS but ensure it's there */
.icare-badge-teal    { background: #e6f4ea; color: #137333; border: 1px solid #a8d5b5; }

/* ================================================================
   v1.1.5 — prominent Add Patient button
   ================================================================ */

.icare-btn-add-patient {
    font-size: 15px !important;
    padding: 10px 22px !important;
    font-weight: 700 !important;
    letter-spacing: .3px;
    box-shadow: 0 2px 8px rgba(26,115,232,.35);
    border-radius: 10px !important;
    width: 100%;
    display: block;
}
.icare-btn-add-patient:hover {
    box-shadow: 0 4px 14px rgba(26,115,232,.45);
    transform: translateY(-1px);
}

/* ================================================================
   v1.1.7 — clickable patient row
   ================================================================ */

.icare-patient-row {
    cursor: pointer;
    transition: background .12s, box-shadow .12s;
}
.icare-patient-row:hover {
    background: #f0f4ff;
    box-shadow: inset 3px 0 0 #1a73e8;
}
/* Action area — not clickable as a row */
.icare-patient-actions {
    cursor: default;
}

/* ================================================================
   v1.2.1 — drag-to-reorder patient rows
   ================================================================ */

.icare-drag-handle {
    cursor: grab;
    font-size: 18px;
    color: #c0c8d8;
    padding: 0 6px 0 0;
    line-height: 1;
    flex-shrink: 0;
    align-self: center;
    user-select: none;
    transition: color .15s;
}
.icare-drag-handle:hover { color: #1a73e8; }
.icare-drag-handle:active { cursor: grabbing; }

/* Row being dragged */
.icare-patient-row.dragging {
    opacity: .4;
    background: #e8f0fe !important;
    border: 2px dashed #1a73e8 !important;
}

/* Drop target indicator */
.icare-patient-row.drag-over {
    border-top: 3px solid #1a73e8 !important;
    margin-top: -1px;
}

/* ================================================================
   v1.2.3 — numbered sequence + up/down reorder buttons
   ================================================================ */

/* Remove old drag styles */
.icare-drag-handle { display: none; }

.icare-seq-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    min-width: 32px;
}

.icare-seq-num {
    font-size: 13px;
    font-weight: 800;
    color: #1a73e8;
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

.icare-seq-btns {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.icare-seq-btn {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 9px;
    line-height: 1;
    padding: 2px 5px;
    color: #5f6368;
    transition: all .12s;
}
.icare-seq-btn:hover:not(:disabled) {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}
.icare-seq-btn:disabled {
    opacity: .3;
    cursor: default;
}

/* ================================================================
   v1.2.5 — image lightbox + thumbnail delete button
   ================================================================ */

/* Thumbnail wrapper — position:relative for delete overlay */
.icare-img-thumb-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

/* Delete button on thumbnail — always visible on touch, hover on desktop */
.icare-img-del-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    opacity: 1;               /* always visible */
    transition: background .15s;
}
.icare-img-del-btn:hover { background: #d93025; }

/* Lightbox */
#icare-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200000;
    background: rgba(0,0,0,.92);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#icare-lightbox.flex-display { display: flex; }

#icare-lb-overlay {
    position: absolute;
    inset: 0;
}

#icare-lb-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
    max-height: 80vh;
    z-index: 1;
}

#icare-lb-img {
    max-width: 92vw;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
}

#icare-lb-counter {
    margin-top: 10px;
    color: rgba(255,255,255,.7);
    font-size: 13px;
    letter-spacing: .5px;
}

/* Nav buttons */
#icare-lb-prev, #icare-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    z-index: 2;
    transition: background .15s;
}
#icare-lb-prev { left: 12px; }
#icare-lb-next { right: 12px; }
#icare-lb-prev:hover, #icare-lb-next:hover { background: rgba(255,255,255,.3); }

/* Close button */
#icare-lb-close {
    position: fixed;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: background .15s;
}
#icare-lb-close:hover { background: rgba(255,255,255,.3); }

/* Delete button */
#icare-lb-delete {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #d93025;
    border: none;
    color: #fff;
    font-size: 14px;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 2;
    transition: background .15s;
}
#icare-lb-delete:hover { background: #b3261e; }

/* ================================================================
   v1.2.7 — clerked toggle button on patient card
   ================================================================ */

.icare-clerked-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 2px solid #dadce0;
    background: #f8f9fa;
    color: #5f6368;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}
.icare-clerked-btn:hover {
    border-color: #1a73e8;
    color: #1a73e8;
    background: #e8f0fe;
}
.icare-clerked-btn.clerked {
    background: #e6f4ea;
    border-color: #34a853;
    color: #137333;
}
.icare-clerked-btn.clerked:hover {
    background: #d2edd8;
    border-color: #137333;
}

/* ================================================================
   v1.2.2 — Insurance / SOCSO section
   ================================================================ */

.icare-insurance-section {
    margin: 16px 0 0;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}

.icare-ins-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #e8f0fe;
    color: #1557b0;
    border: 1px solid #c5d9f8;
    border-radius: 20px;
    padding: 2px 10px;
}

.icare-patient-insurance {
    margin-top: 5px;
}

/* ================================================================
   v1.2.8 — Status filter tabs row
   ================================================================ */

.icare-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 0 12px;
    border-bottom: 1px solid #e8eaed;
    margin-bottom: 12px;
}

.icare-status-tab {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #3c4043;
    white-space: nowrap;
    transition: all .15s;
    font-family: inherit;
}

.icare-status-tab:hover {
    background: #e8eaed;
    border-color: #bdc1c6;
}

.icare-status-tab.active {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
    font-weight: 600;
}

/* ================================================================
   v1.3.3 — compact referral time field
   ================================================================ */

.icare-ref-time-group {
    max-width: 160px !important;
    min-width: 120px;
}
.icare-ref-time-input {
    max-width: 140px !important;
    padding-left: 8px !important;
    padding-right: 4px !important;
}

/* ================================================================
   v1.2.3 — image section actions (Add + Download buttons)
   ================================================================ */

.icare-image-section-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* ================================================================
   v1.2.5 — inline image row inside patient card body
   ================================================================ */

.icare-patient-images-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.icare-patient-images-row .icare-img-badge {
    font-size: 12px;
    color: #5f6368;
    background: #f1f3f4;
    border-radius: 6px;
    padding: 2px 8px;
    border: 1px solid #e0e0e0;
}

/* ================================================================
   v1.2.6 — S/B SP label + filter tabs
   ================================================================ */

/* S/B SP label below flag buttons */
.icare-sbsp-label {
    font-size: 10px;
    font-weight: 700;
    color: #1a73e8;
    letter-spacing: .3px;
    min-height: 14px;
    text-align: center;
    margin-top: 2px;
}

/* SP filter tab row */
.icare-sp-filter-tabs {
    margin-top: 0;
}
.icare-sp-filter-tab {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #5f6368;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}
.icare-sp-filter-tab:hover {
    background: #f1f3f4;
    border-color: #bdc1c6;
}
.icare-sp-filter-tab.active {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
    font-weight: 600;
}
/* Pending tab — orange accent when active */
.icare-sp-filter-tab[data-sp-filter="pending"].active {
    background: #fff3e0;
    border-color: #e65100;
    color: #e65100;
}

/* ================================================================
   v1.2.7 — prominent Export WhatsApp button
   ================================================================ */

.icare-btn-export-main {
    background: #25D366 !important;         /* WhatsApp green */
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 9px 18px !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(37,211,102,.4);
    letter-spacing: .2px;
}
.icare-btn-export-main:hover {
    background: #1ebe5d !important;
    box-shadow: 0 4px 14px rgba(37,211,102,.5);
    transform: translateY(-1px);
    color: #fff !important;
}

/* ================================================================
   v1.2.13 — prominent Export button (green, distinct from Add Patient)
   ================================================================ */

.icare-btn-export {
    background: #1e8c45 !important;
    border-color: #1e8c45 !important;
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: .2px;
    box-shadow: 0 2px 8px rgba(30,140,69,.35);
}
.icare-btn-export:hover {
    background: #166d36 !important;
    border-color: #166d36 !important;
    box-shadow: 0 4px 12px rgba(30,140,69,.45);
    transform: translateY(-1px);
}

/* ================================================================
   v1.2.19 — IC age badge
   ================================================================ */

.icare-age-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #c5d8fd;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
}

/* ================================================================
   v1.1.6 — S/B SP larger tap target + callback button styling
   ================================================================ */

/* S/B SP — larger, easier to tap */
.icare-flag-btn-sp {
    font-size: 18px !important;
    padding: 5px 9px !important;
    min-width: 40px;
    min-height: 36px;
    border-radius: 8px !important;
}
.icare-flag-btn-sp.active {
    background: #e8f0fe !important;
    border-color: #1a73e8 !important;
    box-shadow: 0 0 0 2px rgba(26,115,232,.25) !important;
    opacity: 1 !important;
}

/* Callback — orange tint when active to stand out as urgent */
.icare-flag-btn-callback {
    font-size: 16px !important;
}
.icare-flag-btn-callback.active {
    background: #fff3e0 !important;
    border-color: #e65100 !important;
    box-shadow: 0 0 0 2px rgba(230,81,0,.2) !important;
    opacity: 1 !important;
}

/* ================================================================
   v1.1.7 — Plan Done button
   ================================================================ */

/* Plan Done — green tint, prominent, first in flag group */
.icare-flag-btn-plan {
    font-size: 16px !important;
    padding: 4px 9px !important;
    min-width: 36px;
    min-height: 34px;
    border-radius: 8px !important;
    font-weight: 700;
}
.icare-flag-btn-plan.active {
    background: #e6f4ea !important;
    border-color: #137333 !important;
    box-shadow: 0 0 0 2px rgba(19,115,51,.2) !important;
    opacity: 1 !important;
}
/* Inactive state — slightly amber to indicate pending */
.icare-flag-btn-plan:not(.active) {
    background: #fffde7 !important;
    border-color: #f9a825 !important;
    opacity: 0.75;
}
.icare-flag-btn-plan:not(.active):hover {
    opacity: 1;
    border-color: #137333 !important;
}

/* ================================================================
   v1.1.9 — Plan Done button on its own line
   ================================================================ */

.icare-flag-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.icare-flag-btn-plan {
    width: 100%;
    text-align: left;
    padding-left: 10px !important;
    font-size: 13px !important;
    letter-spacing: .2px;
}

.icare-flag-btn-plan::after {
    content: ' Plan Done';
    font-size: 12px;
    font-weight: 600;
}

.icare-flag-group-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ================================================================
   v1.2.0 — Request Scans + Call Back Pt button styling
   ================================================================ */

/* Request Scans — teal/blue tint when active */
.icare-flag-btn-scans.active {
    background: #e0f7fa !important;
    border-color: #00838f !important;
    box-shadow: 0 0 0 2px rgba(0,131,143,.2) !important;
    opacity: 1 !important;
}

/* Callback label suffix */
.icare-flag-btn-callback::after {
    content: ' Call Back Pt';
    font-size: 11px;
    font-weight: 600;
}

/* Scans label suffix */
.icare-flag-btn-scans::after {
    content: ' Req. Scans';
    font-size: 11px;
    font-weight: 600;
}

/* Make callback + scans full-width like plan_done */
.icare-flag-btn-callback,
.icare-flag-btn-scans {
    width: 100%;
    text-align: left;
    padding-left: 10px !important;
}

/* ================================================================
   v1.2.2 — Add Patient button below patient list
   ================================================================ */

.icare-add-patient-bottom {
    margin: 14px 0 4px;
    text-align: center;
}
.icare-add-patient-bottom .icare-btn-add-patient {
    width: 100%;
    max-width: 360px;
}

/* ================================================================
   v1.2.3 — Flag buttons: 2-column grid, equal width
   ================================================================ */

/* Override previous flex/column layout */
.icare-flag-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    width: 100%;
    flex-direction: unset !important;
    align-items: unset !important;
}

/* All flag buttons equal width, consistent height */
.icare-flag-group .icare-flag-btn {
    width: 100% !important;
    text-align: left;
    padding: 6px 8px !important;
    font-size: 13px !important;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 7px !important;
}

/* Remove ::after text — use explicit labels in button via CSS content on span instead */
.icare-flag-btn-plan::after    { content: ' Plan Done';    font-size: 11px; font-weight: 600; }
.icare-flag-btn-sp::after      { content: ' S/B Sp';       font-size: 11px; font-weight: 600; }
.icare-flag-btn-callback::after{ content: ' Call Back';    font-size: 11px; font-weight: 600; }
.icare-flag-btn-scans::after   { content: ' Req. Scans';   font-size: 11px; font-weight: 600; }

/* Reset overrides from earlier rules that broke grid */
.icare-flag-btn-plan,
.icare-flag-btn-callback,
.icare-flag-btn-scans {
    width: 100% !important;
    padding-left: 8px !important;
    font-size: 13px !important;
}

/* SP button — normalise size to match grid peers */
.icare-flag-btn-sp {
    font-size: 13px !important;
    min-width: unset;
    min-height: 34px;
    padding: 6px 8px !important;
}

/* ================================================================
   v1.2.6 — Narrower action flag buttons
   ================================================================ */

.icare-flag-group {
    grid-template-columns: 1fr 1fr !important;
    max-width: 220px;
    gap: 4px !important;
}

.icare-flag-group .icare-flag-btn {
    padding: 4px 6px !important;
    font-size: 12px !important;
    min-height: 28px;
    gap: 3px;
}

.icare-flag-btn-plan::after    { font-size: 10px !important; }
.icare-flag-btn-sp::after      { font-size: 10px !important; }
.icare-flag-btn-callback::after{ font-size: 10px !important; }
.icare-flag-btn-scans::after   { font-size: 10px !important; }

/* ================================================================
   v1.2.7 — Even narrower action flag buttons
   ================================================================ */

.icare-flag-group {
    max-width: 160px !important;
    gap: 3px !important;
}

.icare-flag-group .icare-flag-btn {
    padding: 3px 5px !important;
    font-size: 11px !important;
    min-height: 24px;
    gap: 2px;
}

.icare-flag-btn-plan::after,
.icare-flag-btn-sp::after,
.icare-flag-btn-callback::after,
.icare-flag-btn-scans::after { font-size: 9px !important; }

/* ================================================================
   v1.2.8 — Black text on action flag buttons
   ================================================================ */

.icare-flag-group .icare-flag-btn,
.icare-flag-group .icare-flag-btn::after {
    color: #000 !important;
}

/* ================================================================
   v1.2.9 — Patient age badge
   ================================================================ */

.icare-patient-age {
    font-size: 11px;
    font-weight: 600;
    color: #5f6368;
    background: #f1f3f4;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 5px;
    vertical-align: middle;
    white-space: nowrap;
}

/* ================================================================
   v1.3.0 — Even smaller action flag buttons
   ================================================================ */

.icare-flag-group {
    max-width: 120px !important;
    gap: 2px !important;
}

.icare-flag-group .icare-flag-btn {
    padding: 2px 4px !important;
    font-size: 10px !important;
    min-height: 20px;
    gap: 2px;
    line-height: 1.2;
}

.icare-flag-btn-plan::after,
.icare-flag-btn-sp::after,
.icare-flag-btn-callback::after,
.icare-flag-btn-scans::after {
    font-size: 8px !important;
    font-weight: 700;
}

/* ================================================================
   v1.3.1 — Flag filter bar
   ================================================================ */

.icare-flag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 8px 0 10px;
    padding: 8px 10px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 8px;
}

.icare-flag-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-right: 2px;
}

.icare-flag-filter-btn {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #3c4043;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.icare-flag-filter-btn:hover {
    border-color: #1a73e8;
    color: #1a73e8;
    background: #e8f0fe;
}
.icare-flag-filter-btn.active {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff !important;
    box-shadow: 0 1px 4px rgba(26,115,232,.35);
}
.icare-flag-filter-clear {
    color: #d93025 !important;
    border-color: #f5c6c2 !important;
    background: #fce8e6 !important;
    margin-left: auto;
}
.icare-flag-filter-clear:hover {
    background: #d93025 !important;
    border-color: #d93025 !important;
    color: #fff !important;
}

/* ================================================================
   v1.3.8 — Patient name search bar
   ================================================================ */

.icare-search-bar {
    position: relative;
    width: 100%;
    max-width: 340px;
    margin-bottom: 8px;
}

.icare-search-input {
    width: 100%;
    padding-right: 32px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
}

.icare-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #80868b;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    display: none;
    padding: 2px;
}
.icare-search-clear:hover { color: #d93025; }

/* ================================================================
   v1.3.9 — Bottom search bar spacing
   ================================================================ */

.icare-search-bar-bottom {
    margin-top: 12px;
    margin-bottom: 4px;
}

/* ================================================================
   v1.5.3 — Location table drag-to-reorder
   ================================================================ */

.icare-drag-handle { cursor: grab !important; }
.icare-drag-handle:active { cursor: grabbing !important; }

#icare-location-tbody .ui-sortable-helper {
    background: #e8f0fe !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    display: table;
    width: 100%;
}

.icare-sort-placeholder {
    background: #f1f3f4;
    border: 2px dashed #1a73e8;
    height: 44px;
    visibility: visible !important;
}

/* ================================================================
   v1.5.4 — Location ▲▼ reorder buttons
   ================================================================ */

.icare-loc-up,
.icare-loc-down {
    font-size: 10px !important;
    padding: 2px 5px !important;
    min-width: 24px;
}
.icare-loc-up:disabled,
.icare-loc-down:disabled {
    opacity: 0.25;
    cursor: default;
}

/* ================================================================
   v1.6.0 — Patient Registry: Passover button + Duplicate alert
   ================================================================ */

/* Passover button */
.icare-btn-passover {
    display: block;
    width: 100%;
    text-align: left;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 700;
    color: #000 !important;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px !important;
    margin-top: 4px;
    transition: all .15s;
}
.icare-btn-passover:hover {
    background: #fff3cd;
    border-color: #ffc107;
}
.icare-btn-passover.active {
    background: #fff3cd !important;
    border-color: #e65100 !important;
    box-shadow: 0 0 0 2px rgba(230,81,0,.2);
    color: #e65100 !important;
}

/* Duplicate patient alert */
.icare-dup-alert {
    background: #fff8e1;
    border: 1.5px solid #ffc107;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
}
.icare-dup-inner strong { color: #e65100; }
.icare-dup-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ffe082;
}
.icare-dup-name { font-weight: 700; color: #1a1a1a; }

/* ================================================================
   v1.6.1 — Passover button: grey/turquoise, flag-group size
   ================================================================ */

/* Override the old full-width standalone passover style */
.icare-btn-passover {
    display: inline-flex !important;
    width: 100% !important;
    font-size: 10px !important;
    padding: 2px 4px !important;
    min-height: 20px;
    margin-top: 0 !important;
    text-align: left;
    background: #f1f3f4 !important;
    border: 1px solid #dadce0 !important;
    color: #000 !important;
    opacity: 0.55;
    border-radius: 7px !important;
}
.icare-btn-passover::after { content: ' Passover'; font-size: 8px; font-weight: 700; }
.icare-btn-passover:hover  { opacity: 0.85; border-color: #00acc1 !important; }

/* Passover inside flag group */
.icare-flag-btn-passover {
    background: #f1f3f4 !important;
    border-color: #b0bec5 !important;
    color: #000 !important;
    opacity: 0.55;
}
.icare-flag-btn-passover::after { content: ' Passover'; font-size: 8px; font-weight: 700; }
.icare-flag-btn-passover:hover  { opacity: 0.85; border-color: #00acc1 !important; }
.icare-flag-btn-passover.active {
    background: #e0f7fa !important;   /* light turquoise */
    border-color: #00acc1 !important;
    box-shadow: 0 0 0 2px rgba(0,172,193,.2) !important;
    color: #006064 !important;
    opacity: 1 !important;
}

/* ================================================================
   v1.6.5 — Patient name autocomplete suggestions dropdown
   ================================================================ */

.icare-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #fff;
    border: 1.5px solid #1a73e8;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
    max-height: 280px;
    overflow-y: auto;
}

.icare-suggestion-row {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f3f4;
    line-height: 1.4;
    transition: background .1s;
}
.icare-suggestion-row:last-child { border-bottom: none; }
.icare-suggestion-row:hover { background: #e8f0fe; }

.icare-sug-ic    { color: #5f6368; margin-left: 6px; font-size: 12px; }
.icare-sug-visits{ color: #1a73e8; font-weight: 700; margin-left: 8px; font-size: 12px; }
.icare-sug-date  { color: #80868b; font-size: 11px; margin-left: 6px; }
.icare-sug-dx    { color: #5f6368; font-size: 11px; margin-top: 2px; }

.icare-suggestion-new {
    color: #137333;
    font-weight: 600;
    background: #f8fdf9;
    border-top: 1px solid #e8eaed;
}
.icare-suggestion-new:hover { background: #e6f4ea; }

/* ================================================================
   v1.7.1 — Notification bell + header layout
   ================================================================ */

.icare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.icare-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.icare-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    text-decoration: none;
    transition: all .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.icare-notif-bell:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26,115,232,.2);
}

.icare-bell-icon { font-size: 18px; line-height: 1; }

.icare-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #d93025;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    animation: icare-bell-pulse 2s infinite;
}

@keyframes icare-bell-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}

/* ================================================================
   v1.8.0 — Unified flag button sizing: all same width & height
   ================================================================ */

/* Make flag group a single column */
.icare-flag-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    width: 100%;
}

/* All five action buttons: Plan Done, S/B SP, Call Back, Req Scans, Passover */
.icare-flag-btn,
.icare-flag-btn-passover {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 28px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    text-align: left !important;
    box-sizing: border-box !important;
    white-space: nowrap;
    overflow: hidden;
}

/* Remove any ::after content size differences */
.icare-flag-btn::after,
.icare-flag-btn-passover::after {
    font-size: 11px !important;
    font-weight: 600 !important;
    margin-left: 3px;
}

/* Passover label suffix */
.icare-flag-btn-passover::after {
    content: ' Passover' !important;
}

/* ================================================================
   v1.8.1 — Smaller action button text
   ================================================================ */

.icare-flag-btn,
.icare-flag-btn-passover {
    font-size: 10px !important;
    min-height: 24px !important;
    padding: 3px 8px !important;
}

.icare-flag-btn::after,
.icare-flag-btn-passover::after {
    font-size: 10px !important;
}

/* ================================================================
   v1.8.2 — Even smaller action button text
   ================================================================ */

.icare-flag-btn,
.icare-flag-btn-passover {
    font-size: 8px !important;
    min-height: 20px !important;
    padding: 2px 6px !important;
    line-height: 1.2 !important;
}

.icare-flag-btn::after,
.icare-flag-btn-passover::after {
    font-size: 8px !important;
}

/* ================================================================
   v1.8.3 — Tighten emoji + text gap in action buttons
   ================================================================ */

.icare-flag-btn::after,
.icare-flag-btn-passover::after {
    margin-left: 1px !important;
}

/* ================================================================
   v1.8.5 — Bottom navigation bar
   ================================================================ */

.icare-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-top: 1.5px solid #e0e0e0;
    box-shadow: 0 -2px 12px rgba(0,0,0,.10);
    height: 60px;
}

.icare-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #80868b;
    font-size: 10px;
    font-weight: 600;
    padding: 6px 4px;
    transition: all .15s;
    border: none;
    background: none;
}
.icare-nav-btn:hover  { color: #1a73e8; background: #f8f9ff; text-decoration: none; }
.icare-nav-btn.active { color: #1a73e8; }
.icare-nav-btn.active .icare-nav-icon { transform: scale(1.15); }

.icare-nav-home {
    border-left:  1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}
.icare-nav-home .icare-nav-icon { font-size: 24px !important; }
.icare-nav-home.active .icare-nav-icon {
    background: #1a73e8;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px !important;
}

.icare-nav-icon  { font-size: 20px; line-height: 1; }
.icare-nav-label { font-size: 9px; letter-spacing: .2px; }

/* Push content up so it's not hidden behind the nav */
.icare-frontend-wrap { padding-bottom: 76px !important; }

/* ================================================================
   Patient Search results
   ================================================================ */

.icare-ps-result-card {
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}
.icare-ps-result-header {
    padding: 12px 14px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
}
.icare-ps-result-header:hover { background: #e8f0fe; }
.icare-ps-ic { color: #5f6368; font-size: 12px; margin-left: 6px; }
.icare-ps-history { padding: 0 14px; }
.icare-ps-visit {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.icare-ps-visit:last-child { border-bottom: none; }
.icare-ps-visit-header { font-size: 13px; margin-bottom: 4px; }
.icare-ps-dx   { color: #d32f2f; font-size: 12px; margin-top: 2px; }
.icare-ps-plan { color: #5f6368; font-size: 12px; margin-top: 2px; }

/* ================================================================
   v1.8.7 — Locum page: modern minimalist redesign
   ================================================================ */

/* Wrap */
.icare-locum-wrap {
    max-width: 560px;
    margin: 0 auto;
    padding: 8px 0 20px;
}

/* Hero */
.icare-locum-hero {
    text-align: center;
    padding: 32px 16px 24px;
}
.icare-locum-hero-pill {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.icare-locum-hero-title {
    font-size: 28px;
    font-weight: 800;
    color: #0d1117;
    margin: 0 0 8px;
    letter-spacing: -.5px;
    line-height: 1.1;
}
.icare-locum-hero-title span { color: #1a73e8; }
.icare-locum-hero-sub {
    color: #5f6368;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Section */
.icare-locum-section {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 12px;
}
.icare-locum-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #80868b;
    margin-bottom: 16px;
}

/* Fields */
.icare-locum-field {
    margin-bottom: 14px;
}
.icare-locum-field:last-child { margin-bottom: 0; }
.icare-locum-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #3c4043;
    letter-spacing: .3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.icare-locum-req      { color: #d93025; }
.icare-locum-optional { color: #80868b; font-weight: 400; font-size: 10px; text-transform: none; }
.icare-locum-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    color: #0d1117;
    background: #fafafa;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    box-sizing: border-box;
}
.icare-locum-input:focus {
    border-color: #1a73e8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,115,232,.1);
}

/* Credential cards */
.icare-locum-cred-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.icare-locum-cred-card {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 14px;
}
.icare-locum-cred-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.icare-locum-cred-badge {
    background: #1a73e8;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: 5px;
    flex-shrink: 0;
}
.icare-locum-cred-badge--apc { background: #0d7a5f; }
.icare-locum-cred-title {
    font-size: 10px;
    color: #5f6368;
    line-height: 1.3;
}

/* File upload */
.icare-locum-file-input { display: none; }
.icare-locum-file-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #fff;
    border: 1.5px dashed #c0c5cc;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s;
    font-size: 11px;
    color: #5f6368;
}
.icare-locum-file-label:hover { border-color: #1a73e8; color: #1a73e8; }
.icare-locum-file-icon { font-size: 14px; flex-shrink: 0; }
.icare-locum-file-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Submit button */
.icare-locum-submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #0d1117;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .15s, transform .1s;
    margin-top: 12px;
}
.icare-locum-submit-btn:hover   { background: #1a73e8; }
.icare-locum-submit-btn:active  { transform: scale(.98); }
.icare-locum-submit-btn:disabled{ opacity: .55; cursor: not-allowed; }

/* Success state */
.icare-locum-success {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #e6f4ea;
    border: 1.5px solid #ceead6;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.icare-locum-success-icon { font-size: 24px; flex-shrink: 0; }
.icare-locum-success strong { display: block; color: #137333; margin-bottom: 2px; }
.icare-locum-success p { color: #5f6368; font-size: 13px; margin: 0; }

/* Status card */
.icare-locum-status-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    border-radius: 14px;
    border: 1.5px solid #e0e0e0;
    background: #fafafa;
    margin-bottom: 12px;
}
.icare-locum-status-icon { font-size: 28px; flex-shrink: 0; }
.icare-locum-status-title { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.icare-locum-status-msg   { font-size: 13px; color: #5f6368; line-height: 1.4; }
.icare-locum-status--pending  { border-color: #ffd54f; background: #fffde7; }
.icare-locum-status--approved { border-color: #a8dab5; background: #e6f4ea; }
.icare-locum-status--rejected { border-color: #f5c6c4; background: #fce8e6; }
.icare-locum-status--pending  .icare-locum-status-title { color: #e65100; }
.icare-locum-status--approved .icare-locum-status-title { color: #137333; }
.icare-locum-status--rejected .icare-locum-status-title { color: #c5221f; }

/* Login section */
.icare-locum-login-section {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    padding: 28px 20px;
    margin-top: 16px;
    text-align: center;
}
.icare-locum-login-divider {
    position: relative;
    margin-bottom: 16px;
}
.icare-locum-login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 1px;
    background: #e8eaed;
}
.icare-locum-login-divider span {
    position: relative;
    background: #fff;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #80868b;
}
.icare-locum-login-sub {
    color: #5f6368;
    font-size: 13px;
    margin-bottom: 16px;
}
.icare-locum-login-btn {
    display: block;
    padding: 13px 20px;
    background: #0d1117;
    color: #fff !important;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s;
    margin-bottom: 12px;
}
.icare-locum-login-btn:hover { background: #1a73e8; color: #fff !important; text-decoration: none; }
.icare-locum-register-link { font-size: 12px; color: #80868b; margin: 0; }
.icare-locum-register-link a { color: #1a73e8; text-decoration: none; font-weight: 600; }

/* ================================================================
   v1.8.8 — iLocum coming-soon banner + search surgeon/plan styling
   ================================================================ */

.icare-locum-coming-soon {
    display: inline-block;
    background: #fff8e1;
    border: 1.5px solid #ffd54f;
    color: #e65100;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    margin-top: 12px;
    line-height: 1.4;
}

.icare-ps-plan {
    color: #1a73e8;
    font-size: 12px;
    margin-top: 3px;
}

.icare-ps-surgeon {
    color: #137333;
    font-size: 12px;
    margin-top: 2px;
    font-weight: 600;
}

/* ================================================================
   v1.9.3 — Smaller bottom nav, iCare home button unchanged
   ================================================================ */

.icare-bottom-nav {
    height: 44px !important;
}

/* Side buttons — Locum & Search — smaller */
.icare-nav-btn {
    padding: 4px 2px !important;
    font-size: 8px !important;
    gap: 1px !important;
}
.icare-nav-icon  { font-size: 14px !important; }
.icare-nav-label { font-size: 8px !important; }

/* iCare home button stays the same visual size */
.icare-nav-home .icare-nav-icon  { font-size: 22px !important; }
.icare-nav-home .icare-nav-label { font-size: 9px  !important; font-weight: 700; }
.icare-nav-home.active .icare-nav-icon {
    width: 32px  !important;
    height: 32px !important;
    font-size: 16px !important;
}

/* Reduce content bottom padding to match new nav height */
.icare-frontend-wrap { padding-bottom: 52px !important; }

/* ================================================================
   v1.9.4 — iLocum: stack MMC/APC vertically on mobile
   ================================================================ */

@media (max-width: 520px) {
    .icare-locum-cred-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ================================================================
   v1.9.5 — Tighten icon-to-label gap in bottom nav
   ================================================================ */

.icare-nav-btn {
    gap: 0px !important;
    line-height: 1 !important;
}

/* ================================================================
   v2.0.1 — Frontend header notification bell
   ================================================================ */

.icare-frontend-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    text-decoration: none !important;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: border-color .15s, box-shadow .15s;
}
.icare-frontend-bell:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26,115,232,.2);
    text-decoration: none !important;
}
.icare-frontend-bell .icare-bell-icon { font-size: 15px; line-height: 1; }
.icare-frontend-bell .icare-bell-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    background: #d93025;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #fff;
    animation: icare-bell-pulse 2s infinite;
}

/* ================================================================
   v2.0.4 — For Consent action button
   ================================================================ */

.icare-flag-btn-consent::after {
    content: ' For Consent' !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    margin-left: 1px;
}
.icare-flag-btn-consent.active {
    background: #fff3e0 !important;
    border-color: #f57c00 !important;
    box-shadow: 0 0 0 2px rgba(245,124,0,.2) !important;
    color: #e65100 !important;
    opacity: 1 !important;
}

/* ================================================================
   v2.0.6 — Search result card: clickable to open shift
   ================================================================ */

.icare-ps-clickable {
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.icare-ps-clickable:hover {
    border-color: #1a73e8 !important;
    box-shadow: 0 3px 12px rgba(26,115,232,.15);
    transform: translateY(-1px);
}
.icare-ps-clickable:active { transform: translateY(0); }

/* ================================================================
   v2.0.7 — Visit history rows: clickable to open shift
   ================================================================ */

.icare-ps-visit-link {
    cursor: pointer;
    transition: background .12s;
}
.icare-ps-visit-link:hover {
    background: #e8f0fe;
    border-radius: 6px;
}

/* ================================================================
   v2.1.1 — Shift actions: two-row button layout
   ================================================================ */

.icare-shift-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}
.icare-shift-actions-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
