/* ============================================================
   Alsa mini-CMS — admin styles
   ============================================================ */
:root {
  --navy: #104c7e;
  --navy-dark: #0a3352;
  --navy-deep: #06263f;
  --teal: #00a0d0;
  --teal-dark: #0087b3;
  --ink: #21303c;
  --muted: #5c6b78;
  --line: #e3ebf1;
  --bg: #eef3f7;
  --white: #ffffff;
  --red: #d64545;
  --green: #2f9e55;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }

/* ---------------- top bar ---------------- */
.admin-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy-deep);
  color: #fff;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.admin-top .logo { height: 30px; width: auto; }
.admin-top .title { font-weight: 800; font-size: 16px; letter-spacing: 0.3px; }
.admin-top .spacer { flex: 1; }
.admin-top a.btn,
.admin-top button.btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.admin-top a.btn:hover,
.admin-top button.btn:hover { background: rgba(255, 255, 255, 0.22); }
.admin-top button.logout { border-color: rgba(255, 120, 120, 0.5); }

/* ---------------- layout ---------------- */
.admin-wrap { max-width: 1060px; margin: 0 auto; padding: 30px 24px 130px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.page-head h1 { font-size: 24px; color: var(--navy-dark); }
.page-head .hint { color: var(--muted); font-size: 14px; }
.page-head .spacer { flex: 1; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 22px;
  box-shadow: 0 3px 14px rgba(9, 40, 66, 0.06);
  overflow: hidden;
}
.card-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fafcfe;
}
.card-head .num {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(0, 160, 208, 0.14);
  color: var(--teal);
  font-weight: 800;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.card-head h2 { font-size: 16.5px; color: var(--navy-dark); }
.card-body { padding: 22px; }

/* ---------------- fields ---------------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 6px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fbfdfe;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 160, 208, 0.13);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 74px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* list items (stats, faq, services...) */
.list-item {
  border: 1px dashed #c9d8e4;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fbfdff;
}
.list-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.list-item-head .item-title { font-size: 13px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: 0.6px; }
.icon-btn {
  background: none;
  border: 1.5px solid #d9a6a6;
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(214, 69, 69, 0.08); }
.icon-btn.add { border-color: #9ecfb0; color: var(--green); }
.icon-btn.add:hover { background: rgba(47, 158, 85, 0.08); }
.list-actions { margin-top: 6px; }

/* ---------------- login ---------------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(6, 38, 63, 0.94), rgba(10, 51, 82, 0.94)),
    url('static/images/hero.jpg') center/cover no-repeat;
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 40px 38px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.login-card .logo { height: 52px; width: auto; margin: 0 auto 10px; }
.login-card h1 { font-size: 20px; color: var(--navy-dark); margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.login-card .field { text-align: left; }
.login-card .error {
  display: none;
  background: rgba(214, 69, 69, 0.1);
  border: 1px solid rgba(214, 69, 69, 0.4);
  color: var(--red);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 9px;
  margin-bottom: 14px;
}
.login-card .error.show { display: block; }
.login-btn {
  width: 100%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 13px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover { background: var(--teal-dark); }

/* ---------------- save bar ---------------- */
.save-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(9, 40, 66, 0.10);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  z-index: 60;
}
.save-status { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.save-status.saved { color: var(--green); }
.save-status.error { color: var(--red); }
.save-btn {
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  padding: 12px 30px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.save-btn:hover { background: var(--navy-dark); transform: translateY(-1px); }
.save-btn:disabled { opacity: 0.6; cursor: wait; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.save-btn.loading .spinner { display: inline-block; margin-right: 8px; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .admin-top .title { display: none; }
  .admin-top a.view { display: none; }
}
