:root {
  --brand: #083e89;
  --brand-dark: #062f69;
  --accent: #0f766e;
  --page: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #d7e0ea;
  --border-strong: #b9c8d8;
  --text: #172033;
  --muted: #64748b;
  --danger-bg: #fff1f2;
  --danger: #9f1239;
  --danger-border: #fecdd3;
  --success-bg: #ecfdf5;
  --success: #065f46;
  --success-border: #a7f3d0;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--brand);
  font-weight: 650;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  color: var(--text);
  padding: 1rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.04);
}

.site-header h1 {
  max-width: 1120px;
  margin: 0 auto;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 750;
  letter-spacing: 0;
}

.admin-nav {
  max-width: 1120px;
  margin: 0.85rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-nav a {
  color: var(--brand-dark);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.admin-nav a:hover {
  background: #eaf2f8;
  border-color: var(--border-strong);
  text-decoration: none;
}

.site-main {
  width: min(100%, 720px);
  margin: 1.5rem auto;
  padding: 0 1rem 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: var(--shadow);
}

.form-intro,
.card > p:first-child {
  margin-top: 0;
  color: var(--brand-dark);
  font-weight: 700;
}

.form-intro {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #eff6ff;
}

.intro-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.intro-list li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--brand-dark);
  font-weight: 700;
}

.intro-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1.25;
  font-weight: 900;
}

form {
  margin: 0;
}

label,
.field-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="password"],
input[type="time"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  margin-bottom: 1rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.16);
}

input:disabled,
select:disabled,
button:disabled {
  cursor: not-allowed;
  background: #eef2f7;
  color: var(--muted);
}

input[type="checkbox"] {
  accent-color: var(--brand);
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  padding: 0.65rem 1.05rem;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 76, 129, 0.18);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 76, 129, 0.22);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--border-strong);
  box-shadow: none;
}

.btn-outline:hover {
  background: #eef6fb;
  color: var(--brand-dark);
  border-color: var(--brand);
  box-shadow: none;
}

.alert {
  padding: 0.8rem 0.95rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 650;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.countdown-box {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--brand-dark);
}

.countdown-box span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.countdown-box strong {
  font-size: clamp(1.15rem, 4vw, 1.7rem);
  line-height: 1.2;
}

.countdown-open {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

.row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
  margin: 0.45rem 0 1rem;
}

.day-grid label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  font-weight: 650;
}

.day-grid input {
  width: auto;
  margin: 0;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.9rem;
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4f9;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr:nth-child(even) td {
  background: #fbfdff;
}

table.data tbody tr:hover td {
  background: #f1f7fb;
}

table.data .btn {
  min-height: 32px;
  padding: 0.28rem 0.55rem;
  font-size: 0.85rem;
  box-shadow: none;
}

table.data form {
  display: inline-flex;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.46);
}

.modal-backdrop.show {
  display: flex;
}

.modal-box {
  width: min(100%, 420px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.35rem;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-box h2 {
  margin: 0 0 0.75rem;
  color: var(--brand-dark);
  font-size: 1.2rem;
}

.modal-box p {
  margin: 0 0 1rem;
}

.action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.action-list a {
  display: block;
  min-height: 76px;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
}

.action-list a:hover {
  border-color: var(--brand);
  background: #eef6fb;
  text-decoration: none;
}

.g-recaptcha {
  width: 304px;
  max-width: 100%;
  min-height: 78px;
  margin: 0.25rem 0 1rem;
  overflow: visible;
}

.g-recaptcha iframe {
  display: block;
  max-width: 100%;
}

.g-recaptcha > div {
  height: 85px !important;
}

.consent-line {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.25rem 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 650;
}

.consent-line input {
  flex: 0 0 auto;
  width: auto;
  margin: 0.25rem 0 0;
}

.consent-line span {
  min-width: 0;
}

.consent-line a {
  color: #475569;
  border-bottom: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.consent-line a:hover,
.consent-line a:focus {
  color: #1f2937;
  border-bottom-color: #94a3b8;
  text-decoration: none;
}

@media (max-width: 640px) {
  .site-main {
    margin-top: 1rem;
  }

  .row2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .admin-nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  table.data {
    font-size: 0.84rem;
  }

  table.data th,
  table.data td {
    padding: 0.6rem;
  }
}

.admin-body {
  background: #f3f6fb;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--brand);
  color: #ffffff;
  padding: 1rem;
  transition: width 0.2s ease, transform 0.2s ease;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.admin-brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 1.1rem;
}

.admin-menu {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.admin-menu a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 42px;
  padding: 0.65rem 0.7rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 750;
}

.admin-menu a:hover,
.admin-menu a.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  text-decoration: none;
}

.admin-menu-icon {
  width: 1.4rem;
  text-align: center;
  font-size: 1rem;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 70px;
  padding: 0.9rem clamp(1rem, 3vw, 1.5rem);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.04);
}

.admin-title {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.admin-subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.sidebar-toggle {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 800;
}

.admin-content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 1.25rem;
}

.admin-content.wide {
  width: min(100%, 1320px);
}

.sidebar-collapsed .admin-shell {
  grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar-collapsed .admin-sidebar {
  padding-inline: 0.7rem;
}

.sidebar-collapsed .admin-brand-text,
.sidebar-collapsed .admin-menu-text {
  display: none;
}

.sidebar-collapsed .admin-brand {
  justify-content: center;
}

.sidebar-collapsed .admin-menu a {
  justify-content: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 112px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eaf2f8;
  color: var(--brand-dark);
  font-weight: 850;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.stat-value {
  margin: 0.1rem 0 0;
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 850;
}

.facility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.facility-card {
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.facility-card strong {
  display: block;
  color: var(--brand-dark);
  font-size: 1rem;
}

.facility-card span {
  color: var(--muted);
  font-weight: 700;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.link-button:hover {
  background: #eef6fb;
  border-color: var(--brand);
  text-decoration: none;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    width: 270px;
    transform: translateX(-100%);
  }

  .sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    z-index: 35;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
  }

  .sidebar-collapsed .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-collapsed .admin-brand-text,
  .sidebar-collapsed .admin-menu-text {
    display: inline;
  }

  .sidebar-collapsed .admin-menu a,
  .sidebar-collapsed .admin-brand {
    justify-content: flex-start;
  }
}
