/* Lay out Home resource cards, cron jobs, services and IP lists responsively.
Wrap long addresses; use green tags for active/running service states. */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20262d;
  background: #f5f6f7;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: 27px; font-weight: 650; letter-spacing: -.6px; }
h2 { font-size: 14px; font-weight: 600; }
button, input { font: inherit; font-size: 13px; border: 1px solid #d3d8de; border-radius: 5px; background: #fff; padding: 8px 11px; }
button { cursor: pointer; color: #303942; }
button:hover { background: #eef1f4; }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, input:focus-visible { outline: 2px solid #3869aa; outline-offset: 2px; }
main { max-width: 1200px; margin: auto; padding: 32px; min-width: 0; }
.page-heading, .status-line { display: flex; align-items: center; gap: 12px; }
.page-heading { justify-content: space-between; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.talk-link { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 7px; background: #303942; color: #fff; font-size: 14px; font-weight: 550; text-decoration: none; }
.talk-link:hover { background: #444f5c; }
.talk-link:focus-visible { outline: 2px solid #3869aa; outline-offset: 3px; }
.status-line { margin: 24px 0 20px; color: #737d88; font-size: 12px; flex-wrap: wrap; }
.status-line strong { color: #35664e; font-weight: 500; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3c8b63; }
.dot.offline { background: #b54a40; }
.refresh-note { margin-left: auto; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metrics article, .panel { background: #fff; border: 1px solid #e0e4e8; border-radius: 7px; }
.metrics article { padding: 20px; }
.metrics h2 { color: #67717c; font-size: 12px; font-weight: 500; }
.metric-value { font-size: 31px; font-weight: 600; margin: 14px 0 8px; font-variant-numeric: tabular-nums; }
.unit { color: #8a939d; font-size: 13px; font-weight: 400; margin-left: 5px; }
.metrics p, .panel-heading p { font-size: 11px; color: #77818b; line-height: 1.6; }
.middle-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.panel { overflow: hidden; }
.panel-heading { padding: 20px; }
.panel-heading p { margin-top: 6px; }
.count-badge { background: #f0f2f4; color: #6d7884; padding: 2px 6px; border-radius: 4px; font-size: 10px; margin-left: 5px; }
.empty-state { padding: 24px 20px; font-size: 13px; color: #78828d; }
.ip-panel { margin-top: 20px; }
.ip-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ip-status { padding: 0 20px 20px; color: #77818b; font-size: 12px; }
.ip-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 0 20px 20px; }
.ip-groups h3 { margin: 0; font-size: 13px; font-weight: 600; }
.ip-list { list-style: none; padding: 0; margin: 12px 0 0; }
.ip-list li { padding: 10px 0; border-top: 1px solid #e9ecef; overflow-wrap: anywhere; font-size: 13px; }
.ip-empty { color: #78828d; }
.job-list, .service-list { padding: 0 20px; }
.service, .job { padding-bottom: 16px; }
.service-title, .job header { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 500; }
.service p, .job p { font-size: 11px; color: #79838e; margin-top: 7px; line-height: 1.5; overflow-wrap: anywhere; }
.service-states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.state-tag { padding: 3px 7px; border: 1px solid #e5e8eb; border-radius: 4px; background: #f5f6f7; color: #5e6975; line-height: 1.5; }
.state-tag.active, .state-tag.running { border-color: #d7e8dc; background: #edf6f0; color: #397353; }
.job { border-top: 1px solid #e9ecef; padding-top: 14px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.error-banner { margin-top: 20px; border: 1px solid #edccc5; background: #fff3f0; color: #a64c3e; padding: 12px; border-radius: 5px; font-size: 13px; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 350px; background: #fff; border: 1px solid #e0e4e8; border-radius: 7px; padding: 30px; }
.login-card form { margin-top: 26px; }
.login-card label { display: block; font-size: 12px; margin-bottom: 8px; }
.login-card input, .login-card button { width: 100%; }
.login-card button { margin-top: 12px; color: #fff; background: #303942; border-color: #303942; }
.error { margin-top: 12px; color: #a64c3e; font-size: 12px; line-height: 1.5; }
@media (max-width: 800px) {
  main { padding: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics article:last-child { grid-column: 1 / -1; }
  .middle-grid, .ip-groups { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  main { padding: 20px 14px; }
  h1 { font-size: 24px; }
  .talk-link { width: 100%; justify-content: center; }
  button { font-size: 12px; padding: 8px; }
  .metrics { gap: 12px; }
  .metrics article { padding: 16px; }
  .metrics p { font-size: 10px; }
  .status-line { gap: 8px; font-size: 10px; }
  .refresh-note { display: none; }
}
