/*
 * AgriTracker — AgriBroker-style shell on Bootstrap 5.3 (vendored, no build).
 * Fixed header + sidebar on desktop; compact header + bottom tab bar on phones.
 */

:root {
  --primary: #1e3a5f;
  --primary-2: #24476f;
  --secondary: #2f5e8e;
  --accent-soft: #e8eef5;
  --accent-soft-2: #f1f5f9;
  --success: #16a34a;
  --warning: #b45309;
  --danger: #dc2626;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --header-h: 64px;
  --sidebar-w: 248px;
  --mobile-nav-h: 64px;

  --bs-body-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--border);
  --bs-primary: var(--primary-2);
  --bs-primary-rgb: 30, 58, 95;
  --bs-link-color: var(--primary-2);
  --bs-link-color-rgb: 30, 58, 95;
  --bs-link-hover-color: var(--primary);
  --bs-focus-ring-color: rgba(30, 58, 95, .25);
}

body { font-size: 15px; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.num, .kpi-value, .amount { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--text-muted) !important; }
.fw-semibold { font-weight: 600 !important; }

/* ---------- Bootstrap theme overrides ---------- */
.btn { font-weight: 600; border-radius: 8px; }
.btn-primary {
  --bs-btn-bg: var(--primary-2); --bs-btn-border-color: var(--primary-2);
  --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-bg: var(--primary); --bs-btn-active-border-color: var(--primary);
  --bs-btn-disabled-bg: var(--primary-2); --bs-btn-disabled-border-color: var(--primary-2);
}
.btn-outline-primary {
  --bs-btn-color: var(--primary-2); --bs-btn-border-color: var(--primary-2);
  --bs-btn-hover-bg: var(--primary-2); --bs-btn-hover-border-color: var(--primary-2);
  --bs-btn-active-bg: var(--primary); --bs-btn-active-border-color: var(--primary);
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--accent-soft); --bs-btn-hover-border-color: #cbd5e1; }
.form-control, .form-select { border-radius: 8px; border-color: #d1d5db; min-height: 42px; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--secondary); box-shadow: 0 0 0 .2rem rgba(30, 58, 95, .15); }
.form-check-input:checked { background-color: var(--primary-2); border-color: var(--primary-2); }
.form-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: .3rem; }
.form-text { font-size: 12.5px; }
.input-group-text { background: var(--accent-soft-2); border-color: #d1d5db; color: var(--text-muted); font-weight: 600; }
.form-control-lg { font-weight: 700; font-size: 1.25rem; }
.badge { font-weight: 600; }
.dropdown-menu { border-color: var(--border); box-shadow: 0 10px 30px rgba(15, 23, 42, .12); border-radius: 10px; }
.dropdown-item { padding: .5rem 1rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--primary-2); }
.modal-content { border: 0; border-radius: 14px; }
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.alert { border-radius: 10px; font-size: 15px; }
.table { --bs-table-hover-bg: var(--accent-soft-2); margin: 0; }
.table > :not(caption) > * > * { padding: .7rem 1rem; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.table td.n, .table th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; padding-top: var(--header-h); }
.app-main { margin-left: var(--sidebar-w); padding: 1.5rem 1.75rem 2.5rem; min-width: 0; }
.app-main-inner { max-width: 1240px; }

.app-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 1030;
  background: var(--primary); color: #fff; display: flex; align-items: center; gap: 1rem; padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; min-width: calc(var(--sidebar-w) - 1rem); }
