/* AINA admin — light surface from the Brand Book (documents) */
:root {
  --bg: #F3F6F4;
  --card: #FFFFFF;
  --field: #F3F6F4;
  --field-line: #E1E8E4;
  --text: #050B09;
  --text-2: #4A5A53;
  --forest: #071B15;
  --emerald: #00C98D;
  --emerald-ink: #008F63;
  --mint: #4FFFC3;
  --soft: #E3F7EF;
  --danger: #C2412D;
  --danger-soft: #FCEBE7;
  --r: 12px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
a { color: var(--emerald-ink); }
code { font-size: 13px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--forest); color: #fff; }
.top__inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand em { font-style: normal; font-weight: 500; color: #B8C5BF; }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 999px; color: #B8C5BF; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; transition: color 120ms var(--ease), background-color 120ms var(--ease); }
.tabs a:hover { color: #fff; }
.tabs a.on { background: rgba(255, 255, 255, .1); color: #fff; }
.top__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top .btn--soft { background: rgba(0, 201, 141, .16); color: var(--mint); }
.top .btn--ghost { color: #B8C5BF; border-color: rgba(184, 197, 191, .3); }

.page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 96px; }
.head { margin-bottom: 24px; }
.head h1 { font-size: 32px; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 6px; }
.head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.group-title { font-size: 22px; letter-spacing: -0.02em; margin: 40px 0 4px; }
.group-sub { margin-bottom: 16px; }

/* Cards */
.card { background: var(--card); border-radius: 24px; padding: 28px 32px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(5, 11, 9, .04); border: 1px solid #E8EEEA; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.card__head h2 { font-size: 20px; letter-spacing: -0.01em; margin-bottom: 4px; }
.card--driver .card__head h2 { color: var(--forest); }
.card--client .card__head h2 { color: var(--emerald-ink); }
.card__foot { display: flex; justify-content: flex-end; margin-top: 24px; gap: 12px; }
.card__foot--split { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.card--fold { padding: 0; }
.card--fold summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px; cursor: pointer; }
.card--fold summary::-webkit-details-marker { display: none; }
.card--fold summary h2 { font-size: 18px; }
.card--fold summary::after { content: "+"; font-size: 22px; color: var(--text-2); margin-left: 12px; }
.card--fold[open] summary::after { content: "–"; }
.card--fold form { padding: 0 32px 28px; border-top: 1px solid #EEF2EF; padding-top: 20px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-bottom: 0; }
.field > span { color: var(--text-2); font-size: 14px; font-weight: 500; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--field-line); border-radius: var(--r); padding: 12px 16px; transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease), background-color 120ms var(--ease); }
input:focus, textarea:focus { outline: none; border-color: var(--emerald); background: #fff; box-shadow: 0 0 0 3px rgba(0, 201, 141, .15); }
textarea { resize: vertical; line-height: 1.5; }
textarea.md { font: 13px/1.6 ui-monospace, "SF Mono", Menlo, monospace; }

.tfield { padding: 16px 0; border-bottom: 1px solid #EEF2EF; }
.tfield:last-of-type { border-bottom: 0; }
.tfield__label { font-weight: 600; margin-bottom: 10px; font-size: 14px; }
.tfield__langs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tfield .field { margin-top: 12px; }
.lang-input { position: relative; display: block; }
.lang-input input, .lang-input textarea { padding-left: 52px; }
.lang-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--emerald-ink); background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.lang-input .lang-tag { position: absolute; left: 10px; top: 12px; }

/* OG image + file input */
.og { display: flex; gap: 16px; align-items: center; margin-top: 4px; }
.og__img { width: 156px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 12px; background: var(--forest); flex: none; }
.og > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.file { position: relative; display: inline-flex; align-items: center; background: var(--field); border-radius: var(--r); overflow: hidden; max-width: 100%; cursor: pointer; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file__btn { padding: 10px 16px; background: var(--soft); color: var(--emerald-ink); font-weight: 700; white-space: nowrap; }
.file__name { padding: 10px 16px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file:focus-within { box-shadow: 0 0 0 3px rgba(0, 201, 141, .25); }
.file--small { font-size: 13px; width: 100%; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 22px; border-radius: 14px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; transition: background-color 120ms var(--ease), border-color 120ms var(--ease), transform 120ms var(--ease); }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--emerald); color: var(--text); font-size: 16px; padding: 0 28px; height: 52px; }
.btn--primary:hover { background: var(--mint); }
.btn--soft { background: var(--soft); color: var(--emerald-ink); }
.btn--soft:hover { background: #D2F1E5; }
.btn--ghost { background: transparent; border-color: var(--field-line); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { height: 36px; padding: 0 14px; font-size: 13px; }
.top .btn { height: 38px; padding: 0 14px; font-size: 13px; }
.top form { margin: 0; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--field-line); background: #fff; cursor: pointer; font: inherit; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* Flash */
.flash { padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-weight: 600; }
.flash--ok { background: var(--soft); color: var(--emerald-ink); }
.flash--error { background: var(--danger-soft); color: var(--danger); }

/* Login */
.login { max-width: 400px; margin: 8vh auto 0; text-align: center; }
.login__mark { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 22%; background: var(--forest); display: grid; place-items: center; }
.login h1 { font-size: 28px; letter-spacing: -0.02em; }
.login .muted { margin-bottom: 24px; }
.login__card { text-align: left; display: grid; gap: 16px; padding: 28px; }

/* Images */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.shot { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.shot__img { width: 100%; aspect-ratio: 604 / 1310; object-fit: cover; border-radius: 18px; background: var(--forest); }
.shot__label { font-weight: 600; font-size: 14px; }
.shot .btn--primary { height: 42px; font-size: 14px; }

/* Legal */
.docs { list-style: none; margin: 0; padding: 0; }
.docs__item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #EEF2EF; flex-wrap: wrap; }
.docs__n { color: var(--emerald-ink); font-weight: 800; width: 22px; }
.docs__title { font-weight: 700; color: var(--text); text-decoration: none; }
.docs__title:hover { color: var(--emerald-ink); }
.docs__move { margin: 0 0 0 auto; display: flex; gap: 4px; }
.docs__new { display: grid; grid-template-columns: 2fr 1.4fr auto; gap: 16px; align-items: end; margin-top: 20px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #EEF2EF; color: var(--text-2); }
.badge--ok { background: var(--soft); color: var(--emerald-ink); }
.langs-done { display: flex; gap: 4px; }
.lang-dot { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #F1F3F2; color: #A0ACA6; }
.lang-dot.on { background: var(--soft); color: var(--emerald-ink); }
.ltabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid #EEF2EF; }
.ltab { font: inherit; font-weight: 700; padding: 10px 16px; border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-2); }
.ltab.on { color: var(--text); border-bottom-color: var(--emerald); }
.lpane .field { margin-top: 16px; }
.help { margin-top: 16px; }
.help summary { cursor: pointer; font-weight: 600; color: var(--emerald-ink); }
.help pre { background: var(--field); border-radius: var(--r); padding: 14px 16px; font-size: 13px; overflow-x: auto; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { width: 46px; height: 28px; border-radius: 999px; background: #D5DED9; position: relative; transition: background-color 200ms var(--ease); flex: none; }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform 200ms var(--ease); }
.switch input:checked + .switch__ui { background: var(--emerald); }
.switch input:checked + .switch__ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--emerald); outline-offset: 2px; }
.actions { display: flex; gap: 12px; }
.danger { display: flex; justify-content: flex-end; }

/* History */
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid #EEF2EF; }
.history li:last-child { border-bottom: 0; }
.history form { margin: 0; }

@media (max-width: 900px) {
  .top__inner { gap: 12px; padding: 0 16px; }
  .brand span { display: none; }
  .top .btn--soft { display: none; }
  .page { padding: 24px 16px 80px; }
  .card { padding: 20px; border-radius: 20px; }
  .card--fold summary { padding: 18px 20px; }
  .card--fold form { padding: 16px 20px 20px; }
  .grid2, .tfield__langs, .docs__new { grid-template-columns: 1fr; }
  .card__foot .btn--primary { width: 100%; }
  .og { flex-direction: column; align-items: flex-start; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
}
