/* ============================================================
   TEACHER SETTINGS V2 — visual shell only.
   Phase A of the SETTINGS_REDESIGN_PROPOSAL.md plan.
   No persistence yet; each section gets wired in its own follow-up.
   ============================================================ */

.tsv2-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    backdrop-filter: blur(2px);
}
.tsv2-overlay.active { display: flex; }

.tsv2-modal {
    background: #ffffff;
    width: 1100px;
    height: 760px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Expanded — covers the actual viewport, fully opaque.
   Why the zoom compensation: shared/layout.css sets `body { zoom: 0.75; ... }`
   which scales every descendant (incl. position:fixed children) to 75% of
   their CSS-declared size. Without compensation, `height: 100vh` on the
   expanded modal renders at 75% of the visible viewport. Setting
   `zoom: calc(1 / 0.75)` on the overlay neutralizes the inherited body zoom
   so 100% really means 100%. Switched from 100vw/100vh to 100%/100% to
   match the lesson-modal pattern (which is what works in this app). */
.tsv2-overlay.tsv2-expanded {
    background: #ffffff !important;
    zoom: 1.33333333 !important;
}
.tsv2-overlay.tsv2-expanded .tsv2-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ---------- Header ---------- */
.tsv2-header {
    display: flex;
    align-items: center;
    padding: 18px 22px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    gap: 14px;
}
.tsv2-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1;
}
.tsv2-header-sub {
    margin-left: 10px;
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
}
.tsv2-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mirror .ld-fullscreen-btn from lesson-modal.css 1:1 */
.tsv2-fullscreen-btn,
.tsv2-close-btn {
    background: none;
    border: 1px solid #e0e0e0;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s;
    font-family: inherit;
}
.tsv2-fullscreen-btn:hover,
.tsv2-close-btn:hover {
    color: #333;
    background: #f3f4f6;
    border-color: #ccc;
}

