/* IDL Learn – components: buttons, forms, pills, panels, tabs, tables, dialogs, toasts. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; font-size: 15.5px; cursor: pointer; text-decoration: none !important; transition: background-color .15s ease, transform .15s ease; }
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.is-busy { opacity: .7; }
.btn--ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn--danger { background: #fff; color: var(--no); box-shadow: inset 0 0 0 1.5px #F3C3C3; }
.btn--danger:hover { background: var(--no-soft); }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn--block { width: 100%; }
.link { padding: 0; border: 0; background: none; color: var(--brand); font-weight: 800; cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 16px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 800; color: var(--ink); font-size: 14.5px; }
.field small { font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .search { width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(22, 62, 196, .14); }
.password-control { position: relative; display: block; width: 100%; }
.password-control input { padding-right: 76px !important; }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 36px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--brand); cursor: pointer; }
.password-toggle svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-control--field { margin-bottom: 14px; }
.password-control--field > .field { margin-bottom: 0; }
.password-control--field > .password-toggle { top: auto; bottom: 7px; transform: none; }
.password-toggle:hover { background: var(--surface, #F8FAFC); }
.password-toggle:focus-visible { outline: 3px solid rgba(22, 62, 196, .25); outline-offset: 2px; }
.field--sm { max-width: 120px; }
.search { max-width: 240px; min-height: 38px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-form .field { margin: 0; flex: 1 1 180px; }
.inline-form .field--sm { flex: 0 0 110px; }
.inline-form .btn { margin-bottom: 1px; }
.form-error { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--no-soft); color: var(--no); font-weight: 700; }

.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 3px 10px; border-radius: 999px; font-weight: 900; font-size: 14px; color: #fff; background: #94A3B8; }
.pill--sm { min-width: 36px; padding: 2px 8px; font-size: 12.5px; }
.pill--learning { background: #2563EB; }
.pill--good { background: #059669; }
.pill--challenge { background: #0E2CA0; }
.pill--mastered { background: var(--accent); }
.pill--new { background: #E2E8F0; color: var(--muted); }
.badge { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: #FFF4DE; color: #9A5B00; font-weight: 800; font-size: 13px; }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--c, var(--brand)) 14%, #fff); color: var(--c, var(--brand)); font-weight: 900; font-size: 12px; }
.key { display: inline-block; width: 12px; height: 12px; margin: 0 4px 0 10px; border-radius: 3px; vertical-align: middle; }

.panel { margin-bottom: 22px; padding: 24px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.panel--soft { background: var(--brand-soft); box-shadow: none; }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel__head h2, .panel__head h3 { margin: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head > div { max-width: 760px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 14px; font-weight: 700; color: var(--muted); }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; box-shadow: inset 0 -2px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 16px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 800; white-space: nowrap; text-decoration: none !important; }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--brand); border-bottom-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { padding: 7px 14px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); font-weight: 800; font-size: 14.5px; text-decoration: none !important; }
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.chip.is-on { background: var(--brand); color: #fff; box-shadow: none; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { padding: 10px 12px; border-bottom: 2px solid var(--line); text-align: left; font-size: 13px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.is-off td { opacity: .5; }
.table--log td { font-size: 14px; }
.table--log tr.is-ok td:nth-child(4) { color: var(--ok); font-weight: 800; }
.table--log tr.is-no td:nth-child(4) { color: var(--no); font-weight: 800; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpis > div, .award-stats > div { padding: 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.kpis b, .award-stats b { display: block; font-size: 26px; font-weight: 900; color: var(--ink); line-height: 1.1; }
.kpis span, .award-stats span { font-size: 13.5px; color: var(--muted); font-weight: 700; }

.empty { padding: 40px 24px; text-align: center; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.empty p { max-width: 520px; margin: 0 auto 16px; color: var(--muted); }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--muted); font-weight: 700; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; background: rgba(23, 32, 54, .45); overflow-y: auto; }
.modal__box { width: 100%; max-width: 520px; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .4); animation: pop .2s ease; }
.modal__box--wide { max-width: 860px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: 19px; }
.modal__body { padding: 22px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: var(--shadow); animation: pop .2s ease; transition: opacity .4s ease, transform .4s ease; }
.toast--ok { background: var(--ok); }
.toast--error { background: var(--no); }
.toast--award { background: linear-gradient(135deg, #FFBC00, #E8590C); }
.toast.is-out { opacity: 0; transform: translateY(8px); }

.bullets { margin: 0; padding-left: 20px; }
.bullets li { margin-bottom: 6px; }
.link-list { margin: 0; padding: 0; list-style: none; columns: 2 240px; }
.link-list li { padding: 6px 0; break-inside: avoid; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 22px; }
.facts div { padding: 14px 16px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.facts dt { font-size: 13px; color: var(--muted); font-weight: 800; }
.facts dd { margin: 0; font-weight: 900; color: var(--ink); text-transform: capitalize; }
