:root {
  --bg: #ffffff;
  --card: #ffffff;
  --card2: #f7f7f7;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --ok: #0f766e;
  --ok-bg: #ccfbf1;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: 17px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background:
    radial-gradient(circle at 12px 12px, #f3f4f6 2px, transparent 0) 0 0/24px 24px,
    var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { letter-spacing: -0.02em; }
h2 { font-size: 1.55rem; margin: 0 0 12px; }
h3 { font-size: 1.15rem; margin: 0 0 10px; }

.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.pagehead__title { margin: 0; }

.container { width: min(1280px, calc(100% - 44px)); margin: 0 auto; }

.header {
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.header__row { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; }
.brand__link { color: var(--text); font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.brand__logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.brand__text { white-space: nowrap; font-size: 1.22rem; }
.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--text); }
.nav a:hover { color: #1d4ed8; text-decoration: none; }
.navmenu { position: relative; }
.navmenu summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.navmenu__icon { font-size: 1rem; line-height: 1; }
.navmenu__label { line-height: 1; }
.navmenu summary::-webkit-details-marker { display: none; }
.navmenu[open] summary { border-color: #bfdbfe; background: #f8fbff; }
.navmenu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(17,24,39,0.12);
  padding: 8px;
  display: grid;
  gap: 2px;
  z-index: 30;
}
.navmenu__panel a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.navmenu__panel a:hover { background: #f3f4f6; color: #1d4ed8; }
.navmenu__i {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}
.navmenu__i svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lang { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.lang a { color: var(--muted); font-weight: 700; }
.lang__active { color: var(--text) !important; text-decoration: underline; }

.footer { border-top: 1px solid var(--line); margin-top: 18px; padding: 8px 0; color: var(--muted); }
.footer__row { display: flex; justify-content: space-between; }

main.container {
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.05);
}
.card { overflow: hidden; }
.card--nested {
  background: var(--card2);
  margin: 12px 0;
}

.hero {
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.hero h1 { margin: 0 0 12px; font-size: 2.3rem; line-height: 1.14; }
.hero__top { display: flex; gap: 18px; align-items: center; margin-bottom: 10px; }
.hero__logo { width: 84px; height: 84px; border-radius: 16px; border: 1px solid #dbeafe; object-fit: cover; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15); }
.hero__badges { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; }
.row--space { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.right { text-align: right; }

.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .grid--2 { grid-template-columns: 1fr; }
  .right { text-align: left; }
  .hero h1 { font-size: 28px; }
  .hero__top { align-items: flex-start; flex-direction: column; }
  .hero__logo { width: 64px; height: 64px; border-radius: 12px; }
  .nav { gap: 8px; }
  .lang { padding: 5px 8px; }
  .navmenu__panel {
    left: auto;
    right: 0;
    min-width: 190px;
    max-width: min(260px, calc(100vw - 24px));
  }
}
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: 1fr; }
}
.feature { transition: transform .18s ease, box-shadow .18s ease; }
.feature:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(17, 24, 39, 0.1); }
.feature h3 { margin-top: 10px; margin-bottom: 6px; }
.feature__num {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 12px;
}

.form { display: grid; gap: 12px; }
.form--inline { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(37,99,235,0.55); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
}
.btn { box-shadow: 0 1px 0 rgba(17, 24, 39, 0.06); }
.btn:active { transform: translateY(1px); }
.btn:hover { filter: brightness(0.98); }
.btn--ghost { background: #ffffff; border-color: var(--line); color: var(--text); }
.btn--danger { background: #b91c1c; border-color: #991b1b; color: #ffffff; }
.btn--small { min-height: 36px; padding: 7px 12px; border-radius: 10px; font-size: 0.9rem; }

.muted { color: var(--muted); }
.big { font-size: 1.25rem; font-weight: 700; }

.flash-list { margin: 18px 0; display: grid; gap: 10px; }
.flash {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #f9fafb;
}
.flash--error { border-color: #fecaca; background: var(--danger-bg); color: #7f1d1d; }
.flash--ok { border-color: #99f6e4; background: var(--ok-bg); color: #115e59; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f9fafb;
}

.notice {
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  padding: 12px 14px;
  background: #ffffff;
  margin: 10px 0;
}

.hr { height: 1px; background: var(--line); margin: 14px 0; }

.q { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px; margin: 12px 0; background: #ffffff; }
.q__title { font-weight: 700; margin-bottom: 10px; }
.q__opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #ffffff; cursor: pointer; }
.opt input { width: auto; margin-top: 2px; }

.timer {
  min-width: 90px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}
.timer--danger { border-color: #fecaca; background: var(--danger-bg); }

.table { display: grid; gap: 10px; }
.table__head, .table__row {
  display: grid;
  grid-template-columns: 170px 1.6fr 1fr 140px 160px 260px;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}
.table__head { background: #f9fafb; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .table__head, .table__row { grid-template-columns: 1fr; }
}

.table--users .table__head,
.table--users .table__row {
  grid-template-columns: 170px 1.6fr 1.2fr 160px;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.status--pending { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.status--approved { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.status--rejected { background: var(--danger-bg); border-color: #fecaca; color: #7f1d1d; }

@media (max-width: 700px) {
  html { font-size: 16px; }
  .container { width: min(1280px, calc(100% - 22px)); }
  .card { padding: 16px; }
}

/* Mobile-first polish for narrow phones (e.g. 390px width) */
@media (max-width: 480px) {
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
  }

  main.container {
    padding-top: 126px; /* compensate fixed mobile header */
  }

  .header__row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 0;
  }

  .brand__link {
    width: auto;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    justify-content: flex-start;
    gap: 8px;
  }

  .brand__logo {
    width: 40px;
    height: 40px;
  }

  .brand__text {
    font-size: 1.06rem;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .lang {
    flex: 0 0 auto;
    margin-right: 2px;
    padding: 4px 8px;
  }

  .nav > a {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.97rem;
  }

  .navmenu {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .navmenu summary {
    padding: 7px 10px;
    font-size: 0.97rem;
    white-space: nowrap;
  }

  .navmenu__label { display: none; }

  .card {
    border-radius: 10px;
    margin: 14px 0;
  }

  .footer__row {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
}

.footer__brand { display: inline-flex; align-items: center; gap: 10px; }
.footer__logo { width: 24px; height: 24px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.footer__title { font-weight: 700; letter-spacing: 0.3px; font-size: 0.92rem; }