.header-brand:hover { color: #fff; opacity: .92; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #4f86c6, #2f5e8e); color: #fff; font-size: 1.15rem; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.header-title { font-weight: 700; font-size: 17px; line-height: 1.15; }
.header-sub { font-size: 12px; opacity: .72; line-height: 1.2; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.header-btn {
  display: inline-flex; align-items: center; gap: .45rem; color: #fff; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 9px; padding: .45rem .8rem; font-weight: 600; font-size: 14px; text-decoration: none;
}
.header-btn:hover, .header-btn:focus, .header-btn.show { background: rgba(255, 255, 255, .16); color: #fff; }
.header-btn .firm-label { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user { background: transparent; border-color: transparent; }

.app-sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--sidebar-w); z-index: 1020;
  background: var(--card); border-right: 1px solid var(--border); overflow-y: auto; padding: .9rem 0 1.5rem;
}
.sidebar-nav { list-style: none; margin: 0; padding: 0 .75rem; }
.sidebar-nav .nav-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 1rem .75rem .4rem; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; margin-bottom: 2px; border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: 15px; text-decoration: none; transition: background .15s;
}
.sidebar-nav .nav-link i { font-size: 1.08rem; width: 22px; text-align: center; color: var(--secondary); }
.sidebar-nav .nav-link:hover { background: var(--accent-soft-2); color: var(--primary); }
.sidebar-nav .nav-link.active { background: var(--accent-soft); color: var(--primary); font-weight: 650; }
.sidebar-nav .nav-link.active i { color: var(--primary); }
.sidebar-footer { margin: 1.25rem 1.5rem 0; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }

/* Phone header + bottom bar */
.m-header { display: none; }
.mobile-bottom-nav { display: none; }

@media (max-width: 991.98px) {
  .app-shell { padding-top: 0; padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px)); }
  .app-header, .app-sidebar { display: none; }
  .app-main { margin-left: 0; padding: 1rem 1rem 1.5rem; }
  .m-header {
    display: block; position: sticky; top: 0; z-index: 1030; background: var(--primary); color: #fff;
    padding: calc(env(safe-area-inset-top, 0px) + .6rem) .85rem .6rem;
  }
  .m-header-inner { display: flex; align-items: center; gap: .6rem; }
  .m-header .brand-mark { width: 34px; height: 34px; }
  .m-header .dropdown { flex: 1; min-width: 0; }
  .m-header .header-btn { width: 100%; justify-content: space-between; }
  .m-header .header-btn .firm-label { max-width: none; flex: 1; text-align: left; }
  .m-header-title { flex: 1; font-weight: 700; font-size: 17px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-icon-btn { color: #fff; font-size: 1.45rem; line-height: 1; padding: .25rem; text-decoration: none; background: none; border: 0; }
  .m-icon-btn:hover { color: #fff; }
  .mobile-bottom-nav {
    display: flex; justify-content: space-around; align-items: stretch; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(15, 23, 42, .06);
  }
  .mobile-bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 600;
  }
  .mobile-bottom-nav a i { font-size: 1.3rem; }
  .mobile-bottom-nav a.active { color: var(--primary-2); }
}

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-title { font-size: 28px; font-weight: 750; margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.page-subtitle { color: var(--text-muted); margin: .25rem 0 0; font-size: 14.5px; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-size: 14px; font-weight: 600; text-decoration: none; margin-bottom: .6rem; }
@media (max-width: 575.98px) {
  .page-title { font-size: 22px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions .btn { flex: 1; }
}

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .kpi-grid, .kpi-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; } }
.kpi-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .6rem; box-shadow: 0 1px 2px rgba(30, 58, 95, .05); min-width: 0;
}
.kpi-card-header { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.kpi-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary-2); font-size: 1.05rem; flex: none; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); line-height: 1.3; }
.kpi-value { font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 800; color: var(--primary); line-height: 1.15; word-break: break-word; }
.kpi-hint { font-size: 12.5px; color: var(--text-muted); margin-top: -.25rem; }
.kpi-card--warning .kpi-icon { background: #fef3c7; color: #92400e; }
.kpi-card--warning .kpi-value { color: var(--warning); }
.kpi-card--info .kpi-icon { background: #e0f2fe; color: #0369a1; }
.kpi-card--danger .kpi-icon { background: #fee2e2; color: #991b1b; }
.kpi-card--hero { background: linear-gradient(135deg, var(--primary), var(--secondary)); border-color: transparent; color: #fff; }
.kpi-card--hero .kpi-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.kpi-card--hero .kpi-label, .kpi-card--hero .kpi-hint { color: rgba(255, 255, 255, .8); }
.kpi-card--hero .kpi-value { color: #fff; }
@media (max-width: 575.98px) {
  .kpi-card { padding: .8rem .85rem; }
  .kpi-icon { width: 30px; height: 30px; font-size: .95rem; }
  .kpi-value { font-size: 1.2rem; }
}

/* ---------- Quick actions ---------- */
.quick-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.btn-quick {
  display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.1rem; border-radius: 9px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--border); background: var(--card); color: var(--text); text-decoration: none; transition: all .15s;
}
.btn-quick i { color: var(--secondary); }
.btn-quick:hover { background: var(--accent-soft-2); color: var(--primary); border-color: var(--secondary); }
.btn-quick.primary { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.btn-quick.primary i { color: #fff; }
.btn-quick.primary:hover { background: var(--primary); }
@media (max-width: 575.98px) {
  .quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .btn-quick { justify-content: center; padding: .7rem .6rem; font-size: 14px; }
}

/* ---------- Panels ---------- */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1.25rem; overflow: hidden; box-shadow: 0 1px 2px rgba(30, 58, 95, .04); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.15rem; border-bottom: 1px solid var(--border); background: #fafbfc; }
.panel-header h3 { margin: 0; font-size: 16px; font-weight: 650; }
.panel-header .panel-sub { font-size: 13px; color: var(--text-muted); }
.panel-body { padding: 0; }
.panel-body.padded { padding: 1.15rem; }
.panel-footer { padding: .7rem 1.15rem; border-top: 1px solid var(--border); background: #fafbfc; font-size: 14px; }
.btn-action {
  display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .7rem; border-radius: 7px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border); background: #fff; color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-action:hover { background: var(--accent-soft-2); color: var(--primary); }
.btn-action.primary { background: var(--primary-2); color: #fff; border-color: var(--primary-2); }
.btn-action.danger { color: var(--danger); }
.btn-action.danger:hover { background: #fef2f2; }
form.button_to { display: inline; }

/* ---------- Rows (list items that work on desktop and phone) ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--border); }
.row-item { display: flex; align-items: center; gap: .85rem; padding: .8rem 1.15rem; color: inherit; text-decoration: none; min-height: 60px; }
a.row-item:hover { background: var(--accent-soft-2); color: inherit; }
.row-item .row-main { flex: 1; min-width: 0; }
.row-item .row-title { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .row-sub { font-size: 13.5px; color: var(--text-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .row-end { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.row-item .row-end strong { display: block; font-size: 15.5px; }
.row-item .row-end small { display: block; font-size: 12.5px; color: var(--text-muted); }
.row-item .chev { color: #9ca3af; }
.day-head { display: flex; justify-content: space-between; padding: .5rem 1.15rem; background: var(--accent-soft-2); font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-top: 1px solid var(--border); }
.day-head:first-child { border-top: 0; }

/* Breakdown lines */
.line { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--border); }
.line:last-child { border-bottom: 0; }
.line small { display: block; color: var(--text-muted); font-size: 13px; }
.line .amt { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line.total { border-top: 2px solid var(--border); border-bottom: 0; font-weight: 750; margin-top: .25rem; padding-top: .7rem; }

/* Avatar */
.avatar { --h: 140; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: hsl(var(--h) 38% 40%); color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.avatar-lg { width: 58px; height: 58px; font-size: 20px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }

/* Worker cards */
.worker-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.worker-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(30, 58, 95, .04); transition: border-color .15s, box-shadow .15s; }
.worker-card:hover { border-color: rgba(30, 58, 95, .35); box-shadow: 0 6px 18px rgba(30, 58, 95, .08); color: inherit; }
.worker-card .who { display: flex; gap: .8rem; align-items: center; }
.worker-card .name { font-weight: 700; font-size: 16px; }
.worker-card .figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.worker-card .figures span { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.worker-card .figures b { font-variant-numeric: tabular-nums; font-size: 15px; }
.worker-card .figures .due b { color: var(--warning); }

/* Work type picker (radio buttons styled as cards) */
.work-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .5rem; }
.work-picker .btn {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 1px; height: 100%;
  padding: .55rem .75rem; border: 1px solid var(--border); background: #fff; color: var(--text); font-weight: 650; font-size: 14px;
}
.work-picker .btn small { color: var(--text-muted); font-weight: 600; font-size: 12.5px; }
.work-picker .btn .custom { color: var(--warning); font-size: 11px; font-weight: 700; }
.work-picker .btn:hover { border-color: var(--secondary); background: var(--accent-soft-2); }
.work-picker .btn-check:checked + .btn { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.work-picker .btn-check:checked + .btn small, .work-picker .btn-check:checked + .btn .custom { color: rgba(255, 255, 255, .85); }
.work-picker .btn.add { align-items: center; justify-content: center; flex-direction: row; gap: .35rem; border-style: dashed; color: var(--primary-2); background: transparent; }
.work-picker .btn-check:focus-visible + .btn { box-shadow: 0 0 0 .2rem rgba(30, 58, 95, .25); }

/* Calculation line */
.calc-box { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding: .9rem 1rem; border-radius: 10px; background: var(--accent-soft); margin-bottom: 1rem; }
.calc-box .formula { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.calc-box .total { font-size: 1.75rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.calc-box .note { width: 100%; font-size: 12.5px; color: var(--warning); font-weight: 600; }

/* Mini bar chart (last 7 days) */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; align-items: end; height: 150px; padding: .75rem 1.15rem 0; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .3rem; }
.bar .fill { width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: #c7d6ea; min-height: 3px; }
.bar.today .fill { background: var(--secondary); }
.bar .val { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; padding: .35rem 1.15rem .85rem; font-size: 11.5px; color: var(--text-muted); text-align: center; font-weight: 600; }

/* Pay report rows */
.pay-row { padding: .95rem 1.15rem; }
.pay-row + .pay-row { border-top: 1px solid var(--border); }
.pay-row.is-paid { background: #f3f7fc; }
.pay-row .amount { font-size: 1.2rem; font-weight: 800; }
.pay-row.is-paid .amount { color: var(--secondary); }

/* Empty state */
.empty-state { text-align: center; padding: 2.5rem 1.25rem; color: var(--text-muted); }
.empty-state i { font-size: 2.6rem; color: #d1d5db; display: block; margin-bottom: .6rem; }
.empty-state p { margin-bottom: 1rem; font-size: 15px; }

/* Setup checklist on the dashboard */
.setup-steps { display: grid; gap: .6rem; }
.setup-step { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border: 1px dashed #bccbe0; border-radius: 10px; background: #fbfcfe; text-decoration: none; color: inherit; }
.setup-step:hover { border-color: var(--secondary); background: var(--accent-soft-2); color: inherit; }
.setup-step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary-2); font-weight: 700; font-size: 13px; flex: none; }

/* Code / link chip */
.code-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .08em; background: var(--accent-soft); color: var(--primary); border-radius: 6px; padding: .15rem .5rem; }

/* More page */
.lead-icon { font-size: 1.15rem; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary-2); flex: none; }

/* ---------- Auth ---------- */
.auth-wrapper {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
  background: radial-gradient(900px 500px at 15% -10%, rgba(79, 134, 198, .35), transparent 60%), var(--primary);
}
.auth-box { width: 100%; max-width: 430px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: .65rem; margin-bottom: 1.25rem; color: #fff; text-decoration: none; }
.auth-brand:hover { color: #fff; }
.auth-brand .brand-mark { width: 44px; height: 44px; font-size: 1.4rem; border-radius: 12px; }
.auth-brand span { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.auth-card { background: #fff; border-radius: 14px; padding: 1.75rem; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.auth-card h1 { font-size: 22px; font-weight: 750; color: var(--primary); margin-bottom: .25rem; }
.auth-card .lead-text { color: var(--text-muted); margin-bottom: 1.25rem; font-size: 14.5px; }
.auth-foot { text-align: center; margin-top: 1rem; color: rgba(255, 255, 255, .8); font-size: 14px; }
.auth-foot a { color: #fff; font-weight: 600; }
.auth-wrapper .alert { margin-bottom: 1rem; }
.choice { display: flex; align-items: center; gap: .9rem; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; margin-bottom: .75rem; transition: all .15s; }
.choice:hover { border-color: var(--secondary); background: var(--accent-soft-2); color: inherit; }
.choice .bubble { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary-2); font-size: 1.35rem; flex: none; }
.choice strong { display: block; font-size: 16px; }
.choice span.sub { color: var(--text-muted); font-size: 13.5px; }

/* Worker portal shell (no sidebar) */
.portal-header { background: var(--primary); color: #fff; padding: calc(env(safe-area-inset-top, 0px) + .7rem) 1rem .7rem; position: sticky; top: 0; z-index: 1030; }
.portal-header .inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: .65rem; }
.portal-main { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem 2.5rem; }

/* Segmented period picker */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--accent-soft-2); border: 1px solid var(--border); border-radius: 10px; }
.seg a { padding: .35rem .8rem; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.seg a.active { background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Print */
@media print {
  .app-header, .app-sidebar, .m-header, .mobile-bottom-nav, .no-print, .btn, .btn-action, .alert { display: none !important; }
  .app-shell { padding: 0; }
  .app-main { margin: 0; padding: 0; }
  .panel { break-inside: avoid; border-color: #ccc; }
  .collapse:not(.show) { display: block !important; }
}

/* Phones: page action buttons share one row evenly. */
@media (max-width: 575.98px) {
  .page-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .page-actions .btn, .page-actions .dropdown > .btn, .page-actions form .btn { width: 100%; white-space: nowrap; padding-left: .5rem; padding-right: .5rem; }
  .table > :not(caption) > * > * { padding: .6rem .7rem; }
}
@media (min-width: 992px) { .sticky-lg { position: sticky; top: calc(var(--header-h) + 1rem); } }
.page-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; }
.panel.h-100 { display: flex; flex-direction: column; }
.panel.h-100 > .panel-body { flex: 1; }
img.brand-mark { background: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); padding: 0; object-fit: contain; }
