/* Taco Languages admin
   Avocado sidebar, corn-yellow taco mark, cool paper background. */
:root {
  --avocado: #1F5E4A;
  --avocado-deep: #163F33;
  --avocado-soft: #E3EFE8;
  --corn: #F2B632;
  --lettuce: #7BC47F;
  --chile: #C8412F;
  --paper: #F5F7F3;
  --ink: #1A211E;
  --muted: #5F6B65;
  --line: #DCE3DC;

  --bs-body-font-family: "Figtree", system-ui, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-primary: var(--avocado);
  --bs-primary-rgb: 31, 94, 74;
  --bs-link-color: var(--avocado);
  --bs-link-color-rgb: 31, 94, 74;
  --bs-link-hover-color: var(--avocado-deep);
  --bs-border-color: var(--line);
}

body { font-size: 0.95rem; }
h1, h2, h3, .stat-num, .brand { font-family: "Bricolage Grotesque", "Figtree", sans-serif; }
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.9rem; }
h3 { font-size: 0.95rem; font-weight: 700; margin-top: 1rem; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--corn); outline-offset: 2px; }

.btn-primary { --bs-btn-bg: var(--avocado); --bs-btn-border-color: var(--avocado);
  --bs-btn-hover-bg: var(--avocado-deep); --bs-btn-hover-border-color: var(--avocado-deep);
  --bs-btn-active-bg: var(--avocado-deep); --bs-btn-disabled-bg: var(--avocado); }
.btn-outline-primary { --bs-btn-color: var(--avocado); --bs-btn-border-color: var(--avocado);
  --bs-btn-hover-bg: var(--avocado); --bs-btn-hover-border-color: var(--avocado);
  --bs-btn-active-bg: var(--avocado-deep); }
.form-control:focus, .form-select:focus { border-color: var(--avocado); box-shadow: 0 0 0 3px rgba(31,94,74,.18); }
.form-check-input:checked { background-color: var(--avocado); border-color: var(--avocado); }
.progress-bar { background-color: var(--avocado); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--avocado); color: #fff; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 2rem;
  position: sticky; top: 0; height: 100vh; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: rgba(255,255,255,.82); text-decoration: none; padding: .55rem .75rem; border-radius: 8px; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--avocado-deep); color: #fff; box-shadow: inset 3px 0 0 var(--corn); }
.sidebar-foot { margin-top: auto; font-size: .85rem; color: rgba(255,255,255,.7); }
.sidebar-foot a { color: #fff; }
.main { padding: 2rem 2.25rem 4rem; min-width: 0; }

.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.15rem; line-height: 1.05; }
.brand-dark { color: var(--avocado); margin-bottom: 1.5rem; }
/* The taco: a corn shell with a line of lettuce */
.brand-mark { width: 34px; height: 18px; background: var(--corn); border-radius: 0 0 18px 18px;
  box-shadow: inset 0 4px 0 var(--lettuce); flex: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .main { padding: 1.25rem 1rem 3rem; }
}

