/* Админка Expatóll — в стиле сайта: светлый фон, лагуна, латунь, Sofia Sans + логотип Cormorant. */
@font-face { font-family: 'Sofia Sans'; font-weight: 400; font-display: swap; src: url('/admin/fonts/sofia-sans-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sofia Sans'; font-weight: 600; font-display: swap; src: url('/admin/fonts/sofia-sans-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sofia Sans'; font-weight: 400; font-display: swap; src: url('/admin/fonts/sofia-sans-cyrillic-400.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Sofia Sans'; font-weight: 600; font-display: swap; src: url('/admin/fonts/sofia-sans-cyrillic-600.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url('/admin/fonts/cormorant-600.woff2') format('woff2'); }

:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --soft: #eef4f2;
  --line: #e0e8e5;
  --ink: #172022;
  --muted: #5b6869;
  --deep: #1f4a4b;
  --deep-2: #285657;
  --on-deep: #eef4f2;
  --on-deep-muted: #b7cbc7;
  --accent: #8c6a3c;
  --accent-soft: #f4ece0;
  --ok: #2f7a5f;
  --ok-soft: #e5f2ec;
  --warn: #9a6a12;
  --warn-soft: #fbf1dc;
  --err: #b4462b;
  --err-soft: #fbe9e4;
  --info: #2f6e69;
  --info-soft: #e3f0ee;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 32, 34, 0.04), 0 6px 18px rgba(23, 32, 34, 0.05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 'Sofia Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--info); }

/* ─── каркас ─────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px; padding: 24px 16px; background: var(--deep); color: var(--on-deep); }
.brand { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 0 10px; }
.brand .logo { font-family: 'Cormorant Garamond', Garamond, serif; font-weight: 600; font-size: 30px; line-height: 1; letter-spacing: 0.01em; }
.brand .anchor { color: #d3b27e; font-size: 16px; }
.brand small { width: 100%; color: var(--on-deep-muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
#tabs { display: flex; flex-direction: column; gap: 4px; }
#tabs button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--on-deep-muted); font: inherit; font-size: 15px; text-align: left; cursor: pointer; transition: background 0.15s, color 0.15s; }
#tabs button:hover { background: rgba(255, 255, 255, 0.07); color: var(--on-deep); }
#tabs button.on { background: var(--on-deep); color: var(--deep); font-weight: 600; }
#tabs svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#tabs span { flex: 1; }
.count { min-width: 22px; padding: 0 7px; border-radius: 999px; background: #d3b27e; color: #1f2a2b; font-size: 12px; font-weight: 600; line-height: 22px; text-align: center; }
.side-foot { margin-top: auto; padding: 0 10px; }
.side-foot .ghost { color: var(--on-deep-muted); border-color: rgba(255, 255, 255, 0.18); }
.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 48px; max-width: 1240px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; }

/* ─── вход ───────────────────────────────────────────── */
.login { grid-column: 1 / -1; max-width: 400px; margin: 12vh auto 0; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.app:has(#side[hidden]) { grid-template-columns: 1fr; }
.login .brand { padding: 0; color: var(--deep); margin-bottom: 18px; }
.login .brand .logo { font-size: 40px; }
.login .brand .anchor { color: var(--accent); }
.login h1 { font-size: 20px; margin: 0 0 16px; }
.login form { display: grid; gap: 14px; }

/* ─── элементы ───────────────────────────────────────── */
h2 { font-size: 19px; margin: 0 0 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
button { font: inherit; font-weight: 600; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--deep); background: var(--deep); color: #fff; cursor: pointer; transition: opacity 0.15s, background 0.15s, border-color 0.15s; }
button:hover { opacity: 0.9; }
button.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 400; }
button.ghost:hover { border-color: var(--ink); opacity: 1; }
button.small { min-height: 34px; padding: 0 14px; font-size: 14px; }
input, select, textarea { font: inherit; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 3px rgba(31, 74, 75, 0.12); }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 14px 0; }
.wide { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 18px 0; padding: 14px 18px; background: var(--surface); }
legend { font-weight: 600; padding: 0 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink); cursor: pointer; }
.checks label:has(input:checked) { background: var(--info-soft); border-color: var(--info); }
.checks input { width: auto; min-height: 0; accent-color: var(--deep); }
.toolbar { display: grid; gap: 10px; grid-template-columns: minmax(200px, 2fr) repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; align-items: center; }
.toolbar input[type='search'] { padding-left: 38px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235b6869' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 12px center; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--err); white-space: pre-wrap; margin: 6px 0 0; }
.ok { color: var(--ok); margin: 6px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 18px 0; color: var(--muted); }
pre { background: #18302f; color: #d7e7e3; padding: 14px; border-radius: 12px; overflow: auto; max-height: 420px; font-size: 12px; white-space: pre-wrap; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; }

/* ─── плитки-счётчики ────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 400; text-align: left; box-shadow: var(--shadow); }
.tile b { font-size: 28px; line-height: 1.1; font-weight: 600; }
.tile span { font-size: 13px; color: var(--muted); }
.tile.on { border-color: var(--deep); box-shadow: 0 0 0 2px rgba(31, 74, 75, 0.15); }
.tile.t-new b { color: var(--accent); }
.tile.t-in-progress b { color: var(--info); }
.tile.t-done b { color: var(--ok); }

/* ─── заявки ─────────────────────────────────────────── */
.cards { display: grid; gap: 12px; }
.req { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.req.s-new { border-left: 4px solid var(--accent); }
.req.s-spam, .req.s-archived { opacity: 0.6; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 17px; color: var(--deep); background: var(--info-soft); }
.req.k-employer .avatar { background: var(--accent-soft); color: var(--accent); }
.req-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.req-head strong { font-size: 16px; }
.req-head time { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); }
.pill.k-employer { background: var(--accent-soft); color: var(--accent); }
.pill.k-service { background: var(--info-soft); color: var(--info); }
.pill.st-new { background: var(--warn-soft); color: var(--warn); }
.pill.st-in-progress { background: var(--info-soft); color: var(--info); }
.pill.st-done { background: var(--ok-soft); color: var(--ok); }
.pill.st-spam { background: var(--err-soft); color: var(--err); }
.req dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 14px; margin: 12px 0; font-size: 14px; }
.req dt { color: var(--muted); }
.req dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--soft); }
.seg button { min-height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-weight: 400; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(23, 32, 34, 0.12); }
.req-note { display: flex; gap: 8px; margin-top: 10px; }
.req-note input { min-height: 38px; }
.btn-tg { background: #2a8bd1; border-color: #2a8bd1; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 14px; }
.btn-mail { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* ─── таблицы ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { position: sticky; top: 0; background: var(--soft); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { white-space: normal; min-width: 240px; }
tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: #f7faf9; }
.badge { display: inline-flex; height: 22px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.v-verified { background: var(--ok-soft); color: var(--ok); }
.v-partial { background: var(--info-soft); color: var(--info); }
.v-needs-check { background: var(--warn-soft); color: var(--warn); }
.hidden-row { opacity: 0.5; }
tbody td select { min-height: 32px; padding: 3px 8px; width: auto; }

/* ─── формы отеля и стран ────────────────────────────── */
.source-row, .country-row { display: grid; gap: 8px; grid-template-columns: 1.4fr 2fr 150px auto; margin-bottom: 8px; }
.country-row { grid-template-columns: 110px 1fr 1fr 70px 90px 90px auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.jobs { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.jobs label { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: center; font-size: 13px; color: var(--ink); padding: 4px 0; }
.jobs select { min-height: 30px; padding: 2px 6px; width: 120px; }
.images { display: flex; flex-wrap: wrap; gap: 12px; }
.images figure { margin: 0; width: 180px; font-size: 12px; }
.images img { width: 180px; height: 120px; object-fit: cover; border-radius: 10px; }
#v-form { margin: 0 0 16px; }

/* ─── телефон: меню снизу ────────────────────────────── */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; inset: auto 0 0 0; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 0; box-shadow: 0 -6px 20px rgba(23, 32, 34, 0.15); }
  .side .brand, .side-foot { display: none; }
  #tabs { flex-direction: row; width: 100%; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  #tabs button { width: auto; flex: 1 0 auto; min-width: 58px; flex-direction: column; gap: 2px; justify-content: center; min-height: 54px; padding: 4px 6px; font-size: 11.5px; text-align: center; position: relative; }
  #tabs button.on { background: rgba(255, 255, 255, 0.12); color: #fff; }
  #tabs span { flex: none; }
  #tabs .count { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 18px; line-height: 18px; padding: 0 5px; font-size: 11px; }
  .main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 25px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px 14px; }
  .tile b { font-size: 24px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar input[type='search'] { grid-column: 1 / -1; }
  .req { grid-template-columns: 1fr; padding: 16px; }
  .avatar { display: none; }
  .req-head time { margin-left: 0; width: 100%; }
  .req dl { grid-template-columns: 96px minmax(0, 1fr); font-size: 13.5px; }

  .req-note { flex-direction: column; }
  .seg { flex-wrap: wrap; border-radius: 14px; }
  .source-row, .country-row { grid-template-columns: 1fr; }
  .login { margin-top: 8vh; }
}
