/* WorkRadar: one stylesheet for the public site (mobile-first), the partner cabinet and the Back Office. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5f6b7a;
  --border: #dde2e8;
  --brand: #0b6e4f;
  --brand-dark: #08553d;
  --brand-soft: #e3f3ec;
  --accent: #f2a541;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff6e0;
  --info-soft: #e8f1fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.right { text-align: right; }
.hidden { display: none !important; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.site-header .container { display: flex; align-items: center; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.2rem; color: var(--brand); text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--accent); }
.header-nav { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.header-nav a { text-decoration: none; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a { padding: 4px 8px; border-radius: 6px; font-size: .85rem; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
.lang-switch a.active { border-color: var(--border); color: var(--text); font-weight: 600; }

/* ---------- buttons & forms ---------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: var(--surface); color: var(--brand); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn.whatsapp { background: #1f9d55; border-color: #1f9d55; }
.btn.telegram { background: #2a8bd1; border-color: #2a8bd1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline { display: inline; }

label { display: block; font-weight: 600; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 2px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.error-text { color: var(--danger); font-size: .875rem; margin-top: 4px; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- alerts ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius); margin: 12px 0; border: 1px solid transparent; }
.alert.success { background: var(--brand-soft); border-color: #b9e2cf; }
.alert.error { background: var(--danger-soft); border-color: #f5c2bd; }
.alert.warn { background: var(--warn-soft); border-color: #f3dca7; }
.alert.info { background: var(--info-soft); border-color: #c7dcf3; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ---------- public: search ---------- */
.hero { padding: 16px 0 4px; }
.search-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.search-form .row { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) {
  .search-form .row { grid-template-columns: 2fr 1fr 1.5fr 1.5fr; align-items: end; }
}
.search-form .field { margin-bottom: 0; }
.search-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.search-actions .checkbox { margin: 0 auto 0 0; align-items: center; }

.tabs { display: flex; gap: 4px; margin: 16px 0 8px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

.vacancy-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 900px) { .vacancy-list { grid-template-columns: 1fr 1fr; } }
.vcard { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.vcard:hover { border-color: var(--brand); }
.vcard .title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.vcard .pay { font-weight: 700; color: var(--brand); font-size: 1.05rem; }
.vcard .meta { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef1f4; color: var(--text); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--brand-soft); color: var(--brand-dark); }
.badge.orange { background: var(--warn-soft); color: #8a5a00; }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--info-soft); color: #1d4f8a; }

#map { height: calc(100vh - 260px); min-height: 380px; border-radius: var(--radius); border: 1px solid var(--border); background: #e9edf1; }
.map-popup .t { font-weight: 700; margin-bottom: 2px; }
.map-popup .p { color: var(--brand); font-weight: 700; }

.pager { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; gap: 8px; }

.cta { background: var(--brand-soft); border: 1px solid #b9e2cf; border-radius: var(--radius); padding: 16px; margin: 20px 0; }

/* ---------- public: vacancy page ---------- */
.vacancy-head .pay { font-size: 1.5rem; font-weight: 800; color: var(--brand); margin: 6px 0; }
.facts { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.facts .k { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.facts .v { font-weight: 600; }
.layout-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .layout-2 { grid-template-columns: 3fr 2fr; align-items: start; } .sticky { position: sticky; top: 72px; } }

.site-footer { margin-top: 40px; padding: 24px 0; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .9rem; }
.site-footer a { color: var(--muted); }

/* ---------- Back Office / partner ---------- */
.app-header { background: #14212b; color: #fff; }
.app-header .container { display: flex; align-items: center; gap: 16px; min-height: 52px; flex-wrap: wrap; max-width: 1400px; }
.app-header .logo { color: #fff; }
.app-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.app-nav a { color: #c9d4de; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .92rem; }
.app-nav a:hover, .app-nav a.active { background: #22323f; color: #fff; }
.app-user { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: .9rem; color: #c9d4de; }
.app-user a { color: #c9d4de; }
.app-user button { background: none; border: 1px solid #3a4b59; color: #c9d4de; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-family: inherit; }
.app-main { max-width: 1400px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: #f0f3f6; font-weight: 600; white-space: nowrap; font-size: .85rem; color: var(--muted); }
table.data tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data tfoot td { font-weight: 700; background: #f8fafb; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.filters .field { margin: 0; min-width: 160px; }
.filters input, .filters select { min-height: 38px; padding: 6px 10px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.kpi .v { font-size: 1.5rem; font-weight: 800; }
.kpi .k { color: var(--muted); font-size: .85rem; }
.cols { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1000px) { .cols { grid-template-columns: 2fr 1fr; } .cols.even { grid-template-columns: 1fr 1fr; } }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; font-weight: 500; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--muted); font-size: .8rem; }
.timeline .src { font-size: .75rem; }

.copy-block { position: relative; background: #f8fafb; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; white-space: pre-wrap; font-family: inherit; }
.copy-block .copy-btn { position: absolute; top: 6px; right: 6px; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos figure { margin: 0; width: 140px; }
.photos img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: #eef1f4; }
.status.DRAFT { background: #eef1f4; }
.status.SUBMITTED, .status.PENDING_REVIEW, .status.ISSUED, .status.OPEN, .status.STAFFING, .status.NEW { background: var(--info-soft); color: #1d4f8a; }
.status.IN_PROGRESS, .status.PUBLISHED, .status.CONTACTED { background: var(--brand-soft); color: var(--brand-dark); }
.status.FULFILLED, .status.COMPLETED, .status.PAID, .status.PROCESSED, .status.CONFIRMED, .status.SHOWED_UP { background: #dff5e6; color: #146c2e; }
.status.CLOSED, .status.DEACTIVATED, .status.CANCELLED, .status.REJECTED, .status.NO_SHOW, .status.PAUSED { background: #f1f1f1; color: #555; }
.status.DISPUTED, .status.overdue { background: var(--danger-soft); color: var(--danger); }

.login-box { max-width: 380px; margin: 60px auto; }

@media print {
  .app-header, .no-print, .site-header, .site-footer { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
}

/* ---------- test-mode banner ---------- */
.test-banner { background: var(--warn-soft); border-bottom: 1px solid #f0d58c; color: #6b4e00; font-size: .9rem; line-height: 1.4; }
.test-banner .container { padding-top: 8px; padding-bottom: 8px; }
.test-banner strong { margin-right: 4px; }
