/* ============================================================
   Muscle Manage — Forms: sectioned create/edit pages, affixes,
   choice pills, sticky action bar, summary cards
   ============================================================ */

/* Page head with back link */
.form-head .back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; margin-bottom: 8px; }
.form-head .back-link:hover { color: var(--brand-blue); }

/* Layout: form card + optional sticky summary column */
.form-shell { max-width: 1040px; }
.form-shell.narrow { max-width: 880px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; max-width: 1240px; }
.form-layout .form-aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1200px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-layout .form-aside { position: static; }
  .form-layout .form-aside .tip-card { display: none; }
}

/* Sections: title/description on the left, fields on the right */
.fsec { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: 24px; border-bottom: 1px solid var(--border); }
.fsec:last-of-type { border-bottom: 0; }
.fsec__head { display: flex; gap: 12px; align-items: flex-start; }
.fsec__ico { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--brand-blue-soft); color: var(--brand-blue); font-size: 16px; transition: var(--trans); }
.fsec__head h2 { font-size: 14.5px; font-family: var(--font-sans); font-weight: 700; margin: 6px 0 3px; }
.fsec__head p { font-size: 12.5px; color: var(--text-2); margin: 0; line-height: 1.5; }
.fsec__body { margin-top: 0; align-content: start; }
.fsec.is-highlight .fsec__ico { background: var(--warning-soft); color: var(--warning); }
@media (max-width: 992px) {
  .fsec { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .fsec__head { align-items: center; }
  .fsec__head h2 { margin: 0 0 2px; }
}

/* Labels, hints, errors */
.form-label .req, .form-actions .req { color: var(--danger); margin-left: 2px; font-weight: 700; }
.form-label .opt { color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: 4px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.form-hint b { color: var(--text-2); font-weight: 600; }
.invalid-feedback i { margin-right: 2px; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); background-image: none; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.form-control:hover:not(:focus):not(.is-invalid), .form-select:hover:not(:focus):not(.is-invalid) { border-color: var(--border-strong); }
.form-control, .form-select { min-height: 40px; }
.form-card select.form-select, .modal select.form-select { height: auto; font-weight: 400; padding: 9px 34px 9px 12px; }
.input-icon .form-select { padding-left: 36px !important; }
.input-icon i { pointer-events: none; z-index: 2; }
.form-card textarea.form-control, .modal textarea.form-control { resize: vertical; min-height: 72px; }

/* Prefix / suffix (₹ … / month) */
.input-affix { flex-wrap: nowrap; }
.input-affix .input-group-text { background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 600; border-radius: 10px; }
.input-affix > .form-control { border-radius: 10px; }
.input-affix > :not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.input-affix > :not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-affix:focus-within .input-group-text { border-color: var(--brand-blue); color: var(--brand-blue); }
.input-affix.has-error .input-group-text { border-color: var(--danger); }

/* Segmented radio pills (status, gender, method …) */
.choice-group { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-group input { position: absolute; opacity: 0; pointer-events: none; }
.choice-group label {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; transition: var(--trans); margin: 0;
}
.choice-group label:hover { border-color: var(--border-strong); color: var(--text); }
.choice-group input:checked + label { background: var(--brand-blue-soft); border-color: var(--brand-blue); color: var(--brand-blue-700); }
:root[data-theme="dark"] .choice-group input:checked + label { color: #93b4ff; }
.choice-group input:focus-visible + label { box-shadow: var(--ring); }
.choice-group input[value="active"]:checked + label,
.choice-group input[value="paid"]:checked + label { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.choice-group input[value="inactive"]:checked + label { background: var(--surface-3); border-color: var(--gray-400); color: var(--text-2); }
.choice-group input[value="pending"]:checked + label { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.choice-group.has-error label { border-color: var(--danger); }
.choice-group.fill label { flex: 1 1 0; justify-content: center; white-space: nowrap; }

/* Quick-fill chips under a field */
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-chips button { border: 1px dashed var(--border-strong); background: transparent; color: var(--text-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--trans); }
.quick-chips button:hover, .quick-chips button.on { border-style: solid; border-color: var(--brand-blue); color: var(--brand-blue); background: var(--brand-blue-soft); }

/* Day chips (batch schedule) */
.day-chips label { min-width: 54px; text-align: center; padding: 8px 12px; transition: var(--trans); margin: 0; }
.day-chips label:hover { border-color: var(--border-strong); }
.day-chips.has-error label { border-color: var(--danger); }

/* Switch rows */
.switch-row, .switch-row.form-switch { padding-left: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; margin: 0; transition: var(--trans); }
.switch-row:hover { border-color: var(--border-strong); }
.switch-row + .switch-row { margin-top: 8px; }
.switch-row b { display: block; font-size: 13px; font-weight: 600; }
.switch-row small { color: var(--text-3); font-size: 12px; }
.switch-row .form-check-input { width: 2.4em; height: 1.3em; margin: 0; flex-shrink: 0; cursor: pointer; }
.form-check-input:checked { background-color: var(--brand-blue); border-color: var(--brand-blue); }

/* Range with live value */
.range-wrap { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.range-wrap .form-range { flex: 1; }
.range-val { min-width: 64px; text-align: center; font-weight: 700; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; background: var(--surface-3); }
.range-val.hot { background: var(--success-soft); color: var(--success); }
.range-val.warm { background: var(--warning-soft); color: var(--warning); }
.range-val.cold { background: var(--info-soft); color: var(--info); }

/* Sticky action bar */
.form-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: 0 -8px 16px -14px rgba(15,23,42,.35);
}
.form-actions__note { font-size: 12px; color: var(--text-3); }
@media (max-width: 768px) {
  .form-actions { bottom: calc(62px + env(safe-area-inset-bottom)); padding: 12px 16px; border-radius: 0; }
  .form-actions__note { display: none; }
  .form-actions > .d-flex { width: 100%; }
  .form-actions .btn { flex: 1; justify-content: center; white-space: nowrap; }
}

/* Submit busy state */
.btn.is-busy { pointer-events: none; opacity: .85; }
.btn.is-busy i { display: none; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: dojo-spin .7s linear infinite; }
@keyframes dojo-spin { to { transform: rotate(360deg); } }

/* Summary side card */
.sum-card .card-body { padding: 18px; }
.sum-card h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-family: var(--font-sans); margin-bottom: 10px; }
.sum-hero { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.sum-hero .avatar-lg { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-blue-soft); color: var(--brand-blue); font-weight: 700; font-size: 15px; flex-shrink: 0; }
.sum-hero b { display: block; font-size: 14.5px; line-height: 1.3; word-break: break-word; }
.sum-hero small { color: var(--text-3); font-size: 12px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; }
.sum-row span { color: var(--text-2); }
.sum-row b { font-weight: 600; text-align: right; }
.sum-row b.muted-val { color: var(--text-3); font-weight: 500; }
.sum-total { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 12px; align-items: baseline; }
.sum-total b { font-size: 22px; font-family: var(--font-display); }
.tip-card { background: var(--brand-blue-soft); border-color: transparent; box-shadow: none; }
.tip-card .card-body { font-size: 12.5px; color: var(--text-2); display: flex; gap: 10px; padding: 14px 16px; }
.tip-card i { color: var(--brand-blue); font-size: 16px; }
.tag-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-preview:empty { display: none; }
.tag-preview span { background: var(--surface-3); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); }

/* Modal forms */
.modal .modal-body.row { margin: 0; }
.modal-title small { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 400; font-family: var(--font-sans); margin-top: 2px; }
.modal-title .t-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--brand-blue-soft); color: var(--brand-blue); font-size: 16px; }
.modal-header .modal-title { display: flex; align-items: center; gap: 12px; }
.modal-divider { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 10px; margin-top: 20px !important; margin-bottom: -4px; }
.modal-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.modal-footer { justify-content: space-between; }
.modal-footer .form-actions__note { margin-right: auto; }
@media (max-width: 576px) {
  .modal-footer .form-actions__note { display: none; }
  .modal-footer .btn { flex: 1; justify-content: center; }
}

/* Static (non-sticky) action bar — for pages with several independent forms */
.form-actions.is-static { position: static; box-shadow: none; }
@media (max-width: 768px) { .form-actions.is-static { border-radius: 0 0 var(--radius-lg) var(--radius-lg); } }

/* Card header used above sectioned forms (settings) */
.form-card > .card-head + .fsec { padding-top: 22px; }

/* Settings: content column is narrower, so stack sections earlier */
.settings-wrap .fsec { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
@media (max-width: 1280px) {
  .settings-wrap .fsec { grid-template-columns: 1fr; gap: 16px; }
  .settings-wrap .fsec__head { align-items: center; }
  .settings-wrap .fsec__head h2 { margin: 0 0 2px; }
}
.settings-wrap .card + .card { margin-top: 20px; }

/* Brand colour swatches */
.brand-swatch { cursor: pointer; transition: var(--trans); margin: 0; }
.brand-swatch:hover { border-color: var(--border-strong); }
.brand-swatch code { font-size: 12px; color: var(--text-2); background: var(--surface-3); padding: 3px 8px; border-radius: 6px; }

/* Status checklist rows (messaging) */
.check-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: 0; }
.check-row > i { font-size: 17px; margin-top: 1px; }
.check-row b { font-size: 13px; font-weight: 600; display: block; }
.check-row small { color: var(--text-3); font-size: 12px; }
.channel { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.channel:last-child { border-bottom: 0; padding-bottom: 0; }
.channel:first-child { padding-top: 0; }
.channel__ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.channel__body { flex: 1; min-width: 0; }
.channel__title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.copy-field { display: flex; gap: 6px; margin-top: 10px; }
.copy-field input { font-family: ui-monospace, monospace; font-size: 12px; background: var(--surface-2); }

/* Inline add row (martial arts) */
.inline-add { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.inline-add > .field { flex: 1; min-width: 220px; max-width: 420px; }

/* Password strength */
.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); transition: var(--trans); }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: var(--warning); }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: var(--info); }
.pw-meter[data-score="4"] span { background: var(--success); }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--text-3); padding: 4px 6px; z-index: 3; }
.pw-toggle:hover { color: var(--text); }
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 40px; }

