:root {
  --bg-page: #f5f8fc;
  --bg-surface: #ffffff;
  --bg-pastel-blue: #eef5ff;
  --bg-pastel-green: #ecfdf5;
  --bg-pastel-amber: #fffbeb;
  --bg-pastel-rose: #fff1f2;
  --border-light: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --brand-primary: #16a34a;
  --brand-primary-hover: #15803d;
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
}

.topbar {
  background: linear-gradient(90deg, #ffffff 0%, #f0fdf4 50%, #eff6ff 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #16a34a, #2563eb);
  color: #ffffff;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.status-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.pill-green {
  background: var(--bg-pastel-green);
  color: #166534;
  border-color: #bbf7d0;
}

.pill-blue {
  background: var(--bg-pastel-blue);
  color: #1e40af;
  border-color: #bfdbfe;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
}

.preset-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.preset-bar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover,
.preset-btn.active {
  background: var(--bg-pastel-blue);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.tabs-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tab-btn {
  background: var(--bg-surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.tab-btn.active {
  border-color: var(--brand-blue);
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: var(--shadow-md);
}

.tab-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.tab-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.tab-corps {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

.module-panel {
  display: none;
}

.module-panel.active {
  display: block;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.badge-pilot {
  background: var(--bg-pastel-green);
  color: #15803d;
  border: 1px solid #86efac;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea.form-control {
  min-height: 92px;
  resize: vertical;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--brand-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--brand-blue-hover);
}

.btn-green {
  background: var(--brand-primary);
  color: #ffffff;
}

.btn-green:hover {
  background: var(--brand-primary-hover);
}

.btn-outline {
  background: #f8fafc;
  color: var(--text-primary);
  border: 1px solid #cbd5e1;
}

.btn-outline:hover {
  background: var(--bg-pastel-blue);
  border-color: var(--brand-blue);
}

.result-box {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}

.alert-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  background: #ffffff;
  border-left: 4px solid var(--brand-blue);
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 12px;
  border-radius: 6px;
}

.alert-item.HIGH,
.alert-item.CRITICAL {
  border-left-color: #e11d48;
  background: var(--bg-pastel-rose);
}

.alert-item.MEDIUM {
  border-left-color: #d97706;
  background: var(--bg-pastel-amber);
}

.alert-item.OK {
  border-left-color: #16a34a;
  background: var(--bg-pastel-green);
}

.table-clean {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}

.table-clean th,
.table-clean td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  font-size: 13px;
}

.table-clean th {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text-secondary);
}

.footer {
  margin-top: 36px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: #ffffff;
}
