/* Cards, lists, buttons, fields, toggles, tabs, pills, notes, toasts, drawers and dialogs. */

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-dark { background: var(--txm-dark-green); border-color: var(--txm-dark-green); color: #fff; position: relative; overflow: hidden; }
.card-dark .label, .card-dark .muted { color: #C9D6D0; }
.card-dark .eyebrow { color: var(--green-50); }
.card-quiet { background: var(--blue-8); border-color: var(--blue-15); box-shadow: none; }
.card-link { text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); color: inherit; }

.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; padding-top: 0; }
.li:last-child { padding-bottom: 0; }
.li-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li > .actions { flex: none; flex-wrap: nowrap; }
.hero-date { font-size: 54px; }
.li-main strong { font-size: 16px; }
.li-main span { font-size: 14px; color: var(--ink-2); }
.icon-tile { width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; background: var(--blue-15); color: var(--blue-ink); flex: none; }
.icon-tile.ok { background: var(--green-12); color: var(--green-ink); }
.icon-tile.attn { background: var(--attn-bg); color: var(--attn-ink); }
.icon-tile.crit { background: var(--crit-bg); color: var(--crit-ink); }
.date-tile { width: 52px; flex: none; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: center; padding: 6px 0; line-height: 1.1; }
.date-tile b { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.date-tile span { display: block; font-size: 22px; font-weight: 700; }
.date-tile.is-mine { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; }
.date-tile.is-mine b { color: var(--blue-25); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent; font-weight: 700; font-size: 16px; letter-spacing: .01em; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .12s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--blue-ink); color: #fff; box-shadow: 0 1px 0 rgba(31, 46, 40, .12); }
.btn-primary:hover { background: var(--blue-deep); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--blue-8); border-color: var(--blue-50); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--blue-ink); padding: 0 10px; }
.btn-ghost:hover { background: var(--blue-8); color: var(--blue-deep); }
.btn-light { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.btn-white { background: #fff; color: var(--txm-dark-green); }
.btn-white:hover { background: var(--blue-15); color: var(--txm-dark-green); }
.btn-ok { background: var(--green-deep); color: #fff; }
.btn-ok:hover { background: var(--txm-dark-green); color: #fff; }
.btn-danger { background: var(--surface); border-color: #E7B9B0; color: var(--crit-ink); }
.btn-danger:hover { background: var(--crit-bg); color: var(--crit-ink); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 15px; border-radius: 10px; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.hint { font-size: 14px; color: var(--ink-2); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field textarea { padding: 10px 12px; min-height: 88px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--txm-blue); box-shadow: 0 0 0 3px var(--blue-25); }
.field input[disabled], .field select[disabled] { background: var(--sunken); color: var(--ink-3); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue-ink); }

/* Segmented control and switch */
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--radius); background: var(--sunken); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 15px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, color .15s, box-shadow .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.switch { position: relative; width: 46px; height: 28px; border-radius: 14px; border: 0; background: var(--line-strong); cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--green-ink); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px 11px; font-weight: 700; font-size: 16px; color: var(--ink-2); text-decoration: none; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs a[aria-current="page"], .tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--txm-blue); }
.tab-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 13px; background: var(--sunken); color: var(--ink-2); }
.tab-count.attn { background: var(--attn-bg); color: var(--attn-ink); }

/* Pills and avatars */
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: var(--sunken); color: var(--ink-2); }
.pill-ok { background: var(--green-12); color: var(--green-ink); }
.pill-attn { background: var(--attn-bg); color: var(--attn-ink); }
.pill-crit { background: var(--crit-bg); color: var(--crit-ink); }
.pill-info { background: var(--blue-15); color: var(--blue-deep); }
.pill-dark { background: rgba(255, 255, 255, .14); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.av { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 14px; font-weight: 700; letter-spacing: .02em; color: #fff; background: var(--txm-medium-gray); }
.av-sm { width: 26px; height: 26px; font-size: 12px; }
.av-lg { width: 52px; height: 52px; font-size: 19px; }
.c1 { background: var(--blue-ink); } .c2 { background: var(--green-deep); } .c3 { background: var(--txm-dark-gray); }
.c4 { background: var(--txm-medium-gray); } .c5 { background: var(--blue-deep); } .c6 { background: #3F6F7E; }
.c7 { background: var(--txm-dark-green); }

/* Notes, banners and toasts */
.note { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--blue-25); background: var(--blue-8); color: var(--ink); font-size: 15px; }
.note .i { color: var(--blue-ink); margin-top: 1px; }
.note-attn { border-color: #F0D3A0; background: var(--attn-bg); }
.note-attn .i { color: var(--attn-ink); }
.note-crit { border-color: #EFC3BA; background: var(--crit-bg); }
.note-crit .i { color: var(--crit-ink); }
.note-ok { border-color: var(--green-50); background: var(--green-12); }
.note-ok .i { color: var(--green-ink); }
.note-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100% - 32px)); padding: 14px 18px; border-radius: var(--radius-l); background: var(--txm-dark-green); color: #fff; box-shadow: var(--shadow-2); animation: toast-in .45s var(--ease); }
.toast strong { display: block; }
.toast span { display: block; font-size: 14px; color: #C9D6D0; }
.toast .icon-tile { background: var(--green-deep); color: #fff; }

/* Drawers and dialogs */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(31, 46, 40, .32); display: flex; justify-content: flex-end; animation: fade-in .2s; }
.drawer { width: min(480px, 100%); height: 100%; overflow-y: auto; background: var(--surface); box-shadow: var(--shadow-2); padding: 26px; display: flex; flex-direction: column; gap: 20px; animation: slide-in .35s var(--ease); }
.dialog-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(31, 46, 40, .32); display: grid; place-items: center; padding: 20px; animation: fade-in .2s; }
.dialog { width: min(640px, 100%); max-height: calc(100% - 40px); overflow-y: auto; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-2); padding: 28px; display: flex; flex-direction: column; gap: 18px; animation: rise .35s var(--ease); }
