/* Da Capo Status Page — ClassLink / Statuspage-inspired layout */

:root {
  --bg: #ffffff;
  --text: #3c3c3c;
  --text-muted: #6e6e6e;
  --border: #e0e0e0;
  --border-light: #eeeeee;
  --brand: #1e5aa8;
  --brand-dark: #163f78;
  --link: #2b7bb9;
  --operational: #2fcc66;
  --degraded: #f1c40f;
  --partial: #e67e22;
  --major: #e74c3c;
  --maintenance: #3498db;
  --header-bg: #f8f9fa;
  --max: 980px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--brand);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  background: #5dade2;
  color: #fff;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(0.95);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: var(--major);
  color: #fff;
}

.btn-small {
  padding: 6px 10px;
  font-size: 0.75rem;
}

/* Status banner */
.status-banner {
  color: #fff;
  text-align: center;
  padding: 22px 16px;
  font-size: 1.35rem;
  font-weight: 600;
  margin: 24px 0 0;
}

.banner-operational { background: var(--operational); }
.banner-degraded { background: var(--degraded); color: #333; }
.banner-partial { background: var(--partial); }
.banner-major { background: var(--major); }
.banner-maintenance { background: var(--maintenance); }

/* Sections */
.section {
  margin: 36px 0;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #2c2c2c;
}

.about-copy {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 52rem;
}

.about-copy p {
  margin: 0 0 0.85rem;
}

/* Service list */
.component-panel {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  margin-top: 28px;
}

.component-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}

.component-row:last-child {
  border-bottom: none;
}

.component-name {
  color: #444;
  font-size: 0.95rem;
}

.component-name .desc {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.component-status {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.status-operational { color: var(--operational); }
.status-degraded { color: #c49a00; }
.status-partial { color: var(--partial); }
.status-major { color: var(--major); }
.status-maintenance { color: var(--maintenance); }

/* Active incidents */
.incident-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #fffaf0;
}

.incident-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.incident-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.incident-body {
  color: var(--text);
  font-size: 0.92rem;
  white-space: pre-wrap;
}

/* Past incidents */
.past-day {
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
}

.past-day:last-child {
  border-bottom: none;
}

.past-day h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #333;
}

.past-empty {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

.past-incident {
  margin: 10px 0 0;
  padding-left: 0;
}

.past-incident strong {
  display: block;
  margin-bottom: 4px;
}

.footer {
  border-top: 1px solid var(--border-light);
  margin-top: 48px;
  padding: 24px 0 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Admin */
.admin-body {
  background: #f4f6f8;
}

.admin-nav {
  background: var(--brand-dark);
  color: #fff;
}

.admin-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.admin-nav a {
  color: #fff;
  margin-right: 14px;
  font-size: 0.9rem;
}

.admin-nav a:hover {
  opacity: 0.9;
}

.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  margin: 24px 0;
}

.admin-card h1,
.admin-card h2 {
  margin-top: 0;
}

.flash {
  padding: 12px 14px;
  border-radius: 4px;
  margin: 16px 0 0;
}

.flash-success {
  background: #e8f8ef;
  color: #1e7a45;
  border: 1px solid #b7e6c9;
}

.flash-error {
  background: #fdecea;
  color: #a93226;
  border: 1px solid #f5c6cb;
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="url"],
.form-row input[type="number"],
.form-row input[type="datetime-local"],
.form-row select,
.form-row textarea {
  width: 100%;
  max-width: 520px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font: inherit;
}

.form-row textarea {
  min-height: 110px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.login-wrap {
  max-width: 420px;
  margin: 80px auto;
}

.muted {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.inline-form {
  display: inline;
}

@media (max-width: 640px) {
  .status-banner {
    font-size: 1.1rem;
    padding: 18px 12px;
  }

  .component-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
