/* ISL admin. Brand from the website: red #cc1111, deep teal #032f2c, teal #0b7379,
   Inter for text and DM Serif Display for page titles. */
:root {
  --red: #cc1111;
  --red-dark: #a80e0e;
  --red-soft: #fef2f2;
  --deep: #032f2c;
  --deep-2: #05413c;
  --teal: #0b7379;
  --teal-soft: #e8f3f3;
  --ink: #101828;
  --body: #364153;
  --muted: #6a7282;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --surface: #f8f9fa;
  --bg: #f3f5f5;
  --ok: #0b7a4b;
  --ok-soft: #e7f6ee;
  --warn: #9a5b00;
  --warn-soft: #fff7e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(16 24 40 / .05), 0 1px 3px rgb(16 24 40 / .04);
  --sidebar: 256px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--red); }
h1 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 34px; line-height: 1.15; letter-spacing: -.01em; margin: 0; color: var(--deep); }
h2 { font-size: 17px; margin: 0 0 12px; color: var(--ink); }
p { margin: 0 0 12px; }
.icon { flex-shrink: 0; }

/* ---------- App shell: sidebar + content ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  display: flex; flex-direction: column; background: var(--deep); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; text-decoration: none; color: #fff; border-bottom: 1px solid rgb(255 255 255 / .08); }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--red); font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; }
.brand-text small { font-size: 12px; color: rgb(255 255 255 / .55); }

.side-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.side-label { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .4); }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0;
  border-radius: 8px; color: rgb(255 255 255 / .75); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background-color .15s, color .15s;
}
.side-nav a:hover { background: rgb(255 255 255 / .06); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--deep-2); color: #fff; }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.side-nav a[aria-current="page"] .icon { color: #5fd3c7; }

.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgb(255 255 255 / .08); }
.side-user form { margin: 0 0 0 auto; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.side-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.side-user-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { font-size: 12px; color: rgb(255 255 255 / .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.sidebar .icon-btn { color: rgb(255 255 255 / .7); }
.sidebar .icon-btn:hover { background: rgb(255 255 255 / .08); color: #fff; }

.shell { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 32px; background: rgb(255 255 255 / .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { margin: 0; font-weight: 600; font-size: 15px; color: var(--body); }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-right form { margin: 0; }
.menu-btn { display: none; color: var(--ink); }
.menu-btn:hover { background: var(--surface); }

.main { width: 100%; max-width: 1180px; padding: 32px 32px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 8px 0 0; max-width: 720px; }
.page-head p:first-child { margin-top: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--red) !important; margin: 0 0 8px !important; }

/* ---------- Building blocks ---------- */
.card, .panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  text-decoration: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 1px 2px rgb(204 17 17 / .25); }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: #fff; color: var(--red); border-color: rgb(204 17 17 / .3); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .side-nav a:focus-visible, .stat:focus-visible, .quick a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--surface); }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: #fafbfb; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; }
td a strong { color: var(--ink); }
td a:hover strong { color: var(--red); }
td .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
td form { margin: 0; }
code { background: var(--surface); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-yes { background: var(--ok-soft); color: var(--ok); }
.badge-no { background: #f2f4f7; color: var(--muted); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgb(11 115 121 / .15); }
.field { margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--red); }

.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; border: 1px solid transparent; }
.flash .icon { margin-top: 2px; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: #c6ebd6; }
.flash-error { background: var(--red-soft); color: var(--red); border-color: #f8d0d0; }

/* ---------- Dashboard ---------- */
.status-card {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 20px;
  border-radius: var(--radius); background: var(--deep); color: #fff; box-shadow: var(--shadow);
  background-image: radial-gradient(120% 140% at 100% 0%, rgb(11 168 152 / .25) 0%, rgb(11 168 152 / 0) 50%);
}
.status-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: rgb(255 255 255 / .08); color: #5fd3c7; flex-shrink: 0; }
.status-text { flex: 1; min-width: 240px; }
.status-text h2 { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 19px; margin: 2px 0 4px; }
.status-text p { margin: 0; color: rgb(255 255 255 / .7); font-size: 14px; }
.status-label { font-size: 11px !important; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .5) !important; }
.status-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.status-actions form { margin: 0; }
.status-card .btn-ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / .3); }
.status-card .btn-ghost:hover { border-color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.status-success .dot { background: #34d399; box-shadow: 0 0 0 4px rgb(52 211 153 / .2); }
.status-running .dot { background: #fbbf24; animation: pulse 1.4s ease-in-out infinite; }
.status-failed .dot { background: #f87171; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(251 191 36 / .25); } }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.stat:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 6px 16px -6px rgb(3 47 44 / .2); }
.stat-head { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--body); }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); }
.stat-value { font-family: "DM Serif Display", Georgia, serif; font-size: 34px; line-height: 1.1; color: var(--deep); margin-top: 6px; }
.stat-value small { font-family: Inter, sans-serif; font-size: 13px; color: var(--muted); }
.stat-sub { font-size: 12px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.count-pill { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700; }

.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.todo li:first-child { border-top: 0; padding-top: 4px; }
.todo-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); }
.todo strong { font-size: 14px; }
.todo p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.all-good { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.all-good p { margin: 0; color: var(--body); }
.all-good-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); flex-shrink: 0; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; padding-top: 2px; }
.activity-icon { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); color: var(--teal); }
.activity a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity a:hover { color: var(--red); }
.activity-meta { font-size: 12px; color: var(--muted); }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.quick a {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--teal); text-decoration: none; transition: border-color .15s, background-color .15s;
}
.quick a:hover { border-color: var(--teal); background: var(--teal-soft); }
.quick span { display: flex; flex-direction: column; gap: 2px; }
.quick strong { color: var(--ink); font-size: 14px; }
.quick small { color: var(--muted); font-size: 12px; }

