* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f8fafc; color: #1e293b; font-size: 15px; line-height: 1.5; }

/* Login */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 32px 24px; max-width: 380px; width: 100%; }
.login-box h1 { font-size: 1.3em; margin-bottom: 4px; }
.login-box .sub { color: #64748b; font-size: 0.85em; margin-bottom: 24px; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1em; outline: none; }
.login-box input:focus { border-color: #1e293b; box-shadow: 0 0 0 2px rgba(30,41,59,0.1); }
.login-box button { width: 100%; padding: 10px; background: #1e293b; color: #fff; border: none; border-radius: 8px; font-size: 1em; font-weight: 600; cursor: pointer; margin-top: 12px; }
.login-box button:hover { background: #334155; }
.login-box .err { color: #dc2626; font-size: 0.85em; margin-top: 8px; display: none; }

/* App */
#app { display: none; }
.header { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 12px 16px; position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.header h1 { font-size: 1.2em; white-space: nowrap; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 14px; border-radius: 6px; font-size: 0.85em; font-weight: 600; cursor: pointer; background: transparent; border: 1px solid #e5e7eb; color: #64748b; text-decoration: none; }
.tab.active { background: #1e293b; color: #fff; border-color: #1e293b; }
.tab:hover:not(.active) { background: #f1f5f9; }
.view-tabs { margin-left: auto; display: flex; gap: 4px; }

.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }

/* Status grid */
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 20px; }
.status-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; }
.status-card .host { font-weight: 600; font-size: 0.85em; display: flex; align-items: center; gap: 6px; }
.status-card .ms { color: #64748b; font-size: 0.8em; margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: #16a34a; }
.dot.fail { background: #dc2626; }

/* Sections */
.section { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.section h2 { font-size: 1.05em; margin-bottom: 12px; color: #1e293b; }
.section h3 { font-size: 0.95em; margin: 16px 0 8px; color: #475569; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; text-align: center; }
.kpi .value { font-size: 1.5em; font-weight: 700; color: #1e293b; }
.kpi .label { font-size: 0.75em; color: #64748b; text-transform: uppercase; margin-top: 2px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
th { text-align: left; padding: 6px 8px; border-bottom: 2px solid #e5e7eb; color: #64748b; font-size: 0.85em; }
td { padding: 5px 8px; border-bottom: 1px solid #f1f5f9; }
tr:hover { background: #f8fafc; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 0.85em; }
.alert.critical { background: #fef2f2; border-left: 3px solid #dc2626; color: #991b1b; }
.alert.warning { background: #fffbeb; border-left: 3px solid #d97706; color: #92400e; }
.alert.info { background: #f0f9ff; border-left: 3px solid #0ea5e9; color: #0369a1; }
.alert.ok { background: #f0fdf4; border-left: 3px solid #16a34a; color: #166534; }

/* Charts */
.chart-container { position: relative; height: 250px; margin: 12px 0; }

/* Plugin matrix */
.matrix td.current { background: #f0fdf4; color: #16a34a; font-weight: 600; }
.matrix td.outdated { background: #fef2f2; color: #dc2626; font-weight: 600; }
.matrix td.missing { color: #d1d5db; text-align: center; }

/* Responsive */
@media (max-width: 600px) {
  .header-inner { gap: 8px; }
  .header h1 { font-size: 1em; }
  .tab { padding: 5px 10px; font-size: 0.8em; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Loading */
.loading { text-align: center; padding: 40px; color: #94a3b8; }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid #e5e7eb; border-top-color: #1e293b; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
