:root {
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #d97706;
  --gray-bg: #f4f5f7;
  --gray-border: #e2e4e9;
  --text: #1f2430;
  --text-light: #6b7280;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-bg);
  color: var(--text);
}
header.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header.topbar a { color: var(--text); text-decoration: none; font-weight: 600; }
header.topbar nav a { margin-left: 18px; font-weight: 400; color: var(--text-light); }
header.topbar nav a:hover { color: var(--blue); }
main { max-width: 1100px; margin: 0 auto; padding: 24px; }
.card {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--gray-border); font-size: 14px; }
th { color: var(--text-light); font-weight: 600; font-size: 13px; text-transform: uppercase; }
tr:hover td { background: #fafbfc; }
a.rowlink { color: var(--text); text-decoration: none; display: block; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.up, .badge.answered { background: #dcfce7; color: var(--green); }
.badge.down, .badge.open { background: #fee2e2; color: var(--red); }
.badge.unknown, .badge.closed { background: #f1f2f4; color: var(--text-light); }
.badge.in_progress { background: #dbeafe; color: var(--blue); }
.badge.warn { background: #fef3c7; color: var(--orange); }
.btn {
  display: inline-block; background: var(--blue); color: #fff; border: none;
  padding: 9px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--blue-dark); }
.stat { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-light); }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--gray-border); border-radius: 6px; font-size: 14px; margin-top: 4px;
}
label { font-size: 13px; font-weight: 600; color: var(--text-light); }
.login-box { max-width: 360px; margin: 80px auto; }
.msg-thread { margin: 14px 0; }
.msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; max-width: 80%; }
.msg.admin { background: #dbeafe; margin-left: auto; }
.msg.client { background: #f1f2f4; }
.msg small { display: block; color: var(--text-light); margin-top: 4px; }