/* ---------- FAQ item editor ---------- */
.items { display: flex; flex-direction: column; gap: 12px; }
.item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.item.dragging { opacity: .5; }
.item.drag-over { border-color: var(--red); }
.handle { cursor: grab; color: var(--muted); font-size: 18px; line-height: 1; padding-top: 30px; user-select: none; text-align: center; }
.item-num { font-weight: 700; color: var(--red); font-size: 13px; }
.item-fields .field:last-child { margin-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 40px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; }
.form-actions { position: sticky; bottom: 0; display: flex; gap: 12px; justify-content: flex-end; padding: 16px 0; background: linear-gradient(transparent, var(--bg) 30%); }

/* ---------- Grouped lists (FAQs by page type) ---------- */
.section { margin-bottom: 32px; }
.section > h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--teal); margin-bottom: 10px; }
.section > .hint { margin: -4px 0 10px; }
td .hint { font-size: 13px; margin-top: 2px; }

/* ---------- Documents ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.chip-teal { background: var(--teal-soft); border-color: #c9e3e4; color: var(--teal); }
.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.filters label { margin: 0; white-space: nowrap; }
.filters select { width: auto; min-width: 240px; }
input[type="file"] { display: block; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 8px; width: 100%; background: var(--surface); cursor: pointer; }
input[type="file"]:hover { border-color: var(--teal); }
.current-file { padding: 12px 14px; background: var(--surface); border-radius: 8px; }
.places { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 12px 0 0; }
.places legend { font-weight: 700; padding: 0 6px; }
.places .checkbox { font-weight: 500; margin: 6px 0; }

/* Around the World + Video Gallery */
.thumb { display: grid; place-items: center; width: 72px; height: 54px; object-fit: cover; border-radius: 6px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.video-thumb { position: relative; display: block; width: 128px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-thumb::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 0; height: 0; transform: translate(-35%, -50%); border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; filter: drop-shadow(0 1px 3px rgb(0 0 0 / .6)); }
.video-preview { display: flex; align-items: center; gap: 16px; margin: -4px 0 18px; }
.video-preview img { width: 200px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-current { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.photo-current img { width: 240px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-current .checkbox { font-weight: 500; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
.section > h2 .hint { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* Settings › Security check */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.check-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.check-ok .check-icon { background: var(--ok-soft); color: var(--ok); }
.check-warn .check-icon { background: var(--warn-soft); color: var(--warn); }
.check-bad .check-icon { background: var(--red-soft); color: var(--red); }

/* Delete a group */
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; padding: 16px 20px; border: 1px solid rgb(204 17 17 / .25); border-radius: var(--radius); background: #fff; }
.danger-zone p { margin: 4px 0 0; }

/* ---------- Login / install ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--deep); background-image: radial-gradient(90% 70% at 85% 0%, rgb(11 168 152 / .28) 0%, rgb(11 168 152 / 0) 55%); }
.auth .card { width: 100%; max-width: 420px; margin: 0; padding: 32px; box-shadow: 0 24px 48px -16px rgb(0 0 0 / .45); }
.auth-wide .card { max-width: 640px; }
.auth h1 { margin-bottom: 4px; }
.auth .sub { color: var(--muted); margin-bottom: 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand .brand-mark { color: #fff; }
.auth-brand span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.auth-brand small { color: var(--muted); font-size: 12px; }
.auth-foot { margin: 20px 0 0; text-align: center; font-size: 12px; color: rgb(255 255 255 / .5); }

/* ---------- Small screens: the sidebar slides in ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / .3); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(3 47 44 / .45); }
  .shell { margin-left: 0; }
  .menu-btn { display: grid; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .main { padding: 24px 16px 64px; }
  h1 { font-size: 28px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats, .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 28px; }
  .hide-sm { display: none; }
  table { display: block; overflow-x: auto; }
  .todo li { grid-template-columns: auto 1fr; }
  .todo li .btn { grid-column: 2; justify-self: start; }
}