.form-actions .btn { white-space: nowrap; }
.form-actions__note { min-width: 0; }

/* Template editor preview */
.tpl-preview { position: sticky; top: 0; padding: 16px; border-radius: 12px; background: var(--app-bg); background-image: radial-gradient(var(--border) 0.5px, transparent 0.5px); background-size: 18px 18px; border: 1px solid var(--border); }
.tpl-preview .msg { white-space: pre-wrap; }
.tpl-preview code { font-size: 11.5px; }

/* ============================================================
   Attendance marking
   ============================================================ */
.att-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.att-search { flex: 1; min-width: 200px; max-width: 320px; }
.att-tally { margin-top: 14px; }
.att-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.att-bar span { display: block; height: 100%; transition: width var(--trans); width: 0; }
.att-bar [data-bar="present"] { background: var(--success); }
.att-bar [data-bar="late"] { background: #f59e0b; }
.att-bar [data-bar="leave"] { background: var(--brand-blue); }
.att-bar [data-bar="absent"] { background: var(--danger); }
.att-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.att-key { display: inline-flex; align-items: center; gap: 6px; }
.att-key i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.att-key b { color: var(--text); font-weight: 700; }
.att-key.present i { background: var(--success); }
.att-key.late i { background: #f59e0b; }
.att-key.leave i { background: var(--brand-blue); }
.att-key.absent i { background: var(--danger); }

.att-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.att-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; transition: background var(--trans); }
.att-row:last-of-type { border-bottom: 0; }
.att-row:hover { background: var(--surface-2); }
.att-row[data-status="absent"] { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }
.att-row[data-status="late"] { border-left-color: #f59e0b; }
.att-row[data-status="leave"] { border-left-color: var(--brand-blue); }
.att-row__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-row__who b { font-size: 13.5px; font-weight: 600; }
.att-row__who small { font-size: 12px; }
.att-row .att-group label { height: 34px; min-width: 40px; }
.att-short { display: none; }
.att-empty { padding: 18px; text-align: center; font-size: 13px; }
@media (max-width: 640px) {
  .att-long { display: none; }
  .att-short { display: inline; }
  .att-row { flex-wrap: wrap; padding: 10px 12px; }
  .att-row .att-group { width: 100%; }
  .att-row .att-group label { flex: 1; height: 38px; }
  .att-search { max-width: none; }
}
.fsec.is-stacked { grid-template-columns: 1fr; gap: 14px; }
.fsec.is-stacked .fsec__head { align-items: center; }
.fsec.is-stacked .fsec__head h2 { margin: 0 0 2px; }
.form-layout.att-layout { max-width: none; }
@media (min-width: 1201px) { .form-layout.att-layout { grid-template-columns: minmax(0, 1fr) 340px; } }

/* Kanban card edit button */
.kanban-card .kanban-edit { width: 26px; height: 26px; margin: -3px -4px 0 0; opacity: .55; }
.kanban-card:hover .kanban-edit, .kanban-edit:focus-visible { opacity: 1; }

/* Expenses: approve / reject actions */
.exp-approve { background: var(--success-soft); color: var(--success); border-color: transparent; }
.exp-approve:hover { background: var(--success); color: #fff; }
.exp-reject { background: transparent; color: var(--text-3); border-color: var(--border); }
.exp-reject:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.exp-note { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
@media (max-width: 992px) { .exp-side { flex: none !important; } }

/* Payments */
.seg-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.pay-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pay-summary b { font-size: 22px; font-family: var(--font-display); white-space: nowrap; }

/* Students: filter bar */
.filter-bar .filter-select .form-select { width: auto; min-width: 150px; max-width: 210px; }
.filter-select.is-set .form-select { border-color: var(--brand-blue); background-color: var(--brand-blue-soft); color: var(--brand-blue-700); font-weight: 600; }
.filter-select.is-set i { color: var(--brand-blue); }
@media (max-width: 768px) { .filter-bar .filter-select, .filter-bar .filter-select .form-select { flex: 1 1 45%; max-width: none; } }

/* Membership modal: plan cards */
.plan-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.plan-choice input { position: absolute; opacity: 0; pointer-events: none; }
.plan-choice label { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: var(--trans); margin: 0; position: relative; }
.plan-choice label:hover { border-color: var(--border-strong); }
.plan-choice input:checked + label { border-color: var(--brand-blue); background: var(--brand-blue-soft); box-shadow: 0 0 0 1px var(--brand-blue); }
.plan-choice input:checked + label::after { content: "\F26A"; font-family: bootstrap-icons; position: absolute; top: 10px; right: 12px; color: var(--brand-blue); }
.plan-choice input:focus-visible + label { box-shadow: var(--ring); }
.plan-choice__name { font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; padding-right: 18px; }
.plan-choice__price { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.plan-choice__meta { font-size: 12px; color: var(--text-3); }
.mem-until { min-height: 40px; display: flex; flex-direction: column; justify-content: center; }
.mem-until b { font-size: 15px; }
.mem-until small { font-size: 12px; color: var(--text-3); }

/* Batches: weekly timetable */
.tt-col { border-radius: 12px; padding: 8px; }
.tt-col.is-today { background: var(--brand-blue-soft); }
.tt-day { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; margin-bottom: 8px; padding: 0 2px; }
.tt-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; margin-bottom: 8px; font-size: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand-blue); color: inherit; text-decoration: none; transition: var(--trans); }
a.tt-item[href]:hover { border-color: var(--brand-blue); box-shadow: var(--shadow-sm); color: inherit; transform: translateY(-1px); }
.tt-item.is-inactive { opacity: .55; border-left-color: var(--gray-400); }
.tt-item span { line-height: 1.35; }

/* Staff: contact line */
.contact-line { display: inline-flex; align-items: center; gap: 6px; }
.contact-wa { color: #25d366; font-size: 14px; line-height: 1; }
.contact-wa:hover { color: #128c4a; }

/* Branches */
.branch-card.is-inactive { opacity: .65; }
.branch-stat { padding: 8px; display: block; }
a.branch-stat:hover { background: var(--brand-blue-soft); color: var(--brand-blue-700); }
.branch-meta { font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.branch-meta i { color: var(--text-3); width: 16px; display: inline-block; }

/* Memberships: plan features */
.plan-feats { list-style: none; padding: 0; margin: 14px 0; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.plan-feats i { color: var(--success); margin-right: 4px; }
.plan-feats .is-off { color: var(--text-3); }
.plan-feats .is-off i { color: var(--text-3); }

/* Dashboard */
.head-ico { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--brand-blue-soft); color: var(--brand-blue); font-size: 16px; }
a.stat--link { color: inherit; text-decoration: none; transition: var(--trans); display: block; }
a.stat--link:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
a.stat--link:focus-visible { box-shadow: var(--ring); }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.qa-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; transition: var(--trans); background: var(--surface); }
.qa-tile:hover { border-color: var(--brand-blue); background: var(--brand-blue-soft); color: inherit; transform: translateY(-1px); }
.qa-tile .stat__ico { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; flex-shrink: 0; }
.qa-tile b { display: block; font-size: 13.5px; font-weight: 600; }
.qa-tile small { display: block; font-size: 12px; color: var(--text-3); }
@media (max-width: 576px) { .qa-grid { grid-template-columns: 1fr 1fr; } .qa-tile small { display: none; } .qa-tile { padding: 10px; gap: 10px; } }
.up-class { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-bottom: 1px solid var(--border); border-radius: 10px; transition: background var(--trans); }
.up-class:last-child { border-bottom: 0; }
.up-class:hover { background: var(--surface-2); }
.up-class__go { color: var(--text-3); transition: var(--trans); }
.up-class:hover .up-class__go { color: var(--brand-blue); transform: translateX(2px); }

/* Auth pages */
.auth-side h2 { color: #fff; }
.auth-form .card-body > h1 { font-size: 24px; }
.auth-form .form-actions__note { font-size: 12px; }

/* Report filters */
.report-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.report-filters .form-select, .report-filters .form-control { min-width: 170px; }

/* ============================================================
   Mobile polish (shared)
   ============================================================ */
.pager { display: flex; align-items: center; gap: 10px; }
.pager__info { display: none; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.table-card > .d-flex { flex-wrap: wrap; gap: 8px; }
.tabbar > .btn, .tabbar > a { flex-shrink: 0; white-space: nowrap; }
.tabbar { scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
@media (max-width: 576px) {
  .pager { width: 100%; justify-content: space-between; }
  .pager__info { display: inline; }
  .pagination .page-num:not(.active) { display: none; }
  .pagination .page-link { min-width: 38px; min-height: 38px; display: grid; place-items: center; }
}

/* ---------- Compact table cards on phones (all .responsive-cards tables) ---------- */
@media (max-width: 1199px) {
  table.dtable.responsive-cards tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; padding: 12px 14px 8px; position: relative; }
  table.dtable.responsive-cards td {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 3px;
    padding: 6px 0; border: 0; text-align: left; min-width: 0; font-size: 13px; overflow-wrap: anywhere;
  }
  table.dtable.responsive-cards td::before { font-size: 10.5px; color: var(--text-3); letter-spacing: .05em; }
  /* First cell = card header */
  table.dtable.responsive-cards td:first-child { grid-column: 1 / -1; padding: 0 40px 10px 0; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  table.dtable.responsive-cards td:first-child::before { display: none; }
  /* Action cell: a lone menu sits top-right; several buttons get a footer row */
  table.dtable.responsive-cards td.no-label:last-child { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding: 8px 0 2px; margin-top: 4px; border-top: 1px dashed var(--border); }
  table.dtable.responsive-cards td.no-label:last-child:has(> .dropdown:only-child) { position: absolute; top: 8px; right: 8px; width: auto; padding: 0; margin: 0; border: 0; }
  table.dtable.responsive-cards td.no-label:last-child:empty { display: none; }
  table.dtable.responsive-cards td.no-label:last-child > .d-flex { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  /* Full-width rows: empty states, "no match" rows */
  table.dtable.responsive-cards tr:has(> td[colspan]) { display: block; padding: 0; }
  table.dtable.responsive-cards td[colspan] { padding: 0; border: 0; margin: 0; }
  table.dtable.responsive-cards td > div[style*="min-width"] { min-width: 0 !important; width: 100%; }
  table.dtable.responsive-cards .pbar { width: 100%; }
  /* Totals row = summary card */
  table.dtable.responsive-cards tfoot tr { background: var(--surface-2); border-top: 1px solid var(--border); }
  table.dtable.responsive-cards tfoot td { background: none; border: 0; padding: 6px 0; white-space: normal; }
  table.dtable.responsive-cards tfoot td:first-child { display: block; font-size: 14px; padding: 0 0 10px; border-bottom: 1px solid var(--border); }
  table.dtable.responsive-cards tfoot td:empty { display: none; }
  table.dtable.responsive-cards tfoot td.text-end { text-align: left !important; }
}

/* ---------- Phone layout fixes ---------- */
@media (max-width: 768px) {
  /* Summary stat cards: 2 per row, compact */
  .grid-4:has(> .stat), .grid-4:has(> a.stat) { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-4 > .stat { padding: 12px 14px; }
  .grid-4 > .stat .stat__value { font-size: 20px; }
  .grid-4 > .stat .stat__label { font-size: 11.5px; }
  .grid-4 > .stat .stat__ico { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
  .grid-4 > .stat .stat__foot { font-size: 11px; }
  /* Filter bars: search on its own full-width row, selects share the next rows */
  .toolbar { gap: 8px; }
  .toolbar .search-inline, .filter-bar .search-inline { flex: 1 1 100%; }
  .toolbar .search-inline input { min-width: 0 !important; width: 100%; }
  .filter-bar .filter-select, .toolbar > form:has(.filter-select) { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .filter-bar .filter-select .form-select, .toolbar .filter-select .form-select { width: 100% !important; min-width: 0 !important; max-width: none; }
  .toolbar .segment { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar .segment .btn, .toolbar .segment button { white-space: nowrap; flex-shrink: 0; }
  .toolbar > .ms-auto { margin-left: 0 !important; }
  /* Kanban: keep phone numbers on one line */
  .kanban-card .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Page-head icon-only buttons shouldn't stretch */
  .page-head__actions .btn:has(> .hide-sm:only-of-type) { flex: 0 0 auto; }
}
@media (max-width: 1199px) { table.dtable.responsive-cards td > br { display: none; } }
@media (max-width: 1199px) {
  /* Report filters: two per row, full-width controls */
  .report-filters { gap: 10px; }
  .report-filters > div { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .report-filters .form-select, .report-filters .form-control { min-width: 0; width: 100%; }
  .report-filters > .ms-auto { display: none; }
  /* Permission matrix: pin the module column and hint at sideways scrolling */
  .perm-table th:first-child, .perm-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); min-width: 120px; }
  .perm-table thead th:first-child { background: var(--surface-2); }
  .perm-scroll-hint { display: flex !important; }
  /* Settings section tabs: no visible scrollbar */
  .set-nav { scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
}
.perm-scroll-hint { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); padding: 8px 18px 0; }
@media (max-width: 1199px) {
  /* Weekly timetable: stack days vertically instead of a 7-column sideways scroll */
  .tt-grid { grid-template-columns: 1fr !important; min-width: 0 !important; gap: 4px !important; }
  .tt-col { padding: 10px; }
  .tt-col:has(> .tt-day + .muted) { display: none; }  /* days with no classes */
  .tt-col { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-items: start; }
  .tt-col > .tt-day { grid-column: 1 / -1; margin-bottom: 0; }
  .tt-col > .tt-item { margin-bottom: 0; }
}

/* ---------- Tablet: table cards in two columns ---------- */
@media (min-width: 577px) and (max-width: 1199px) {
  table.dtable.responsive-cards tbody { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  table.dtable.responsive-cards tr { margin-bottom: 0; align-content: start; }
  table.dtable.responsive-cards tr:has(> td[colspan]) { grid-column: 1 / -1; }
}


/* ============================================================
   Tablet (769–1199px): portrait tablets with the sidebar hidden,
   landscape tablets / small laptops with it showing (~700px content)
   ============================================================ */
@media (min-width: 769px) and (max-width: 1199px) {
  /* Base card rules that responsive.css only applies on phones */
  table.dtable.responsive-cards thead { display: none; }
  table.dtable.responsive-cards, table.dtable.responsive-cards tbody { display: block; width: 100%; }
  table.dtable.responsive-cards tbody { display: grid; }
  table.dtable.responsive-cards tr { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  table.dtable.responsive-cards td::before { content: attr(data-label); font-weight: 600; text-transform: uppercase; text-align: left; }
  table.dtable.responsive-cards td.no-label::before { content: ''; }
  table.dtable.responsive-cards tbody tr:hover { background: var(--surface); }
  .table-card:has(table.responsive-cards) .table-wrap { padding: 14px; }
}
@media (max-width: 1199px) {
  /* Side-by-side sections stack: ~700px is too narrow for two columns of cards/tables */
  .row-g { flex-direction: column; }
  .row-g > * { width: 100%; flex: none !important; }
  .row-g > .exp-side { flex: none !important; }
  /* Settings: section menu becomes a horizontal tab strip above the content */
  .settings-wrap { flex-direction: column; }
  .settings-side { flex: none; position: static; width: 100%; }
  .set-nav { flex-direction: row; overflow-x: auto; }
  .set-nav a, .set-nav span { white-space: nowrap; }
  .set-nav__label, .set-nav span.disabled { display: none; }
}
