:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c1e21;
  --muted: #65676b;
  --border: #dadde1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --error-bg: #fdecec;
  --error-text: #b42318;
  --ok: #16a34a;
  --warn: #b45309;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1b1e24;
    --text: #e6e7ea;
    --muted: #9aa0a8;
    --border: #2e333b;
    --accent: #4f8cff;
    --accent-hover: #6b9dff;
    --error-bg: #3a1d1d;
    --error-text: #ff8a80;
    --ok: #4ade80;
    --warn: #fbbf24;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

h1 { margin: 0 0 4px; font-size: 1.5rem; }
.muted { color: var(--muted); margin: 0; }

.card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
}

.card form { margin-top: 20px; display: grid; gap: 6px; }
.card label { font-weight: 500; margin-top: 8px; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  margin-top: 16px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:hover { background: var(--accent-hover); }

button.link {
  margin: 0;
  padding: 0;
  font-weight: 500;
  color: var(--accent);
  background: none;
}

button.link:hover { text-decoration: underline; background: none; }

.alert {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--error-bg);
  color: var(--error-text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 600; }
.user { display: flex; align-items: center; gap: 14px; }
.user form { margin: 0; }

.content { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

/* main.php: side menu + iframe filling the space under the top bar */
body.app { height: 100vh; display: flex; flex-direction: column; }
.content.layout { flex: 1; min-height: 0; max-width: none; margin: 0; padding: 0; display: flex; }

.sidemenu {
  width: 15vw;
  flex-shrink: 0;
  padding: 12px 8px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidemenu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.sidemenu a:hover { background: var(--bg); }
.sidemenu a.active { background: var(--accent); color: #fff; }

.page-frame { flex: 1; border: 0; background: var(--bg); }

/* Pages shown inside the iframe */
body.framed { padding: 24px; }

.panel {
  margin-top: 16px;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
.panel h2 i { color: var(--muted); margin-right: 6px; }

.status { margin: 0 0 4px; font-size: 1.1rem; font-weight: 600; }
.status.ok { color: var(--ok); }
.status.ok i { font-size: 1.6rem; vertical-align: middle; margin-right: 6px; }

.counts { list-style: none; margin: 0 0 8px; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.counts li.ok i { color: var(--ok); }
.counts li.skip i { color: var(--warn); }
.counts li.fail i { color: var(--error-text); }
