/* Management area + auth pages. Builds on site.css tokens. */
.auth-body { background: var(--bg-alt); min-height: 100vh; }
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-brand { font-size: 1.7rem; }
.auth-card { width: 100%; padding: 28px; box-shadow: var(--shadow); }
.auth-title { font-size: 1.6rem; margin-bottom: .2em; }
.auth-back { color: var(--muted); text-decoration: none; font-size: .9rem; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 18px; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 10px; border: 1px solid #d3d6dc; border-radius: 10px; margin-bottom: 8px; }
.day-picker .check { font-size: .88rem; }
.day-picker .check input { width: 15px; height: 15px; }

.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.alert-warn { background: #fff6e0; color: #7a5200; border: 1px solid #f3d99a; }

/* Shell */
.app-body { background: var(--bg-alt); }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #14161a; color: #fff; padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { font-size: 1.35rem; padding: 0 8px 22px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { color: rgba(255, 255, 255, .78); text-decoration: none; padding: .65em .9em; border-radius: 10px; font-weight: 500; }
.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.active { background: var(--brand); color: #fff; }
.side-label { margin: 18px 10px 6px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .45); font-weight: 700; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-top { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.app-title { font-size: 1.25rem; margin: 0; flex: 1; }
.app-user { display: flex; align-items: center; gap: 14px; }
.app-user .who { text-align: right; line-height: 1.25; }
.app-user .who small { color: var(--muted); display: block; }
.app-content { padding: 24px; max-width: 1200px; width: 100%; }
.app-body .burger { display: none; }

/* Cards, tables, forms */
.welcome { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--brand-tint), #fff 65%); }
.welcome-avatar { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 1.1rem; }
.welcome h2 { margin: 0 0 .2em; }

/* Reusable icon + heading pattern for card sections */
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head-icon { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-dark); }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .74rem; font-weight: 800; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 16px 0; }
.stat-card strong { display: block; font-size: 1.7rem; color: var(--brand-dark); line-height: 1.15; overflow-wrap: anywhere; }
.stat-card span { color: var(--muted); font-size: .9rem; }
.card + .card, .stat-grid + .card { margin-top: 16px; }
.stat-grid .card + .card { margin-top: 0; }
/* Dashboard-only stat-card treatment: icon chip + hover lift (other pages keep the plain stacked style) */
.dashboard-stats .stat-card { display: flex; align-items: center; gap: 14px; transition: transform .15s, box-shadow .15s; }
.dashboard-stats .stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(20, 22, 26, .12); }
.dashboard-stats .stat-card strong { color: var(--ink); }
.stat-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.stat-brand .stat-icon { background: var(--brand-tint); color: var(--brand-dark); }
.stat-blue .stat-icon { background: #e5eefc; color: #2a5cc9; }
.stat-green .stat-icon { background: #e2f6ea; color: #14683a; }
.stat-purple .stat-icon { background: #efe6fb; color: #6b3fa0; }

.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; transition: background .15s; }
.activity li:hover { background: var(--bg-alt); }
.activity li:last-child { border-bottom: 0; }
.activity-body { flex: 1 1 220px; }
.activity-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.activity-dot-lesson { background: var(--brand); }
.activity-dot-payment, .activity-dot-salary { background: #14683a; }
.activity-dot-user, .activity-dot-class { background: #2a5cc9; }

.earn-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: #14683a; box-shadow: 0 4px 10px rgba(20, 104, 58, .18); }
.earn-body { flex: 1; }

.lesson-row { border-radius: 10px; padding: 10px 8px; margin: 0 -8px; transition: background .15s; }
.lesson-row:hover { background: var(--bg-alt); }
.lesson-row > strong { border-left: 3px solid var(--brand); padding-left: 10px; }
.lesson-row.is-done > strong { border-left-color: #14683a; }
.lesson-row.is-cancelled > strong { border-left-color: var(--muted); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select, .inline-form select {
    padding: .55em .8em; border: 1px solid #d3d6dc; border-radius: 10px; font: inherit; background: #fff; min-width: 0;
}
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .center, .center { text-align: center; }
.table .actions { text-align: right; white-space: nowrap; }
code { background: #f1f2f5; padding: .1em .4em; border-radius: 6px; font-size: .85em; }
pre { background: #f6f7f9; padding: 10px; border-radius: 8px; overflow-x: auto; font-size: .78rem; max-width: 560px; }
details summary { cursor: pointer; color: var(--brand-dark); font-size: .85rem; }
.badge { display: inline-block; padding: .2em .7em; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eceef2; color: var(--ink-soft); }
.badge-active { background: #e2f6ea; color: #14683a; }
.badge-inactive { background: #eceef2; color: #4a4f57; }
.badge-suspended { background: #fde6e4; color: #a3271d; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }
.pager .disabled { opacity: .45; pointer-events: none; }

.form-narrow { max-width: 460px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.side-cards { display: grid; gap: 16px; }
.side-cards .card + .card { margin-top: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.perm-extra { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 6px 0 16px; }
.perm-extra legend { font-weight: 700; padding: 0 6px; }
.perm-group { margin: 10px 0; }
.perm-group .check { margin: 4px 0; }
.btn-danger { background: #c0271d; color: #fff; }
.btn-danger:hover { background: #a3211a; }
.danger-zone { border-color: #f3c6c2; }
.inline-form { margin: 0; display: inline; }
.linkbtn { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lang-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 2px; margin-bottom: 12px; }
.cover-thumb { width: 120px; height: 75px; object-fit: cover; border-radius: 10px; }
.class-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.two-col.wide-left { grid-template-columns: minmax(0, 1fr) 340px; }
.two-col.wide-left > div > .card + .card { margin-top: 16px; }
.table.compact th, .table.compact td { padding: 8px 12px; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member-list li form { margin-left: auto; }
.member-list li.dropped { opacity: .5; }
.student-search { position: relative; }
.student-search-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin-top: 4px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgba(20, 22, 26, .16);
    max-height: 260px; overflow-y: auto;
}
.student-search-item { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; cursor: pointer; font: inherit; border-bottom: 1px solid var(--line); }
.student-search-item:last-child { border-bottom: 0; }
.student-search-item:hover, .student-search-item:focus { background: var(--brand-tint); }
.student-search-item strong { display: block; font-size: .92rem; }
.student-search-item small { color: var(--muted); font-size: .78rem; }
.student-search-empty { padding: 10px 12px; color: var(--muted); font-size: .88rem; }
.conflict-box ul { margin: 8px 0; padding-left: 20px; }
.conflict-box .check { margin: 10px 0 0; }
/* Weekly calendar grid (Google Calendar-style), replaces the old day-list on /admin/schedule */
.cal { padding: 0; overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 64px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-day-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; text-align: center; border-left: 1px solid var(--line); }
.cal-day-name { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cal-day-num { font-weight: 700; font-size: 1.05rem; }
.cal-day-head.is-today .cal-day-num { color: #fff; background: var(--brand); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; margin: 0 auto; }
.cal-body { position: relative; display: grid; grid-template-columns: 64px repeat(7, 1fr); overflow-y: auto; }
.cal-gutter { position: relative; }
.cal-hour { box-sizing: border-box; padding: 4px 8px 0 0; text-align: right; font-size: .7rem; color: var(--muted); border-top: 1px solid var(--line); transform: translateY(-.6em); }
.cal-hour:first-child { border-top: 0; }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col.is-today { background: var(--brand-tint); }
.cal-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.cal-lesson {
    position: absolute; left: 3px; right: 3px; overflow: hidden; text-align: left;
    display: flex; flex-direction: column; gap: 1px; padding: 4px 7px; border-radius: 8px;
    background: var(--brand-tint); border: 1px solid #ffd9bd; color: var(--brand-dark);
    font: inherit; cursor: default; z-index: 1;
}
.cal-lesson strong { font-size: .74rem; }
.cal-lesson span { font-size: .78rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-lesson small { font-size: .68rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-lesson .badge { align-self: flex-start; font-size: .62rem; padding: .1em .5em; }
.cal-lesson.is-done { background: #e2f6ea; border-color: #b7e4c7; }
.cal-lesson.is-cancelled { background: #f1f2f5; border-color: var(--line); opacity: .6; text-decoration: line-through; }
.cal-lesson.is-pending { background: repeating-linear-gradient(135deg, #fff6e0, #fff6e0 8px, #fff1cc 8px, #fff1cc 16px); border: 1px dashed #e6b800; color: #7a5200; opacity: .85; }
.cal-lesson.is-clickable { cursor: pointer; }
.cal-lesson.is-clickable:hover { box-shadow: 0 4px 12px rgba(20, 22, 26, .18); border-color: var(--brand); }
@media (max-width: 900px) {
    .cal { overflow-x: auto; }
    .cal-head, .cal-body { min-width: 760px; }
}

.lesson-modal { border: 0; border-radius: 16px; padding: 0; max-width: 640px; width: calc(100% - 32px); box-shadow: 0 24px 60px rgba(20, 22, 26, .35); }
.lesson-modal::backdrop { background: rgba(20, 22, 26, .55); }
.lesson-modal-inner { position: relative; max-height: 85vh; overflow-y: auto; padding: 20px; }
.lesson-modal-close { position: sticky; top: 0; float: right; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; z-index: 2; }
.lesson-modal-close:hover { border-color: var(--ink); }

.week { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.day { padding: 16px; }
.day h3 { font-size: 1rem; margin-bottom: .6em; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); }
.lesson-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); font-size: .9rem; flex-wrap: wrap; }
.lesson-item > strong { min-width: 96px; color: var(--brand-dark); }
.lesson-item.is-cancelled { opacity: .55; text-decoration: line-through; }
.lesson-item.is-done > strong { color: #14683a; }
.day-title { margin: 14px 0 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; background: #fff; }
.bell:hover { border-color: var(--ink); }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.notif { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: start; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.notif:last-child { border-bottom: 0; }
.notif .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: transparent; }
.notif.unread .dot { background: var(--brand); }
.notif.unread strong { color: var(--ink); }
.notif:hover { background: #fafbfc; }
.attention { border-color: #f3d99a; background: #fffdf6; }
.attention + .card, .card + .attention { margin-top: 16px; }
.att-list { display: grid; gap: 10px; }
.att-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) auto minmax(140px, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.att-note { width: 100%; padding: .55em .8em; border: 1px solid #d3d6dc; border-radius: 10px; font: inherit; }
.seg { display: inline-flex; border: 1px solid #d3d6dc; border-radius: 999px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .45em .9em; font-size: .85rem; font-weight: 600; color: var(--muted); border-right: 1px solid #e6e8ec; }
.seg label:last-child span { border-right: 0; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.seg-present input:checked + span { background: #e2f6ea; color: #14683a; }
.seg-late input:checked + span { background: #fff1d6; color: #8a5a00; }
.seg-absent input:checked + span { background: #fde6e4; color: #a3271d; }
.seg-excused input:checked + span { background: #e8eaf0; color: #3b4252; }
.mark-all { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.complete-form .card + .card { margin-top: 16px; }
.complete-form .form-actions { margin-top: 16px; }
.sub-card { margin-top: 16px; }
.sub-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.answer-box { background: #f6f7f9; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; overflow-wrap: anywhere; }
.feedback-card { border-color: #b7e4c7; background: #f4fbf7; margin-top: 16px; }
.two-col > div > .card + .card { margin-top: 16px; }
tr.dropped td { opacity: .55; }
.sum-list { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 14px 0 0; }
.sum-list dt { color: var(--ink-soft); }
.sum-list dd { margin: 0; text-align: right; }
.earn-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; border-color: #b7e4c7; background: #f4fbf7; }
.earn-amount { display: block; font-size: 1.9rem; line-height: 1.15; color: #14683a; }
.trend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 170px; margin-bottom: 8px; }
.trend-col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 6px; }
.trend-col .bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; width: 100%; justify-content: center; }
.bar { display: block; width: 40%; max-width: 26px; border-radius: 6px 6px 0 0; }
.bar-rev, .dot-rev { background: #2f9e62; }
.bar-exp, .dot-exp { background: var(--brand); }
.dot-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.table tfoot td { background: #fafbfc; border-top: 1px solid var(--line); }
.side-badge { float: right; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; text-align: center; }
.convo { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.convo:last-child { border-bottom: 0; }
.convo:hover { background: #fafbfc; }
.convo.unread strong { color: var(--ink); }
.convo.unread .convo-main small { color: var(--ink); font-weight: 600; }
.convo-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.convo-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.recipient { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.chat { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.chat-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; height: min(60vh, 560px); max-height: 60vh; overflow-y: auto; background: #f6f7f9; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: min(78%, 520px); background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; overflow-wrap: anywhere; }
.bubble-row.mine .bubble { background: var(--brand-tint); border-color: #ffd9bd; border-radius: 16px 16px 4px 16px; }
.bubble-name { display: block; font-size: .78rem; color: var(--brand-dark); }
.bubble-time { display: block; text-align: right; color: var(--muted); font-size: .7rem; margin-top: 2px; }
.bubble-file { display: inline-block; margin-top: 4px; font-weight: 600; text-decoration: none; color: var(--brand-dark); }
.chat-form { padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; padding: .6em .9em; border: 1px solid #d3d6dc; border-radius: 14px; font: inherit; max-height: 140px; }
.attach { cursor: pointer; font-size: 1.3rem; padding: .3em .4em; }
.chat-note { padding: 12px 16px; margin: 0; border-top: 1px solid var(--line); }
.week-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.avatar-initials { display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-dark); font-weight: 800; font-size: .95rem; }
.person { display: flex; align-items: center; gap: 12px; }
.photo-field { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.photo-field .avatar { width: 72px; height: 72px; font-size: 1.4rem; }
.photo-field .field { flex: 1; margin-bottom: 0; }
.form-section { margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 1.05rem; }
.form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.field textarea { resize: vertical; }

/* Permission matrix */
.matrix th, .matrix td { padding: 10px 12px; }
.matrix .group-row td { background: var(--brand-tint); font-weight: 700; color: var(--brand-dark); padding: 8px 16px; }
.matrix input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.matrix-wrap { max-height: 70vh; }
.matrix thead th { position: sticky; top: 0; z-index: 1; }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
    .app-body .burger { display: flex; }
    .app-top { padding: 12px 16px; }
    .app-user .who { display: none; }
    .app-content { padding: 16px; }
    .two-col { grid-template-columns: 1fr; }
    .row-2, .row-3 { grid-template-columns: 1fr; }
    .att-row { grid-template-columns: 1fr; gap: 8px; }
    .seg { width: 100%; } .seg label { flex: 1; text-align: center; }
    .two-col.wide-left { grid-template-columns: 1fr; }
    /* Card-style rows on phones */
    .table:not(.matrix) thead { display: none; }
    .table:not(.matrix), .table:not(.matrix) tbody, .table:not(.matrix) tr, .table:not(.matrix) td { display: block; width: 100%; }
    .table:not(.matrix) tr { padding: 10px 4px; border-bottom: 1px solid var(--line); }
    .table:not(.matrix) td { border: 0; padding: 4px 16px; }
    .table:not(.matrix) td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .78rem; font-weight: 600; }
    .table .actions { text-align: left; }
}
