/* Complementa o kryden.css (design system da marca) com os componentes do painel admin.
   Usa os MESMOS tokens (--accent, --card, --border, --foreground, --muted-foreground…). */

/* Mata o "quadrado branco" do foco programático no <h1> (FocusOnNavigate põe tabindex=-1). */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
::selection { background: color-mix(in oklch, var(--accent) 35%, transparent); }

/* ---- Wrapper de conteúdo ---- */
.admin { max-width: 72rem; margin: 0 auto; padding: 3rem 2rem 4.5rem; }
.admin h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin: 0 0 .35rem; letter-spacing: -.01em; }
.admin h2 { font-size: 1.35rem; margin: 2.5rem 0 .85rem; }
.page-sub { color: var(--muted-foreground); margin: .35rem 0 0; font-size: 1.02rem; max-width: 46rem; }
.muted { color: var(--muted-foreground); }

/* Eyebrow de seção (linha de acento + label), igual às referências */
.eyebrow { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; }
.eyebrow .ln { width: 2.5rem; height: 2px; background: var(--accent); border-radius: 2px; }
.eyebrow span:last-child { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.section-gap { margin-top: 3rem; }

/* ---- Cards (base — o kryden.css não define .card genérico) ---- */
.card {
    position: relative;
    background: color-mix(in oklch, var(--card) 92%, transparent);
    border: 1px solid color-mix(in oklch, var(--border) 55%, transparent);
    border-radius: var(--radius);
    padding: 1.6rem 1.7rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.admin .card { margin-bottom: 1.25rem; }
.admin .card > strong {
    display: flex; align-items: center; gap: .6rem;
    font-family: var(--font-head); font-size: 1.1rem; font-weight: 600;
    margin-bottom: .35rem;
}
.admin .card > strong::before {
    content: ""; flex: none; width: 3px; height: 1.1rem;
    background: var(--accent); border-radius: 2px;
}

/* ---- Cards de projeto (reusa o .app-card do kryden.css) ---- */
.app-grid { margin-top: 1.25rem; }
.app-logo .logo-initial { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; color: var(--accent); line-height: 1; }
.app-card-foot .btn { flex: none; }
/* Status fixado à direita e alinhado à linha do DOMÍNIO (não centralizado no card).
   Domínio fica na linha cheia, sem truncar. Bolinhas idênticas ao KrydenStore. */
.app-card-head .status { flex: none; align-self: flex-end; margin-bottom: .1rem; }

/* ---- Hero (emblema Y) ---- */
.hero-emblem { width: 6.5rem; height: 6.5rem; filter: drop-shadow(0 8px 24px rgba(0,0,0,.45)); }

/* ---- Cards de sala ---- */
.sala-list { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
.sala-card {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: color-mix(in oklch, var(--card) 92%, transparent);
    border: 1px solid color-mix(in oklch, var(--border) 55%, transparent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: border-color .2s ease;
}
.sala-card:hover { border-color: color-mix(in oklch, var(--accent) 45%, transparent); }
.sala-card .sala-info { min-width: 0; flex: 1; }
.sala-card .sala-name { font-weight: 600; }
.sala-card .sala-actions { display: flex; align-items: center; gap: 1rem; flex: none; }
.sala-card.off { opacity: .6; }

/* ---- Formulário ---- */
label { display: block; font-size: .8rem; color: var(--muted-foreground); margin: 1rem 0 .4rem; font-weight: 500; }
.input, textarea, select {
    width: 100%;
    background: var(--black-base);
    border: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
    border-radius: var(--radius-md);
    color: var(--foreground);
    padding: .7rem .85rem;
    font-family: var(--font-body);
    font-size: .95rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 180px; line-height: 1.55; font-family: var(--font-mono); font-size: .9rem; }
.input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 16%, transparent);
}
.input::placeholder, textarea::placeholder { color: var(--text-muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.4rem; }
.form-grid .col-full { grid-column: 1 / -1; }
.form-grid label { margin-top: .65rem; }

.btn-row { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; }

/* ---- Misc ---- */
.row-line { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.tag { font-size: .68rem; color: var(--muted-foreground); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; text-transform: uppercase; letter-spacing: .04em; }
.swatch { width: 16px; height: 16px; border-radius: 5px; display: inline-block; border: 1px solid color-mix(in oklch, var(--border) 80%, transparent); vertical-align: middle; box-shadow: 0 0 0 3px color-mix(in oklch, var(--card) 60%, transparent); }
.toggle { display: inline-flex; gap: .5rem; align-items: center; font-size: .9rem; color: var(--foreground); margin: 0; }
.toggle input { width: auto; accent-color: var(--accent); }
.code { font-family: var(--font-mono); color: var(--muted-foreground); font-size: .82rem; }
.hint { color: var(--text-muted); font-size: .8rem; margin: .6rem 0 0; }

.alert { border-radius: var(--radius-md); padding: .7rem .85rem; margin: 1rem 0 0; border: 1px solid var(--border); font-size: .9rem; }
.alert-ok { border-color: color-mix(in oklch, #4ec77a 50%, transparent); color: #4ec77a; background: color-mix(in oklch, #4ec77a 8%, transparent); }
.alert-err { border-color: color-mix(in oklch, #e0564f 50%, transparent); color: #e0564f; background: color-mix(in oklch, #e0564f 8%, transparent); }

/* ---- Tabela (dentro de um .card vira "painel") ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .8rem .65rem; border-bottom: 1px solid color-mix(in oklch, var(--border) 40%, transparent); font-size: .9rem; vertical-align: middle; }
thead th { color: var(--muted-foreground); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: color-mix(in oklch, var(--secondary) 22%, transparent); }
tbody tr:last-child td { border-bottom: none; }
/* Barra de acento vertical à esquerda da linha no hover (valida a linha selecionada). */
tbody td:first-child { border-left: 3px solid transparent; }
tbody tr:hover td:first-child { border-left-color: var(--accent); }

/* ---- Pré-visualização (bolha estilo Discord) ---- */
.preview { background: #2b2d31; border: 1px solid #1f2023; border-radius: var(--radius); padding: .95rem 1.1rem; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.preview.embed { border-left: 4px solid var(--accent); }
.embed-title { font-family: var(--font-body); font-weight: 600; color: #fff; margin-bottom: .35rem; }

/* Markdown renderizado (aproxima o visual do Discord) */
.md-body { color: #dbdee1; line-height: 1.5; font-size: .95rem; word-break: break-word; }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body h1 { font-size: 1.5rem; font-weight: 700; margin: .5rem 0 .25rem; font-family: var(--font-body); line-height: 1.3; }
.md-body h2 { font-size: 1.25rem; font-weight: 700; margin: .5rem 0 .25rem; font-family: var(--font-body); line-height: 1.3; }
.md-body h3 { font-size: 1.05rem; font-weight: 700; margin: .5rem 0 .25rem; font-family: var(--font-body); line-height: 1.3; }
.md-body p { margin: .35rem 0; }
.md-body strong { font-weight: 700; color: #fff; }
.md-body em { font-style: italic; }
.md-body del { text-decoration: line-through; opacity: .85; }
.md-body a { color: #00a8fc; text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body ul, .md-body ol { margin: .35rem 0; padding-left: 1.4rem; }
.md-body li { margin: .15rem 0; }
.md-body blockquote { border-left: 4px solid #4e5058; margin: .35rem 0; padding: .1rem 0 .1rem .8rem; color: #dbdee1; }
.md-body code { background: #1e1f22; border-radius: 4px; padding: .1rem .3rem; font-family: var(--font-mono); font-size: .85em; }
.md-body pre { background: #1e1f22; border: 1px solid #2b2d31; border-radius: 5px; padding: .6rem .8rem; overflow-x: auto; margin: .35rem 0; }
.md-body pre code { background: none; padding: 0; }
.md-body hr { border: none; border-top: 1px solid #3f4147; margin: .6rem 0; }

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .admin { padding: 2rem 1.25rem 3rem; }
}