/* ---------- Preview / Live banner ---------- */
.tsv2-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.tsv2-banner.tsv2-banner-live {
    background: #ecfdf5;
    border-bottom-color: #a7f3d0;
    color: #047857;
}
.tsv2-banner.tsv2-banner-live .tsv2-banner-link { color: #047857; }
.tsv2-banner.tsv2-banner-live .tsv2-banner-link:hover { color: #065f46; }
.tsv2-banner-icon { font-size: 16px; }
.tsv2-banner-text { flex: 1; }
.tsv2-banner-link {
    color: #92400e;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font: inherit;
    padding: 0;
}
.tsv2-banner-link:hover { color: #78350f; }

/* ---------- Body layout ---------- */
.tsv2-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ---------- Sidebar ---------- */
.tsv2-sidebar {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tsv2-search {
    padding: 14px 14px 8px;
    flex-shrink: 0;
}
.tsv2-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: #ffffff;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tsv2-search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.tsv2-nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px 16px;
}

.tsv2-nav-group {
    padding: 12px 10px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tsv2-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 1px 0;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    user-select: none;
}
.tsv2-nav-item:hover { background: #eef2f7; }
.tsv2-nav-item.active {
    background: #10b981;
    color: #ffffff;
    font-weight: 500;
}
.tsv2-nav-item.active .tsv2-nav-icon { color: #ffffff; }
.tsv2-nav-icon {
    width: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
}
.tsv2-nav-new {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    background: #dcfce7;
    color: #047857;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tsv2-nav-item.active .tsv2-nav-new {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.tsv2-nav-item.tsv2-hidden { display: none; }
.tsv2-nav-group.tsv2-hidden { display: none; }

/* ---------- Content ---------- */
.tsv2-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 36px 60px;
    background: #ffffff;
}

.tsv2-section-head {
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 600;
    color: #0f172a;
}
.tsv2-section-sub {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 26px;
}

.tsv2-block {
    margin-bottom: 32px;
}
.tsv2-block-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 10px;
}

/* Field row — label + control */
.tsv2-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}
.tsv2-row:last-child { border-bottom: none; }
.tsv2-row-label {
    flex: 1;
    min-width: 0;
}
.tsv2-row-label .tsv2-label {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 2px;
}
.tsv2-row-label .tsv2-hint {
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}
.tsv2-row-control {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toggle switch (iOS-style) */
.tsv2-switch {
    position: relative;
    width: 38px;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.18s;
    flex-shrink: 0;
}
.tsv2-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: left 0.18s;
}
.tsv2-switch.on { background: #10b981; }
.tsv2-switch.on::after { left: 18px; }
.tsv2-switch.locked {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Pill group */
.tsv2-pillgroup { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tsv2-pill {
    padding: 6px 14px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s;
    font-family: inherit;
}
.tsv2-pill:hover { background: #e2e8f0; }
.tsv2-pill.on {
    background: #10b981;
    color: #ffffff;
    border-color: #059669;
}

/* Dropdown */
.tsv2-select {
    padding: 7px 28px 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    font-size: 13px;
    color: #0f172a;
    cursor: pointer;
    font-family: inherit;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24'><path fill='%23475569' d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 140px;
}
.tsv2-select:focus { border-color: #10b981; }

/* Text input */
.tsv2-text {
    padding: 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s;
    min-width: 180px;
}
.tsv2-text:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.tsv2-textarea {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    width: 100%;
    min-height: 70px;
    resize: vertical;
}
.tsv2-textarea:focus { border-color: #10b981; }

/* Slider */
.tsv2-slider {
    width: 180px;
    accent-color: #10b981;
}

/* Buttons */
.tsv2-btn {
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #334155;
    transition: all 0.12s;
}
.tsv2-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.tsv2-btn.primary {
    background: #10b981;
    color: #ffffff;
    border-color: #059669;
}
.tsv2-btn.primary:hover { background: #059669; }
.tsv2-btn.danger {
    color: #b91c1c;
    border-color: #fecaca;
}
.tsv2-btn.danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* Card */
.tsv2-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    background: #ffffff;
    margin-bottom: 10px;
}
.tsv2-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tsv2-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}
.tsv2-card-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.tsv2-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tsv2-card-status.connected { background: #dcfce7; color: #047857; }
.tsv2-card-status.disconnected { background: #fee2e2; color: #b91c1c; }
.tsv2-card-status.coming-soon { background: #f1f5f9; color: #64748b; }

/* Lock indicator */
.tsv2-lock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
    padding: 2px 7px;
    background: #f1f5f9;
    border-radius: 999px;
    margin-left: 8px;
}

/* Matrix table (notifications) */
.tsv2-matrix-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}
.tsv2-matrix-cat {
    background: #f8fafc;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 12px;
    color: #475569;
    border-bottom: 1px solid #e5e7eb;
}
.tsv2-matrix-row {
    display: grid;
    grid-template-columns: 1fr 110px 110px 110px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    gap: 10px;
}
.tsv2-matrix-row:last-child { border-bottom: none; }
.tsv2-matrix-row.head {
    background: #f8fafc;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.04em;
    padding-top: 8px;
    padding-bottom: 8px;
}
.tsv2-matrix-row .tsv2-select {
    min-width: 0;
    width: 100%;
}
.tsv2-matrix-trigger {
    color: #334155;
}

/* Inline group of cards/tiles */
.tsv2-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.tsv2-tile {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.tsv2-tile:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.tsv2-tile-title {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 4px;
}
.tsv2-tile-sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

/* Color swatches */
.tsv2-swatches {
    display: inline-flex;
    gap: 8px;
}
.tsv2-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.1s;
}
.tsv2-swatch:hover { transform: scale(1.08); }
.tsv2-swatch.on {
    border-color: #0f172a;
}

/* Sales pitch / enterprise pillar cards */
.tsv2-pillar {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.tsv2-pillar-no {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}
.tsv2-pillar-title {
    font-weight: 600;
    font-size: 15px;
    color: #0f172a;
    margin-bottom: 4px;
}
.tsv2-pillar-body {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

/* Toast */
.tsv2-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: #0f172a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    transition: all 0.25s;
    z-index: 9100;
    pointer-events: none;
}
.tsv2-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Empty state */
.tsv2-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.tsv2-empty-icon { font-size: 36px; margin-bottom: 8px; }
.tsv2-empty-text { font-size: 14px; }

/* Inline hint banner inside a section */
.tsv2-inline-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.tsv2-inline-banner.warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.tsv2-inline-banner.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* Mini chart placeholder */
.tsv2-chart-placeholder {
    height: 130px;
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
    border: 1px dashed #a7f3d0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #047857;
    font-size: 12px;
    margin: 10px 0 14px;
}
