/* ============================================================
   Hear It — Admin Console styles
   Desktop operator console. Inherits brand tokens from styles.css.
   ============================================================ */

.admin-body {
  font-weight: 600;
  background:
    radial-gradient(1200px 600px at 110% -10%, #FFE9DF 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #E4EEFF 0%, transparent 55%),
    var(--paper);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ============================================================
   LOGIN
   ============================================================ */
.adm-login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 10; }
.adm-login-card {
  width: min(420px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 32px 30px;
}
.adm-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.adm-login-brand .brand-mark { filter: drop-shadow(0 6px 12px rgba(255,107,92,.35)); }
.adm-login-name { font-family: "Quicksand"; font-weight: 700; font-size: 22px; }
.adm-login-name span { color: var(--coral); }
.adm-login-name em { font-style: normal; color: var(--ink-faint); font-size: 15px; }
.adm-login-tag { color: var(--ink-faint); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.adm-login-sub { color: var(--ink-soft); font-size: 14px; margin: 14px 0 18px; }

.adm-field { display: block; margin-bottom: 14px; }
.adm-field span { display: block; font-weight: 800; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.adm-field input {
  width: 100%; padding: 13px 15px; border: 2px solid var(--line-2); border-radius: 14px;
  background: #fff; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
}
.adm-field input:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 16%, transparent); }
.adm-login-err { color: var(--coral-d); font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.adm-login-btn { width: 100%; }
.adm-login-back { display: block; text-align: center; margin-top: 18px; color: var(--ink-faint); font-weight: 700; text-decoration: none; font-size: 14px; }
.adm-login-back:hover { color: var(--coral-d); }

/* ============================================================
   SHELL
   ============================================================ */
[hidden] { display: none !important; }
.adm-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.adm-side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 30;
  background: rgba(255,255,255,.82); backdrop-filter: blur(16px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px;
}
.adm-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 2px 6px 18px; }
.adm-brand .brand-name { font-size: 21px; color: var(--ink); }
.adm-brand .brand-name span { color: var(--coral); }
.adm-badge { background: var(--ink); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .08em; }

.adm-nav { display: flex; flex-direction: column; gap: 5px; }
.adm-nav-item {
  display: flex; align-items: center; gap: 11px; border: 0; background: transparent;
  color: var(--ink-soft); font-weight: 700; font-size: 15px; padding: 12px 14px;
  border-radius: var(--r-sm); text-align: left; transition: .15s;
}
.adm-nav-item span { font-size: 18px; }
.adm-nav-item:hover { background: #FFF1EA; color: var(--ink); }
.adm-nav-item.is-active { background: var(--coral); color: #fff; box-shadow: 0 10px 22px -10px var(--coral); }

.adm-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.adm-applink, .adm-logout {
  display: flex; align-items: center; gap: 9px; text-decoration: none; border: 0; background: transparent;
  color: var(--ink-soft); font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 12px; transition: .15s; text-align: left;
}
.adm-applink:hover { background: #E8F0FF; color: var(--sky); }
.adm-logout:hover { background: #FFF4F1; color: var(--coral-d); }

.adm-main { flex: 1; margin-left: 240px; min-width: 0; display: flex; flex-direction: column; }
.adm-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 18px clamp(20px, 3vw, 36px); background: rgba(255,247,242,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.adm-page-title { font-family: "Quicksand"; font-weight: 700; font-size: 24px; margin: 0; flex: 1; }
.adm-top-right { display: flex; align-items: center; gap: 12px; }
.adm-user { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.adm-burger { display: none; background: #FFF1EA; border: 0; width: 40px; height: 40px; border-radius: 12px; font-size: 18px; color: var(--ink-soft); }

.adm-content { padding: clamp(20px, 3vw, 32px); flex: 1; overflow-y: auto; }
.adm-view { display: flex; flex-direction: column; gap: 22px; }

.adm-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.adm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.adm-card-head h3 { margin: 0; font-size: 17px; }
.adm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.adm-link { cursor: pointer; text-decoration: none; }
.adm-link:hover { color: var(--coral-d); }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-grid--3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid--4 { grid-template-columns: repeat(4, 1fr); }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start;
}
.kpi-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex: none; background: #F4EFF8; }
.kpi--coral .kpi-ic { background: #FFE7DC; } .kpi--mint .kpi-ic { background: #E1F7EC; }
.kpi--sun .kpi-ic { background: #FFF6D9; } .kpi--sky .kpi-ic { background: #E4EEFF; }
.kpi--warn .kpi-ic { background: #FFE3DD; }
.kpi-val { font-family: "Quicksand"; font-weight: 700; font-size: 26px; line-height: 1; color: var(--ink); }
.kpi-label { font-weight: 800; font-size: 13px; color: var(--ink-soft); margin-top: 5px; }
.kpi-sub { font-size: 12px; color: var(--ink-faint); font-weight: 700; margin-top: 4px; }
.trend { font-weight: 800; }
.trend.up { color: #126B4B; } .trend.down { color: var(--coral-d); }

/* ============================================================
   CHARTS
   ============================================================ */
.adm-chart { width: 100%; }
.adm-chart .chart-svg { width: 100%; height: auto; }

/* ============================================================
   RECENT ACTIVITY
   ============================================================ */
.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-row { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; }
.recent-row:hover { background: #FFF7F2; }
.recent-flag { font-size: 18px; }
.recent-name { font-weight: 700; font-size: 14px; }
.recent-date { font-size: 12px; color: var(--ink-faint); font-weight: 700; }

.pill { font-weight: 800; font-size: 11px; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.pill-free { background: #F0ECF4; color: var(--ink-soft); }
.pill-plus { background: #E4EEFF; color: var(--sky); }
.pill-pro { background: linear-gradient(135deg, #FFE7C9, #FFD9C4); color: var(--coral-d); }

/* ============================================================
   TOOLBAR / SEARCH / FILTERS
   ============================================================ */
.adm-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.adm-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--line-2); border-radius: 14px; padding: 0 14px; flex: 1; min-width: 220px; }
.adm-search input { border: 0; outline: none; background: transparent; padding: 12px 0; font-family: inherit; font-size: 15px; font-weight: 600; width: 100%; color: var(--ink); }
.adm-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.adm-filters select, .modal-input.adm-select {
  border: 2px solid var(--line-2); border-radius: 14px; padding: 11px 14px; background: #fff;
  font-family: inherit; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer;
}
.adm-filters select:focus { outline: none; border-color: var(--coral); }
.btn-3d.sm { font-size: 14px; padding: 11px 18px; box-shadow: 0 5px 0 0 var(--coral-d), 0 12px 18px -10px var(--coral); }
.btn-3d.sm:active { transform: translateY(3px); box-shadow: 0 2px 0 0 var(--coral-d); }

/* ============================================================
   TABLE
   ============================================================ */
.adm-table-host { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.adm-table-meta { font-weight: 800; font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.adm-table-scroll { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.adm-table th { text-align: left; font-size: 12px; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; padding: 8px 12px; border-bottom: 2px solid var(--line); }
.adm-table th.num, .adm-table td.num { text-align: right; }
.adm-table td { padding: 12px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; vertical-align: middle; }
.adm-table tr:hover td { background: #FFF7F2; }
.adm-table tr.is-suspended td { opacity: .6; }
.u-cell { display: flex; align-items: center; gap: 11px; }
.u-flag { font-size: 20px; }
.u-id b { display: block; font-size: 14px; }
.u-id small { color: var(--ink-faint); font-weight: 700; font-size: 12px; }
.u-actions { display: flex; gap: 6px; justify-content: flex-end; }

.status { font-weight: 800; font-size: 12px; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }
.status-active { background: #E1F7EC; color: #126B4B; }
.status-suspended { background: #FFE3DD; color: var(--coral-d); }

.row-btn { background: #fff; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 6px 12px; font-weight: 800; font-size: 13px; color: var(--ink-soft); transition: .14s; }
.row-btn:hover:not(:disabled) { border-color: var(--coral); color: var(--coral); }
.row-btn.warn:hover:not(:disabled) { border-color: var(--coral); color: var(--coral-d); background: #FFF4F1; }
.row-btn.ok:hover:not(:disabled) { border-color: var(--mint); color: #126B4B; background: #F1FBF6; }
.row-btn:disabled { opacity: .4; cursor: not-allowed; }
.adm-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }

.adm-empty { text-align: center; padding: 44px 20px; color: var(--ink-soft); }
.adm-empty-ic { font-size: 44px; margin-bottom: 8px; }
.adm-empty h3 { margin: 0 0 6px; font-size: 18px; }
.adm-empty p { margin: 0; color: var(--ink-faint); font-size: 14px; }

/* ============================================================
   CONTENT MANAGEMENT
   ============================================================ */
.content-toolbar { justify-content: space-between; }
.content-langs { display: flex; gap: 8px; flex-wrap: wrap; }
.clang { background: #fff; border: 2px solid var(--line-2); border-radius: 14px; padding: 9px 15px; font-weight: 800; font-size: 14px; color: var(--ink-soft); transition: .15s; }
.clang:hover { border-color: var(--coral); }
.clang.is-on { background: var(--coral); color: #fff; border-color: var(--coral); }
.content-body { display: flex; flex-direction: column; gap: 22px; }
.content-card { padding: 20px 22px; }

.lesson-list { display: flex; flex-direction: column; gap: 14px; }
.lesson-item { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.lesson-item-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #FFF9F6; }
.li-emoji { font-size: 26px; }
.li-meta { flex: 1; min-width: 0; }
.li-meta b { display: block; font-size: 15px; }
.li-meta small { color: var(--ink-faint); font-weight: 700; font-size: 12px; }
.li-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sentence-list { padding: 6px 16px 14px; display: flex; flex-direction: column; }
.sentence-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.sentence-row:last-child { border-bottom: 0; }
.sr-text { flex: 1; min-width: 0; }
.sr-text b { display: block; font-family: "Quicksand"; font-size: 15px; font-weight: 600; }
.sr-text small { color: var(--ink-soft); font-style: italic; font-size: 13px; }
.sr-actions { display: flex; gap: 6px; }
.sentence-empty { color: var(--ink-faint); font-size: 13px; padding: 10px 4px; font-weight: 700; }

.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card-chip { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: #FFF9F6; }
.cc-main b { font-family: "Quicksand"; font-size: 17px; }
.cc-ipa { color: var(--ink-faint); font-size: 13px; }
.cc-en { color: var(--ink-soft); font-size: 14px; margin: 4px 0 10px; font-weight: 700; }
.cc-actions { display: flex; gap: 6px; }

/* ============================================================
   MODAL
   ============================================================ */
.adm-modal-host { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; }
.adm-modal-scrim { position: fixed; inset: 0; background: rgba(42,36,56,.46); backdrop-filter: blur(5px); opacity: 0; transition: opacity .24s; }
.adm-modal-scrim.show { opacity: 1; }
.adm-modal {
  position: relative; width: min(520px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.97); opacity: 0; transition: transform .26s var(--ease), opacity .26s;
}
.adm-modal.show { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-user { display: flex; align-items: center; gap: 12px; }
.modal-flag { font-size: 30px; }
.modal-user small { color: var(--ink-faint); font-weight: 700; }
.modal-body { padding: 6px 22px 18px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.mg { background: #FFF7F2; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.mg span { display: block; font-size: 12px; color: var(--ink-faint); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mg b { font-family: "Quicksand"; font-size: 16px; }
.modal-section { margin-top: 6px; }
.modal-label { display: block; font-weight: 800; font-size: 13px; color: var(--ink-soft); margin: 12px 0 6px; }
.modal-input { width: 100%; padding: 12px 14px; border: 2px solid var(--line-2); border-radius: 14px; background: #fff; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink); }
.modal-input:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 16%, transparent); }
textarea.modal-input { resize: vertical; font-family: "Quicksand"; }
.modal-row { display: flex; gap: 12px; }
.modal-err { color: var(--coral-d); font-weight: 700; font-size: 13px; margin-top: 8px; }
.confirm-msg { color: var(--ink-soft); font-size: 15px; line-height: 1.5; margin: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 6px 22px 20px; }
.modal-foot .muted { margin-right: auto; }

.seg { display: inline-flex; background: #F4EFF8; border-radius: 12px; padding: 4px; gap: 4px; }
.seg-btn { background: transparent; border: 0; padding: 8px 18px; border-radius: 9px; font-weight: 800; font-size: 14px; color: var(--ink-soft); transition: .14s; }
.seg-btn.is-on { background: #fff; color: var(--coral-d); box-shadow: var(--shadow); }

.adm-side-scrim { position: fixed; inset: 0; background: rgba(42,36,56,.4); z-index: 25; }

/* ============================================================
   RESPONSIVE (desktop console degrades cleanly to 390px)
   ============================================================ */
@media (max-width: 1080px) {
  .kpi-grid, .kpi-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .adm-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .adm-side {
    transform: translateX(-100%); transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.adm-nav-open .adm-side { transform: none; }
  .adm-main { margin-left: 0; }
  .adm-burger { display: grid; place-items: center; }
  .adm-user { display: none; }
}
@media (max-width: 560px) {
  .kpi-grid, .kpi-grid--3, .kpi-grid--4 { grid-template-columns: 1fr; }
  .content-toolbar { flex-direction: column; align-items: stretch; }
  .adm-filters { justify-content: space-between; }
  .modal-grid { grid-template-columns: 1fr; }
  .li-actions { width: 100%; }
  .adm-topbar { padding: 12px 14px; }
  .adm-content { padding: 16px 12px; }
  .adm-card { padding: 16px; }
  .lesson-item-head { align-items: flex-start; flex-wrap: wrap; }
  .li-when { width: 100%; margin-left: 40px; }
  .lang-row-adm { grid-template-columns: 28px 1fr; }
  .lang-row-adm .lr-stat { grid-column: 2; white-space: normal; }
  .adm-nav-item, .adm-applink, .adm-logout, .adm-burger { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== Real-data admin additions ===== */
.adm-note { background: #FFF7F2; border: 1px solid #FFE0D2; color: #8A5A44; border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.lang-table { display: flex; flex-direction: column; gap: 6px; }
.lang-row-adm { display: grid; grid-template-columns: 28px 1fr auto auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card, #fff); border: 1px solid var(--line, #eee); }
.lang-row-adm .lr-flag { font-size: 20px; }
.lang-row-adm .lr-name { font-weight: 700; }
.lang-row-adm .lr-stat { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.li-when { font-size: 12px; white-space: nowrap; margin-left: auto; }
