/* ui.css — shared look for the Latanish platform pages (original teal #00a7c7, Nunito).
   Pages link it with  <link rel="stylesheet" href="ui.css">  (or ../ui.css one folder down). */
:root {
    --brand: #00a7c7; --brand-dark: #0095b3; --brand-light: #e0f7fa; --ink: #007a9b;
    --text: #1f2937; --muted: #4b5563; --border: #e5e7eb; --bg: #f4f7f6; --sidebar-width: 264px;
    --gold-bg: #fff3dc; --gold-ink: #8a4b00; --ok-bg: #ecf8f1; --ok-ink: #0a4f2e; --err-bg: #fdf0f0; --err-ink: #7f1414;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); }
body.ui-noscroll { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 3px solid rgba(0,167,199,.45); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.content-wrapper { margin-left: var(--sidebar-width); transition: margin-left .25s ease; min-height: 100vh; }
.ui-page { max-width: 1200px; margin: 0 auto; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 22px; }
.ui-page.narrow { max-width: 900px; }
.ui-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ui-head h1 { margin: 0; font-size: 32px; font-weight: 900; letter-spacing: -.01em; }
.ui-head p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.ui-kicker { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; }
.muted { color: var(--muted); }

.ui-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.ui-card h2 { margin: 0 0 12px; font-size: 20px; font-weight: 900; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 11px;
       border: 1.5px solid transparent; font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer; background: #fff; color: var(--text); }
.btn.primary { background: var(--brand); color: #fff; } .btn.primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn.outline { color: var(--ink); border-color: var(--brand); } .btn.outline:hover:not(:disabled) { background: var(--brand-light); }
.btn.ghost { color: #374151; border-color: #cfd7e0; } .btn.ghost:hover:not(:disabled) { background: #f3f4f6; }
.btn.danger { color: #b91c1c; border-color: #fecaca; } .btn.danger:hover:not(:disabled) { background: #fef2f2; }
.btn.big { height: 52px; font-size: 16px; font-weight: 900; }
.btn.small { height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: ui-spin .8s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 800; color: #374151; }
.field input, .field select, .field textarea { height: 46px; padding: 0 12px; border: 1px solid #cfd7e0; border-radius: 11px; font-size: 16px;
       font-weight: 600; color: var(--text); background: #fff; width: 100%; }
.field textarea { height: auto; padding: 12px; line-height: 1.5; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,167,199,.2); }
.field small { font-weight: 600; color: var(--muted); font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 38px; padding: 0 14px; border-radius: 99px; border: 1.5px solid #d1d5db; background: #fff; color: #374151; font-size: 14px; font-weight: 800;
        cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tag { font-size: 12px; font-weight: 900; padding: 3px 10px; border-radius: 99px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.tag.brand { background: var(--brand-light); color: #006d82; }
.tag.gold { background: var(--gold-bg); color: var(--gold-ink); }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }

.notice { border-radius: 12px; padding: 12px 16px; font-weight: 700; }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #b9e2cb; }
.notice.err { background: var(--err-bg); color: var(--err-ink); border: 1px solid #efc2c2; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); background: #fff; border: 2px dashed #cbd5e1; border-radius: 16px; }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }
.loading { padding: 50px 20px; text-align: center; color: var(--muted); font-weight: 700; }

/* Success panel after sending a form */
.success { text-align: center; padding: 40px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.success .check { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: #0a6b3d; display: flex; align-items: center; justify-content: center;
                  font-size: 32px; animation: ui-pop .4s ease-out; }
@keyframes ui-pop { 0% { transform: scale(.4); opacity: 0; } 80% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .success .check { animation: none; } }
.success h2 { margin: 6px 0 0; font-size: 28px; font-weight: 900; }
.success p { margin: 0; color: var(--muted); max-width: 460px; }
.success .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* Inbox (admin pages) */
.inbox { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.inbox-list { background: #fff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; max-height: calc(100vh - 230px); overflow-y: auto; }
.inbox-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 0; border-bottom: 1px solid #eef2f6; background: #fff;
              text-align: left; width: 100%; cursor: pointer; color: var(--text); }
.inbox-item:hover { background: #f8fafc; }
.inbox-item[aria-current="true"] { background: var(--brand-light); box-shadow: inset 4px 0 0 var(--brand); }
.inbox-item .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.inbox-item strong { font-size: 15px; }
.inbox-item .when { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.inbox-item .sub { font-size: 14px; font-weight: 700; color: #374151; }
.inbox-item .prev { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item.unread strong::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 7px; vertical-align: middle; }
.inbox-view { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 24px; min-height: 360px; position: sticky; top: 20px; }
.inbox-view h2 { margin: 0; font-size: 24px; font-weight: 900; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; }
.kpi span { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; display: block; }
.kpi strong { font-size: 28px; font-weight: 900; }
.kpi small { display: block; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.toolbar input[type=search] { height: 42px; width: 280px; max-width: 100%; padding: 0 12px; border: 1px solid #cfd7e0; border-radius: 10px; font-size: 15px; }

@media (max-width: 991px) {
    .content-wrapper { margin-left: 0; }
    .ui-page { padding: 20px 16px 40px; }
    .ui-head h1 { font-size: 26px; }
    .inbox { grid-template-columns: 1fr; }
    .inbox-list { max-height: none; }
    .inbox-view { position: static; }
}
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } .toolbar input[type=search] { width: 100%; } }

/* ===== Page banner (same style as ¡Charlemos! and Flashcards) =====
   <header class="ui-banner" data-words="hola · gracias · …">
     <div class="ui-banner-text"><span class="ui-banner-kicker">…</span><h1>…</h1><p>…</p></div>
     <div class="ui-banner-side">buttons, pills or a search field</div>
   </header> */
.ui-banner { position: relative; overflow: hidden; background: linear-gradient(135deg, #00a7c7, #007a9b); color: #fff; border-radius: 22px;
             padding: 30px 32px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.ui-banner::after { content: attr(data-words); position: absolute; right: -10px; bottom: -14px; font-size: 60px; font-weight: 900; opacity: .09;
                    white-space: nowrap; pointer-events: none; }
.ui-banner > * { position: relative; z-index: 1; }
.ui-banner-text { flex: 1 1 360px; min-width: 0; }
.ui-banner-kicker { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.ui-banner h1 { margin: 6px 0 8px; font-size: 40px; font-weight: 900; letter-spacing: -.01em; line-height: 1.1; }
.ui-banner p { margin: 0; font-size: 17px; max-width: 560px; opacity: .95; line-height: 1.5; }
.ui-banner-side { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ui-banner .bbtn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid #fff;
                   background: #fff; color: #006d82; font-size: 15px; font-weight: 900; text-decoration: none; cursor: pointer; }
.ui-banner .bbtn:hover { background: #f0fbfd; }
.ui-banner .bbtn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.ui-banner .bbtn.ghost:hover { background: rgba(255,255,255,.14); }
.ui-banner .pill { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 84px; padding: 8px 14px;
                   border-radius: 14px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); }
.ui-banner .pill strong { font-size: 22px; font-weight: 900; line-height: 1.15; }
.ui-banner .pill span { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.ui-banner :focus-visible { outline: 3px solid rgba(255,255,255,.85); outline-offset: 2px; }
@media (max-width: 991px) {
    .ui-banner { padding: 22px; border-radius: 18px; }
    .ui-banner h1 { font-size: 30px; }
    .ui-banner::after { font-size: 44px; }
}
@media (max-width: 560px) {
    .ui-banner-side { width: 100%; }
    .ui-banner .bbtn { flex: 1; justify-content: center; }
    .ui-banner .pill { flex: 1; min-width: 0; }
}
