/* Falline admin panel: the app's dark language (Mobile-IOS/Falline/DesignSystem/Theme.swift). */
@font-face { font-family: "Anton"; src: url("/static/anton.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/jetbrains-mono.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0B0B0C; --surface: #1A1A1C; --surface-2: #232326; --line: #333333;
  --text: #F4F4EF; --muted: #9A9A93;
  --accent: #C6FF00; --accent-2: #FF5A1F;
  --ok: #3DDC97; --warn: #FFC53D; --danger: #FF3B5C;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --head: "Anton", Impact, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 12px; }
h1 { font-size: 30px; }
h2 { font-size: 20px; margin-top: 28px; }
h3 { font-size: 16px; }
.num, .mono, code { font-family: var(--mono); }
.muted { color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .danger { color: var(--danger); }

/* Layout: menu on the left, content on the right; on a phone the menu opens from the top. */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.nav { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: var(--head); font-size: 24px; color: var(--accent); letter-spacing: .04em; padding: 0 10px 14px; display: block; }
.brand small { display: block; font: 11px var(--mono); color: var(--muted); letter-spacing: 0; text-transform: none; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li a, .nav li span { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.nav li a:hover { background: var(--surface-2); text-decoration: none; }
.nav li a.active { background: var(--accent); color: #0B0B0C; font-weight: 600; }
.nav li span.soon { color: var(--muted); cursor: default; }
.nav .group { font: 11px var(--mono); color: var(--muted); text-transform: uppercase; margin: 18px 10px 6px; }
.nav .badge { font: 12px var(--mono); background: var(--accent-2); color: #0B0B0C; border-radius: 10px; padding: 0 7px; }
.nav li a.active .badge { background: #0B0B0C; color: var(--accent); }
.nav .tag-soon { font: 10px var(--mono); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.nav form { margin: 18px 10px 0; }
.menu-toggle { display: none; }
main { padding: 24px 28px 60px; min-width: 0; }

/* Panels, numbers, forms */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: block; color: var(--text); }
a.card:hover { border-color: var(--accent); text-decoration: none; }
.card .label { color: var(--muted); font-size: 12px; }
.card .value { font: 28px/1.2 var(--mono); margin-top: 4px; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card.alert { border-color: var(--danger); }
.card.alert .value { color: var(--danger); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.toolbar label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
input, select, textarea, button { font: inherit; color: var(--text); }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=number], input[type=email], input[type=url], select, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { width: 100%; min-height: 70px; resize: vertical; }
.btn, button { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; white-space: nowrap; display: inline-block; color: var(--text); }
.btn:hover, button:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: #0B0B0C; font-weight: 600; }
.btn.danger, button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.small, button.small { padding: 3px 8px; font-size: 12px; }
.inline { display: inline; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { border-color: var(--ok); color: var(--ok); }
.flash.error { border-color: var(--danger); color: var(--danger); }
.flash.warn { border-color: var(--warn); color: var(--warn); }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-color: var(--accent); }
.tag { display: inline-block; font: 11px var(--mono); border-radius: 6px; padding: 1px 6px; border: 1px solid var(--line); color: var(--muted); }
.tag.sample { border-color: var(--accent-2); color: var(--accent-2); }
.tag.pending, .tag.open { border-color: var(--warn); color: var(--warn); }
.tag.published, .tag.fixed, .tag.removed { border-color: var(--ok); color: var(--ok); }
.tag.rejected, .tag.dismissed { border-color: var(--muted); }
.tag.draft-lang { border-color: var(--warn); color: var(--warn); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.card .value.smaller { font-size: 18px; }
meter { width: 120px; height: 8px; vertical-align: middle; }
meter::-webkit-meter-bar { background: var(--surface-2); border: 0; border-radius: 4px; }
meter::-webkit-meter-optimum-value { background: var(--accent); border-radius: 4px; }
meter::-moz-meter-bar { background: var(--accent); }

/* Tables: dense but readable; on a phone each row becomes a card. */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 11px var(--mono); text-transform: uppercase; color: var(--muted); font-weight: 400; }
tr:hover td { background: rgba(255,255,255,.02); }
td.wrap { white-space: pre-wrap; word-break: break-word; }
td .cell-text { white-space: pre-wrap; word-break: break-word; max-width: 520px; }
.thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); }
.text-row textarea { min-height: 38px; font-size: 13px; }
.text-row .state { font-size: 12px; }

/* Preview of an entry as the app shows it */
.post-card { max-width: 380px; background: var(--surface-2); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.post-card img.cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--bg); }
.post-card .body { padding: 12px 14px; }
.post-card .kind { font: 11px var(--mono); color: var(--accent); text-transform: uppercase; }
.post-card h3 { font-size: 22px; margin: 4px 0 6px; text-transform: none; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery img { width: 140px; height: 96px; object-fit: cover; border-radius: 8px; }

/* Confirmation window */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 20px; max-width: 460px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog p { white-space: pre-wrap; margin-top: 0; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.login { max-width: 360px; margin: 12vh auto; padding: 0 16px; }
.login .brand { padding: 0 0 18px; font-size: 34px; }
.login .field input { width: 100%; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .nav .brand { display: inline-block; padding: 4px 10px; }
  .menu-toggle { display: inline-block; float: right; }
  .nav .menu { display: none; }
  .nav.open .menu { display: block; }
  main { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  table.cards-on-phone thead { display: none; }
  table.cards-on-phone, table.cards-on-phone tbody, table.cards-on-phone tr, table.cards-on-phone td { display: block; width: 100%; }
  table.cards-on-phone tr { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 6px 4px; }
  table.cards-on-phone td { border: 0; padding: 4px 10px; }
  table.cards-on-phone td[data-label]::before { content: attr(data-label); display: block; font: 10px var(--mono); color: var(--muted); text-transform: uppercase; }
  .toolbar > * { flex: 1 1 140px; }
  h1 { font-size: 26px; }
}
