:root {
  --navy: #0f2744;
  --navy-2: #15396f;
  --blue: #1d4f91;
  --gold: #c9a227;
  --bg: #eef3f8;
  --card: #ffffff;
  --text: #1c2a3a;
  --muted: #5b6b7c;
  --line: #d5dee8;
  --ok: #0f7b4c;
  --ok-bg: #e8f7ef;
  --err: #b42318;
  --err-bg: #fdecec;
  --warn: #9a6700;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 39, 68, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

.site-header {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border-bottom: 4px solid var(--gold);
}

.header-bar,
.footer-inner,
.site-main,
.admin-content {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 2px;
}
.brand strong { display: block; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand small { display: block; opacity: 0.85; font-size: 0.82rem; }
.brand:hover { text-decoration: none; color: inherit; }

.header-links { display: flex; gap: 16px; font-size: 0.9rem; }
.header-links a { color: #e8eef6; }

.site-main { padding: 32px 0 48px; }

.site-footer {
  background: var(--navy);
  color: #d7e0ea;
  margin-top: auto;
}
.page-public { min-height: 100vh; display: flex; flex-direction: column; }
.footer-inner { padding: 28px 0; font-size: 0.88rem; }
.footer-inner a { color: #f4e7b5; }
.footer-inner p { margin: 0 0 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-card {
  width: min(560px, 100%);
  margin: 0 auto;
  overflow: hidden;
}

.form-card__hero {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  text-align: center;
  padding: 28px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.form-card__hero img {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  object-fit: contain;
}
.form-card__hero h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--navy);
}
.form-card__hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.form-card form,
.panel-body { padding: 24px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.field .hint {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
select {
  width: 100%;
  border: 1px solid #c5d0db;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
input:focus,
select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.input-prefix {
  display: flex;
  align-items: stretch;
}
.input-prefix span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f3f6fa;
  border: 1px solid #c5d0db;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  color: var(--muted);
  font-weight: 600;
}
.input-prefix input { border-radius: 0 10px 10px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  width: 100%;
  background: var(--navy-2);
  color: #fff;
}
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-warn {
  background: #9a6700;
  color: #fff;
  width: auto;
  padding: 8px 12px;
  font-size: 0.85rem;
}
.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  padding: 7px 12px;
  font-size: 0.85rem;
}

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 24px 0;
}
.form-card .alert { margin: 16px 24px 0; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e4c7; }
.alert-err { background: var(--err-bg); color: var(--err); border: 1px solid #f5c2c0; }

.recaptcha-wrap { display: flex; justify-content: center; margin: 8px 0 16px; }

.login-wrap {
  width: min(420px, 100%);
  margin: 24px auto 0;
}
.login-wrap .form-card__hero img { width: 96px; height: 96px; }

/* Admin */
.page-admin { min-height: 100vh; display: flex; flex-direction: column; }
.admin-shell { display: flex; min-height: 100vh; flex: 1; }
.admin-sidebar {
  width: 260px;
  background: var(--navy);
  color: #e8eef6;
  padding: 20px 16px;
  flex-shrink: 0;
}
.brand--sidebar { margin-bottom: 24px; }
.brand--sidebar img { width: 44px; height: 44px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.admin-sidebar nav a {
  color: #d7e0ea;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
}
.admin-sidebar nav a:hover,
.admin-sidebar nav a.is-active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.admin-user { display: flex; align-items: center; gap: 12px; }
.admin-content { width: min(1280px, calc(100% - 48px)); padding: 24px 0 48px; flex: 1; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}
.page-header h1 { margin: 0; font-size: 1.6rem; color: var(--navy); }
.page-header p { margin: 4px 0 0; color: var(--muted); }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.toolbar input { max-width: 280px; }

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
table.data th {
  background: #f6f8fb;
  color: var(--navy);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
}
table.data tbody tr:hover { background: #f8fafc; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.nav-toggle {
  display: none;
  background: var(--navy-2);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
}

.page-admin .site-footer { margin-top: 0; }

@media (max-width: 900px) {
  .header-links { display: none; }
  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 40;
  }
  .admin-sidebar.is-open { transform: none; }
  .nav-toggle { display: inline-flex; }
  .admin-content { width: calc(100% - 32px); }
}
