/* FirstMed workspace: one task per page, shared across administration and employee mode. */
.bulk-payment-preview { max-height: 48vh; overflow: auto; margin: 20px 0; }
.bulk-payment-preview thead th { position: sticky; top: 0; z-index: 1; }
:root { --blue: #087d60; --blue-dark: #08634e; --navy: #112f3e; --ink: #243e4b; --muted: #657a85; --line: #dfe7eb; --background: #f3f6f8; --radius: 12px; --shadow: 0 8px 24px rgba(17,47,62,.04); }
body { background: var(--background); }
.app-icon { width: 21px; height: 21px; flex-shrink: 0; vertical-align: middle; }
.skip-link { position: fixed; z-index: 2000; top: -100px; left: 20px; background: white; padding: 12px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.app-frame { display: grid; grid-template-columns: 232px minmax(0,1fr); min-height: 100dvh; }
.app-sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 30px 16px 22px; background: #112f3e; color: #bdcdd5; overflow-y: auto; }
.sidebar-brand { padding: 0 10px 18px; }
.sidebar-brand strong { color: white; font-size: 1.05rem; letter-spacing: .13em; }
.sidebar-brand small { color: #58d6b1; }
.sidebar-brand .brand-mark { width: 37px; height: 37px; border-radius: 12px; }
.sidebar-label { padding: 0 14px; font-size: .65rem; letter-spacing: .12em; font-weight: 700; color: #8ba6b5; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; margin-top: -9px; }
.sidebar-nav a { display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 10px 14px; border-radius: 8px; color: #c6d6df; font-size: .88rem; font-weight: 500; }
.sidebar-nav a:hover { background: #1b3e4f; color: white; }
.sidebar-nav a[aria-current="page"] { background: #235449; color: #b2f4d6; font-weight: 650; box-shadow: inset 3px 0 #58d6b1; }
.sidebar-footer { margin-top: auto; padding: 20px 10px 0; border-top: 1px solid #2a4755; display: flex; align-items: center; gap: 10px; }
.sidebar-footer strong, .sidebar-footer small { display: block; font-size: .75rem; }
.sidebar-footer small { color: #8ba6b5; margin-top: 2px; }
.sidebar-live-dot { width: 7px; height: 7px; background: #58d6b1; border-radius: 50%; }
.app-workspace { min-width: 0; }
.workspace-topbar { min-height: 78px; padding: 14px 32px; border-bottom: 1px solid var(--line); background: white; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.workspace-location { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--muted); font-size: .875rem; }
.workspace-location > span { overflow-wrap: anywhere; }
.workspace-account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.workspace-last-login { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #f7faf9; line-height: 1.25; }
.workspace-last-login > span { grid-column: 1 / -1; color: var(--muted); font-size: .62rem; }
.workspace-last-login strong { max-width: 190px; overflow: hidden; color: var(--navy); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.workspace-last-login time { color: var(--muted); font-size: .65rem; white-space: nowrap; }
.workspace-last-login:not(.is-empty):hover { border-color: #99b6b0; background: #f0f8f5; }
.workspace-last-login.is-empty { color: var(--muted); }
.workspace-account .avatar, .person-cell .avatar { width: 36px; height: 36px; border-radius: 50%; background: #e6f1ed; color: #087d60; font-size: .8rem; flex-shrink: 0; }
.workspace-account-copy strong, .workspace-account-copy small { display: block; }
.workspace-account-copy strong { font-size: .8rem; font-weight: 600; }
.workspace-account-copy small { font-size: .72rem; color: var(--muted); }
.workspace-account .logout-link { font-size: .78rem; min-height: 44px; padding: 6px; color: var(--muted); }
.mode-switch { display: flex; padding: 3px; margin-right: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fa; }
.mode-switch a { padding: 6px 9px; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.mode-switch a[aria-current] { background: white; color: var(--blue); border-radius: 5px; box-shadow: 0 1px 4px #112f3e14; font-weight: 650; }
.navigation-trigger { display: none; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--navy); cursor: pointer; }
.app-frame .app-shell { width: 100%; max-width: 1480px; padding: 32px; margin: 0 auto; }
.app-frame .page-heading { margin-bottom: 28px; gap: 20px; }
.app-frame .page-heading h1 { font-size: clamp(1.6rem,2.2vw,2rem); line-height: 1.25; letter-spacing: -.035em; margin: 3px 0 8px; }
.app-frame .page-heading p { font-size: .9rem; color: var(--muted); margin: 0; }
.app-frame .eyebrow, .app-frame .section-kicker { color: var(--muted); font-size: .64rem; letter-spacing: .12em; }
.app-frame .panel { border-radius: 12px; box-shadow: none; }
.app-frame .section-panel, .task-panel { padding: 24px; margin-bottom: 24px; }
.app-frame .panel-head { margin-bottom: 18px; }
.app-frame h2 { font-size: 1.05rem; letter-spacing: -.015em; }
.app-frame .button, .firstmed-dialog .button { min-height: 44px; border-radius: 8px; padding: 10px 16px; font-size: .85rem; box-shadow: none; }
.app-frame .button-primary, .firstmed-dialog .button-primary { background: var(--blue); }
.app-frame .button-secondary { background: white; border: 1px solid var(--line); color: var(--ink); }
.app-frame .button-secondary:hover { border-color: #99b6b0; }
.app-frame .field input, .app-frame .field select, .app-frame .field textarea, .firstmed-dialog .field input, .firstmed-dialog .field select { border-radius: 8px; min-height: 44px; padding: 10px 12px; }
.app-frame .field > span:first-child { font-size: .8rem; }
.app-frame .stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-bottom: 26px; }
.app-frame .stat-card { display: flex; align-items: flex-start; flex-direction: column; min-height: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: none; }
.app-frame .stat-card::before, .app-frame .stat-card::after { display: none; }
.app-frame .stat-card > span { font-size: .8rem; color: var(--muted); }
.app-frame .stat-card > strong { font-size: clamp(1.5rem,2.2vw,2rem); line-height: 1.3; margin: 10px 0; color: var(--navy); overflow-wrap: anywhere; }
.app-frame .stat-card > small { font-size: .72rem; color: var(--muted); }
.dashboard-task { display: flex; align-items: center; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.dashboard-task > div { flex: 1; }
.dashboard-task strong { font-size: .9rem; }
.dashboard-task p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.dashboard-task .text-button { font-size: .78rem; }
.task-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #edf2f5; color: #4b6f83; flex-shrink: 0; }
.task-icon-green { background: #e8f5ef; color: #087d60; }
.dashboard-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .78rem; }
.dashboard-footer .text-button { font-size: inherit; }
.page-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.page-toolbar .field { margin: 0; flex: 1; }
.page-tabs { display: flex; flex-wrap: wrap; gap: 4px 24px; border-bottom: 1px solid var(--line); margin: 0 0 24px; }
.page-tabs a { padding: 12px 0; border-bottom: 2px solid transparent; font-size: .875rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.page-tabs a[aria-current] { color: var(--blue); border-bottom-color: var(--blue); font-weight: 650; }
.page-tabs a:hover { color: var(--ink); }
.page-tabs a > span { padding: 1px 7px; background: #e7edf0; border-radius: 5px; color: var(--muted); font-size: .72rem; }
.app-frame .table-wrap { margin: 0; max-width: 100%; }
.app-frame th { padding: 12px; background: #f6f8f9; font-size: .67rem; letter-spacing: .05em; }
.app-frame td { padding: 16px 12px; font-size: .83rem; }
.app-frame tbody tr:hover { background: #fafcfc; }
.app-frame td small { font-size: .75rem; margin-top: 4px; overflow-wrap: anywhere; }
.app-frame td strong { font-size: .85rem; }
.app-frame .badge { font-size: .72rem; padding: 5px 10px; }
.person-cell { display: flex; gap: 12px; align-items: center; }
.person-cell > div { min-width: 0; }
.person-link { color: var(--navy); font-size: .85rem; font-weight: 650; }
.person-link:hover { text-decoration: underline; }
.profile-balance { color: var(--muted); font-size: .75rem; text-align: right; }
.profile-balance strong { display: block; margin-top: 3px; color: var(--navy); font-size: 1.45rem; white-space: nowrap; }
.profile-membership .panel-head p { color: var(--muted); font-size: .8rem; margin-bottom: 0; }
.profile-membership .renewal-timeline { margin-bottom: 0; }
.profile-actions p { color: var(--muted); font-size: .85rem; }
.app-frame .package-admin-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.app-frame .package-editor { padding: 18px; border-radius: 10px; }
.app-frame .package-admin-list .package-editor > div { min-width: 0; width: 100%; }
.app-frame .status-select { font-size: .78rem; border-radius: 7px; min-height: 38px; }
.app-frame .renewal-shell { padding: 32px; }
.app-frame .renewal-card { max-width: 1100px; padding: 36px; border-radius: 12px; box-shadow: none; }
.app-frame .renewal-card h1 { font-size: clamp(1.5rem,2.15vw,2rem); white-space: normal; text-wrap: balance; }
.app-frame .membership-card { border-radius: 12px; box-shadow: none; padding: 28px; background: #163e4b; }
.app-frame .membership-top h2 { font-size: 1.7rem; }
.app-frame .membership-details { margin-top: 24px; }
.app-frame .renewal-timeline { border-radius: 12px; background: #fff; }
.app-frame .user-summary-grid { margin: 22px 0; gap: 16px; }
.app-frame .summary-card { border-radius: 10px; box-shadow: none; padding: 18px; }
.firstmed-dialog .app-sidebar.in-sweetalert { display: flex; height: auto; padding: 20px; border-radius: 10px; gap: 20px; background: #112f3e; text-align: left; }
.firstmed-dialog .app-sidebar .sidebar-footer { display: none; }
.firstmed-dialog .app-sidebar .sidebar-brand { padding-bottom: 0; }
@media (max-width: 1250px) {
    .app-frame { grid-template-columns: 210px minmax(0,1fr); }
    .workspace-topbar { padding: 12px 24px; }
    .workspace-account-copy { display: none; }
    .workspace-last-login > span { display: none; }
    .app-frame .app-shell { padding: 26px; }
    .app-frame .package-admin-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .app-frame .settings-grid, .app-frame .sync-layout { grid-template-columns: minmax(0,1fr); }
    .app-frame .run-history { position: static; }
}
@media (max-width: 1000px) {
    .app-frame { grid-template-columns: minmax(0,1fr); }
    .app-sidebar { position: static; height: auto; gap: 14px; padding: 18px; }
    .app-sidebar .sidebar-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 0; }
    .app-sidebar .sidebar-footer, .app-sidebar .sidebar-label { display: none; }
    .app-sidebar .sidebar-brand { padding-bottom: 0; }
    .has-dialog-navigation .app-frame .app-sidebar { display: none; }
    .has-dialog-navigation .navigation-trigger { display: grid; place-items: center; }
    .firstmed-dialog .app-sidebar .sidebar-nav { display: flex; }
    .app-frame .responsive-table, .app-frame .responsive-table tbody { display: block; width: 100%; }
    .app-frame .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .app-frame .responsive-table tbody tr { display: block; margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
    .app-frame .responsive-table td { display: block; width: 100%; padding: 7px 0; border: 0; overflow-wrap: anywhere; }
    .app-frame .responsive-table td::before { display: block; content: attr(data-label); margin-bottom: 4px; color: var(--muted); font-size: .72rem; font-weight: 600; }
    .app-frame .activity-history-table td:nth-child(3) { min-width: 0; }
}
@media (max-width: 650px) {
    .workspace-topbar { align-items: flex-start; padding: 12px 16px; gap: 8px; }
    .workspace-location > span { display: none; }
    .workspace-account { justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
    .workspace-account .avatar { display: none; }
    .workspace-last-login { padding: 7px 9px; }
    .workspace-last-login strong { max-width: 125px; }
    .workspace-last-login time { display: none; }
    .mode-switch { margin: 0; }
    .mode-switch a { padding: 9px; }
    .app-frame .app-shell { padding: 24px 16px 32px; }
    .app-frame .page-heading { gap: 16px; margin-bottom: 22px; }
    .app-frame .page-heading > .popover { width: 100%; }
    .app-frame .page-heading h1 { font-size: 1.65rem; }
    .app-frame .stats-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .app-frame .stat-card { padding: 18px; }
    .app-frame .stat-card > strong { margin: 5px 0; font-size: 1.85rem; }
    .app-frame .section-panel, .task-panel { padding: 16px; }
    .dashboard-task { flex-wrap: wrap; gap: 12px; }
    .dashboard-task > div { flex-basis: calc(100% - 58px); }
    .dashboard-task > .text-button { margin-left: 54px; }
    .page-tabs { gap: 4px 18px; }
    .page-tabs a { font-size: .81rem; }
    .app-frame .package-admin-list { grid-template-columns: minmax(0,1fr); }
    .profile-balance { text-align: left; }
    .profile-actions .form-actions, .profile-actions form, .profile-actions button { width: 100%; }
    .app-frame .renewal-shell { padding: 24px 16px; }
    .app-frame .renewal-card { padding: 24px 18px; }
    .app-frame .membership-card { padding: 24px 20px; }
    .app-sidebar .sidebar-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
/* Selection actions stay together and wrap on smaller screens. */
.payment-reminder-toolbar { flex-wrap: wrap; }
.payment-reminder-toolbar > small { flex-basis: 100%; }
.payment-status-actions { align-items: end; flex-wrap: wrap; }
.payment-status-actions .field { min-width: 180px; margin: 0; }