/* ---------- Page pieces ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.count { font-family: "Figtree", sans-serif; font-size: .8em; font-weight: 500; color: var(--muted); margin-left: .25rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.35rem; margin-bottom: 1.5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.panel-head h2 { margin: 0; }
.panel .table { --bs-table-bg: transparent; }
.panel .table th { font-size: .8rem; font-weight: 600; color: var(--muted); border-bottom-color: var(--line); }
.panel.p-0 .table th:first-child, .panel.p-0 .table td:first-child { padding-left: 1.35rem; }
.panel.p-0 .table th:last-child, .panel.p-0 .table td:last-child { padding-right: 1.35rem; }
.empty { color: var(--muted); margin: 0; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }

.stat-row { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-bottom: 1.75rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters .form-control { flex: 1 1 240px; }
.filters .form-select { flex: 0 1 190px; }

.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--avocado); border-bottom-color: var(--avocado); }

.form-grid fieldset { margin-bottom: 1.5rem; }
.form-grid legend { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; }
.sub-form { background: var(--paper); border-radius: 10px; padding: .9rem; margin-bottom: 1rem; }

/* ---------- Tags, levels, stages ---------- */
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; background: #EEF1EE; color: var(--muted); white-space: nowrap; }
.tag-paid        { background: var(--avocado-soft); color: var(--avocado); }
.tag-due_soon    { background: #FDF1D3; color: #8A5B00; }
.tag-overdue     { background: #F8DEDA; color: var(--chile); }
.tag-low_lessons { background: #E4ECF7; color: #2F5A94; }
.tag-expiring    { background: #F1E6F5; color: #7A3E91; }

/* CEFR levels: a ramp from light to deep, so the level reads at a glance */
.level { display: inline-block; font-weight: 700; font-size: .75rem; padding: .1rem .45rem; border-radius: 5px; }
.level-A1 { background: #FFF3CF; color: #7A5A00; }
.level-A2 { background: #FBE39A; color: #6B4E00; }
.level-B1 { background: #CFE8D2; color: #1F5E4A; }
.level-B2 { background: #9FD0A8; color: #163F33; }
.level-C1 { background: #3F8A6C; color: #fff; }
.level-C2 { background: #163F33; color: #fff; }

/* Onboarding stages share one color per stage across board, pills and lists */
.stage-booked   { --stage: #5B7DB1; }
.stage-enrolled { --stage: #E0A21C; }
.stage-month_1  { --stage: #9BCB8F; }
.stage-month_2  { --stage: #5FAE7A; }
.stage-month_3  { --stage: #2F8662; }
.stage-retained { --stage: #1F5E4A; }
.stage-dropped  { --stage: #A7AFAA; }
.lead-new         { --stage: #A7AFAA; }
.lead-contacted   { --stage: #5B7DB1; }
.lead-demo_booked { --stage: #E0A21C; }
.lead-demo_done   { --stage: #5FAE7A; }
.lead-won         { --stage: #1F5E4A; }
.lead-lost        { --stage: #C8412F; }
.stage-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; }
.stage-pill::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--stage); }
.stage-list li { border-left: 4px solid var(--stage); padding-left: .6rem; }

/* ---------- Kanban boards ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .75rem; }
.column { background: #EBEFEA; border-radius: 12px; padding: .75rem; border-top: 4px solid var(--stage); min-height: 320px; display: flex; flex-direction: column; }
.column h2 { font-size: .95rem; margin-bottom: .6rem; }
.cards { display: flex; flex-direction: column; gap: .5rem; flex: 1; min-height: 60px; }
.card-item { display: flex; flex-direction: column; gap: .2rem; background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: .6rem .7rem; text-decoration: none; color: var(--ink); cursor: grab; }
.card-item:hover { border-color: var(--avocado); }
.card-name { font-weight: 600; }
.card-meta { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.card-days { font-size: .75rem; color: var(--muted); }
.card-item.is-stale { border-left: 3px solid var(--chile); }
.card-item.is-stale .card-days { color: var(--chile); font-weight: 600; }
.sortable-ghost { opacity: .35; }
.sortable-drag { box-shadow: 0 8px 20px rgba(22,63,51,.2); }
.card-item.just-moved { animation: settle .5s ease-out; }
@keyframes settle { from { background: #FDF1D3; } to { background: #fff; } }

/* ---------- Student profile ---------- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; font-size: .9rem; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 .7rem 1rem; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--avocado); }

.pkg { border: 1px solid var(--line); border-radius: 10px; padding: .85rem 1rem; margin-bottom: .75rem; }
.pkg-completed, .pkg-cancelled { opacity: .6; }
.pkg-top, .pkg-bottom { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.pkg .progress { height: 8px; margin: .6rem 0; background: var(--avocado-soft); }
.progress-thin { height: 5px; background: var(--avocado-soft); margin-bottom: .2rem; }

.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.lesson-list li:last-child { border-bottom: 0; }
.lesson-list p { margin: .25rem 0 0; font-size: .9rem; }
.att { font-size: .75rem; font-weight: 600; margin: 0 .4rem; }
.att-present { color: var(--avocado); }
.att-late { color: #8A5B00; }
.att-absent { color: var(--muted); }
.att-no_show { color: var(--chile); }

/* ---------- Packages catalog ---------- */
.catalog-row { display: grid; grid-template-columns: 1.8fr .7fr 1.5fr 1.2fr 1.2fr 1.2fr; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.catalog-head { font-size: .8rem; font-weight: 600; color: var(--muted); }
.catalog-row.is-hidden input { color: var(--muted); }
.catalog-new { border-bottom: 0; padding-top: .8rem; }
@media (max-width: 760px) { .catalog-row { grid-template-columns: 1fr 1fr; } .catalog-head { display: none; } }

/* ---------- Sales chart ---------- */
.bars { display: flex; align-items: flex-end; gap: .75rem; height: 200px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .3rem; }
.bar { width: 100%; max-width: 56px; background: var(--avocado); border-radius: 6px 6px 0 0; }
.bar-col:last-child .bar { background: var(--corn); }
.bar-val { font-size: .75rem; color: var(--muted); }
.bar-label { font-size: .8rem; font-weight: 600; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--avocado); padding: 1rem; }
.login-card { background: #fff; border-radius: 16px; padding: 2rem; width: 100%; max-width: 380px; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }

/* Toast for AJAX results */
.toast-msg { position: fixed; bottom: 1.25rem; right: 1.25rem; background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 10px; z-index: 1080; max-width: 360px; font-size: .9rem; }
.toast-msg.is-error { background: var(--chile); }

@media (prefers-reduced-motion: reduce) { .card-item.just-moved { animation: none; } }

/* ---------- Schedule (FullCalendar) ---------- */
.fc { --fc-border-color: var(--line); --fc-today-bg-color: #FBF6E6; --fc-now-indicator-color: var(--chile);
  --fc-button-bg-color: #fff; --fc-button-border-color: var(--line); --fc-button-text-color: var(--ink);
  --fc-button-hover-bg-color: var(--avocado-soft); --fc-button-hover-border-color: var(--avocado);
  --fc-button-active-bg-color: var(--avocado); --fc-button-active-border-color: var(--avocado); font-size: .88rem; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-toolbar-title { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.25rem; font-weight: 700; }
.fc .fc-button { font-weight: 500; text-transform: none; box-shadow: none !important; }
.fc-event { border-radius: 6px; padding: 1px 3px; cursor: pointer; }
.fc-event.ev-private { background: var(--avocado); border-color: var(--avocado); }
.fc-event.ev-group   { background: #B7791F; border-color: #B7791F; }
.fc-event.ev-demo    { background: #4A6FA5; border-color: #4A6FA5; }
.fc-event.ev-done    { opacity: .55; }
.fc-event.ev-cancelled { background: #fff !important; border: 1px dashed #A7AFAA !important; }
.fc-event.ev-cancelled .fc-event-title, .fc-event.ev-cancelled .fc-event-time { color: var(--muted) !important; text-decoration: line-through; }
.fc-list-event.ev-cancelled td { text-decoration: line-through; color: var(--muted); }
.repeat-box { background: var(--paper); border-radius: 10px; padding: .75rem; margin-top: .5rem; }
.class-list { list-style: none; padding: 0; margin: 0; }
.class-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.class-list li:last-child { border-bottom: 0; }
.class-time { font-weight: 600; min-width: 4.5rem; display: inline-block; }
.fc a.fc-col-header-cell-cushion, .fc a.fc-daygrid-day-number, .fc a.fc-list-day-text, .fc a.fc-list-day-side-text { color: var(--ink); text-decoration: none; }

/* ---------- Student portal ---------- */
.portal { background: var(--paper); }
.portal-head { background: #fff; border-bottom: 1px solid var(--line); padding: .85rem 0; margin-bottom: 1.75rem; }
.portal-wrap { width: min(820px, 92vw); margin-inline: auto; }
.portal-head .portal-wrap { display: flex; align-items: center; gap: 1rem; }
.portal-head nav { margin-left: auto; display: flex; gap: 1.1rem; }
.portal-head nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .93rem; }
.portal-head nav a:hover { color: var(--avocado); }
.portal-main { padding-bottom: 4rem; }
.portal-main h1 { font-size: 1.7rem; margin-bottom: .5rem; }
.portal-stats { display: flex; gap: 2rem; margin-bottom: 1.5rem; color: var(--muted); }
.portal-stats strong { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.3rem; color: var(--avocado); margin-right: .25rem; }

/* ---------- Course materials ---------- */
.item-list { list-style: none; padding: 0; margin: 0; }
.item-list li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.item-list li:last-child { border-bottom: 0; }
.item-title { flex: 1; min-width: 0; }
.item-type { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .2rem .5rem; border-radius: 5px; background: #EEF1EE; color: var(--muted); white-space: nowrap; }
.item-video { background: #E4ECF7; color: #2F5A94; }
.item-pdf   { background: #F8DEDA; color: var(--chile); }
.item-audio { background: #F1E6F5; color: #7A3E91; }
.item-text  { background: var(--avocado-soft); color: var(--avocado); }
.item-interactive { background: #FDF1D3; color: #8A5B00; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.course-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 1.25rem; text-decoration: none; color: var(--ink); }
.course-card:hover { border-color: var(--avocado); }
.course-card h2 { font-size: 1.1rem; margin-bottom: .35rem; }
.course-card p { color: var(--muted); font-size: .92rem; }
.course-card .progress { height: 6px; background: var(--avocado-soft); margin: .75rem 0 .35rem; }
.video-frame, .pdf-frame { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.video-frame { aspect-ratio: 16 / 9; }
.pdf-frame { height: min(75vh, 900px); background: var(--sand, #f1f1ea); }
.video-frame iframe, .pdf-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-text { font-size: 1.02rem; line-height: 1.7; }

/* ---------- Exercise player ---------- */
#exercise { max-width: 640px; }
.ex-hint, .ex-count { color: var(--muted); font-size: .9rem; }
.ex-match { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ex-col { display: flex; flex-direction: column; gap: .5rem; }
.ex-chip { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .8rem;
  font: inherit; text-align: left; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.ex-chip:hover:not(:disabled) { border-color: var(--avocado); }
.ex-chip.is-picked { border-color: var(--avocado); background: var(--avocado-soft); }
.ex-chip.is-right { border-color: var(--lettuce); background: var(--avocado-soft); color: var(--muted); }
.ex-chip.is-wrong { border-color: var(--chile); background: #F8DEDA; }
.ex-card { display: grid; place-items: center; width: 100%; min-height: 190px; font-size: 1.45rem; font-weight: 600;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; padding: 1.5rem; font-family: inherit; }
.ex-card.is-flipped { background: var(--avocado-soft); border-color: var(--avocado); }
.ex-nav { display: flex; gap: .5rem; }
.ex-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.ex-sentence { margin: 0; display: flex; align-items: center; gap: .35rem; flex: 1; flex-wrap: wrap; }
.ex-input { width: 9rem; display: inline-block; }
.ex-input.is-right { border-color: var(--lettuce); background: var(--avocado-soft); }
.ex-input.is-wrong { border-color: var(--chile); background: #F8DEDA; }
.ex-feedback { font-weight: 600; min-width: 4rem; }
.ex-question { font-size: 1.15rem; font-weight: 600; margin-bottom: .75rem; }
.ex-option { display: block; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--line);
  border-radius: 10px; padding: .7rem .9rem; margin-bottom: .5rem; font: inherit; cursor: pointer; }
.ex-option:hover:not(:disabled) { border-color: var(--avocado); }
.ex-option.is-right { border-color: var(--lettuce); background: var(--avocado-soft); }
.ex-option.is-wrong { border-color: var(--chile); background: #F8DEDA; }
.ex-result { margin-top: 1.25rem; padding: 1rem; background: var(--avocado-soft); border-radius: 12px; }
.ex-result strong { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.25rem; display: block; margin-bottom: .25rem; }
.ex-help { background: var(--paper); border-radius: 8px; padding: .6rem .75rem; white-space: pre-wrap; margin: 0; }
@media (max-width: 560px) { .ex-match { grid-template-columns: 1fr; } }