/* Suhbat Studio — same palette as the learner app (Samarkand turquoise, saffron, cream). */
:root {
  --bg: #FFF8EC; --surface: #FFFFFF; --surface-2: #FFFCF6; --text: #16323A; --muted: #56696F;
  --border: #E6DCC9; --hair: #EFE6D6; --primary: #0E8A8A; --primary-dark: #0B5563; --primary-light: #D5F0EE;
  --accent: #F5A524; --accent-dark: #B7740B; --accent-light: #FDEBC8; --accent-ink: #7A4C05;
  --red: #D6455D; --red-ink: #B8304A; --red-light: #FBE0E5; --select: #3B5BDB; --chip: #F3EDE1;
  --urdu: 'Noto Nastaliq Urdu', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 'Inter', system-ui, -apple-system, sans-serif; }
a { color: var(--primary-dark); }
h1 { font-size: 28px; font-weight: 800; margin: 0; }
h2 { font-size: 17px; font-weight: 800; margin: 0; }
h3 { font-size: 15px; font-weight: 800; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--primary-dark); text-transform: uppercase; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 10px); }
.spacer { flex: 1; }
.rtl { direction: rtl; font-family: var(--urdu); font-size: 19px; line-height: 2; }

/* Shell */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 24px; background: var(--primary-dark); color: #fff; }
.top a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand b { font-size: 21px; font-weight: 800; }
.brand span { font-size: 14px; font-weight: 700; color: #BFE7E3; }
.course-switch { position: relative; }
.course-switch summary { list-style: none; cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #3F8C96; border-radius: 10px; background: #0E6470; font-weight: 700; }
.course-switch summary::-webkit-details-marker { display: none; }
.course-switch .menu { position: absolute; z-index: 10; top: 46px; left: 0; min-width: 220px; background: var(--surface); border: 2px solid var(--border); border-radius: 12px; padding: 6px; }
.course-switch .menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); font-weight: 600; }
.course-switch .menu a:hover { background: var(--chip); }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.layout { display: flex; flex-wrap: wrap; min-height: calc(100vh - 64px); }
.side { flex: 1 1 220px; max-width: 250px; padding: 20px 14px; border-right: 2px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.side a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none; }
.side a.on { background: var(--primary-light); color: var(--primary-dark); font-weight: 800; }
.side .label { margin: 14px 12px 4px; }
.main { flex: 999 1 560px; min-width: 0; padding: 26px 32px 60px; display: flex; flex-wrap: wrap; gap: 28px; align-content: flex-start; }
.main > .col { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.main > aside { flex: 1 1 260px; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 720px) { .side { max-width: none; border-right: 0; border-bottom: 2px solid var(--border); flex-direction: row; flex-wrap: wrap; } .main { padding: 20px 16px 48px; } }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 12px; background: var(--surface); color: var(--primary-dark); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary-dark); color: #fff; }
.btn.primary:hover { background: #0C7C7C; }
.btn.accent { background: var(--accent); border-color: var(--accent-dark); color: #3A2400; }
.btn.ghost { border: 0; background: transparent; min-height: 36px; padding: 0 8px; }
.btn.danger { color: var(--red-ink); }
.btn.sm { min-height: 36px; padding: 0 10px; font-size: 13px; border-bottom-width: 3px; }
.btn:disabled { opacity: .5; cursor: default; }
.top .btn { min-height: 40px; border-width: 1px; border-bottom-width: 3px; }
.top .btn.outline { background: transparent; border-color: #3F8C96; color: #fff; border-bottom-width: 1px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; }
input[type=text], input[type=email], input[type=password], input:not([type]), select, textarea {
  min-height: 44px; padding: 8px 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 500; width: 100%;
}
textarea { min-height: 64px; }
::placeholder { color: #A3AFB2; font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input[type=checkbox] { flex: none; width: 20px; height: 20px; accent-color: var(--primary); margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check small { display: block; font-weight: 500; color: var(--muted); }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--red-ink); font-size: 13px; font-weight: 700; }

/* Surfaces */
.card { background: var(--surface); border: 2px solid var(--border); border-radius: 16px; }
.card.pad { padding: 16px; }
.list > * { border-bottom: 1px solid var(--hair); }
.list > *:last-child { border-bottom: 0; }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--chip); color: #3F4F54; font-size: 12px; font-weight: 700; }
.pill { display: inline-flex; justify-content: center; min-width: 84px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill.ok { background: var(--primary-light); color: var(--primary-dark); }
.pill.draft { background: var(--accent-light); color: var(--accent-ink); }
.pill.off { background: var(--chip); color: var(--muted); }
.focus-chip { padding: 4px 10px; border-radius: 999px; background: var(--accent-light); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.warn { color: #8A5300; font-weight: 800; }
.flash { padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.flash.success { background: var(--primary-light); color: var(--primary-dark); }
.flash.error { background: var(--red-light); color: var(--red-ink); }
.copy { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface-2); border: 2px dashed var(--accent-dark); border-radius: 12px; word-break: break-all; font-size: 13px; }

/* Outline */
.lesson-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 16px; }
.lesson-row .title { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); }
.lesson-row .title b { font-size: 16px; }
.lesson-row .mix { flex: 2 1 240px; display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-row .voiced { width: 110px; font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.icon { width: 40px; height: 40px; border-radius: 20px; background: var(--primary); border-bottom: 3px solid var(--primary-dark); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.issue { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; color: var(--text); text-decoration: none; }
.issue b { font-size: 14px; }

/* Word editor */
.word-grid { display: grid; grid-template-columns: minmax(120px,1.2fr) minmax(110px,1fr) minmax(100px,1fr) minmax(90px,.8fr) minmax(90px,.8fr) 210px 92px; gap: 8px; align-items: center; }
.word-grid.no-roman { grid-template-columns: minmax(130px,1.2fr) minmax(120px,1fr) minmax(100px,.8fr) minmax(100px,.8fr) 210px 92px; }
.word-grid.head { padding: 10px 16px 6px; font-size: 12px; font-weight: 800; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; }
.word-row { padding: 8px 16px; }
.word-row input { min-height: 40px; padding: 6px 10px; border-radius: 10px; font-size: 14px; }
.word-row input.target { font-weight: 800; font-size: 16px; }
.scroll-x { overflow-x: auto; }
.scroll-x > .inner { min-width: 980px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); }
.tabs a { min-height: 44px; display: flex; align-items: center; padding: 0 14px; color: var(--muted); font-weight: 700; text-decoration: none; }
.tabs a.on { color: var(--primary-dark); font-weight: 800; border-bottom: 3px solid var(--primary); margin-bottom: -2px; }
.mix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.mix-grid .check { padding: 12px 14px; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; }

/* Recorder */
.rec { display: flex; align-items: center; gap: 6px; }
.rec .play, .rec .record { width: 36px; height: 36px; border-radius: 18px; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.rec .play { background: var(--primary-light); color: var(--primary-dark); }
.rec .record { background: var(--surface); border: 2px solid var(--red); color: var(--red-ink); }
.rec .record .dot { width: 10px; height: 10px; border-radius: 5px; background: var(--red); }
.rec.recording .record { background: var(--red); }
.rec.recording .record .dot { background: #fff; border-radius: 2px; }
.rec .status { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 60px; }
.rec.missing .status { color: var(--red-ink); }
.rec input[type=file] { display: none; }
.rec .upload { font-size: 12px; font-weight: 700; color: var(--primary-dark); cursor: pointer; text-decoration: underline; }

/* Scene */
.script { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.line { display: flex; gap: 12px; }
.line .num { flex: none; width: 28px; height: 28px; border-radius: 14px; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.line .body { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.line.choice .body { border-color: var(--select); }
.speaker { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.speaker.character { background: var(--chip); color: #3F4F54; }
.speaker.learner, .speaker.choice { background: var(--primary-light); color: var(--primary-dark); }
.replies { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.reply { padding: 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.branch { border-top: 1px dashed var(--border); padding-top: 8px; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 8px; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; letter-spacing: .6px; color: var(--muted); padding: 12px 16px; text-transform: uppercase; }
table.data td { padding: 12px 16px; border-top: 1px solid var(--hair); }
.stat { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 26px; font-weight: 800; }
.bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; width: 120px; }
.bar > span { display: block; height: 100%; background: var(--primary); }
.bar.low > span { background: var(--accent-dark); }

/* Login */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth .card { width: 100%; max-width: 420px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }

/* Admin badge, course badge, drag handle, line settings */
.admin-badge { padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #3A2400; font-size: 12px; font-weight: 800; letter-spacing: .5px; }
.code-badge { width: 44px; height: 44px; flex: none; border-radius: 22px; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.grip { cursor: grab; color: #A99E88; font-size: 18px; user-select: none; }
.lesson-row.dragging { opacity: .4; }
.line-settings summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.line-settings > div { padding-top: 8px; }
a.chip { text-decoration: none; }
.steps { margin: 0; padding: 0 0 0 0; list-style-position: inside; }
.steps li { padding: 10px 16px; font-weight: 600; }

/* Learner preview */
.phone { width: 300px; max-width: 100%; min-height: 470px; border: 8px solid var(--text); border-radius: 36px; background: var(--bg); padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.phone h3 { font-size: 17px; }
.phone .pcard { background: var(--surface); border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 14px; padding: 12px; font-weight: 700; text-align: left; font: inherit; color: inherit; }
.phone button.pcard { cursor: pointer; }
.phone .pcard.right { border-color: var(--primary); background: var(--primary-light); }
.phone .pcard.wrong { border-color: var(--red); background: var(--red-light); }
.phone .big { font-size: 26px; font-weight: 800; }
.phone[data-rtl] .t { direction: rtl; font-family: var(--urdu); line-height: 2; }
.phone .mic { width: 64px; height: 64px; margin: 10px auto 0; border-radius: 32px; background: var(--primary); border-bottom: 5px solid var(--primary-dark); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; }
