:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-hover: #f4f5f8;
  --border: #e2e5ec;
  --border-strong: #c8ccd6;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Layout */
.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}
.logo svg { color: var(--primary); }

/* Auth area */
#auth-area { display: flex; align-items: center; gap: 10px; }
.auth-connected { display: flex; align-items: center; gap: 10px; }
.auth-user {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main */
.main { padding: 32px 0 64px; }
.page-intro { margin-bottom: 28px; }
.page-intro h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.page-intro p { color: var(--text-muted); font-size: 15px; }

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 16px;
}
@media (max-width: 520px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* Service card */
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .15s;
}
.service-card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.card-title { font-weight: 600; font-size: 15px; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.card-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
}

.card-body { padding: 16px 18px; }

/* Version selector */
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.field-row { display: flex; gap: 8px; align-items: center; }
select.input, input.input {
  flex: 1;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
select.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

/* EOL info */
.eol-info {
  margin-top: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
}
.eol-info.visible { display: flex; }

.eol-dates { display: flex; flex-direction: column; gap: 6px; }
.eol-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  gap: 12px;
}
.eol-row.danger { background: var(--danger-light); }
.eol-row.warning { background: var(--warning-light); }
.eol-row.info { background: var(--primary-light); }
.eol-row.neutral { background: var(--surface-hover); }

.eol-row-label { font-size: 13px; font-weight: 500; flex: 1; }
.eol-row-date { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.eol-row-countdown { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.eol-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  color: var(--text-muted);
}
.checkbox-label input[type=checkbox] { accent-color: var(--primary); cursor: pointer; }
.checkbox-label input:checked + span { color: var(--text); }

.card-actions { margin-top: 14px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
  padding: 8px 14px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border-strong); }
.btn-outline:not(:disabled):hover { background: var(--surface-hover); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* Skeleton loader */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 200px;
  animation: shimmer 1.5s infinite linear;
  background: linear-gradient(90deg, var(--surface) 25%, #f0f1f5 50%, var(--surface) 75%);
  background-size: 400% 100%;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Error state */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  max-width: 340px;
  animation: slide-in .2s ease;
  border: 1px solid transparent;
}
.toast.success { background: var(--success-light); color: var(--success); border-color: #a7f3d0; }
.toast.error   { background: var(--danger-light);  color: var(--danger);  border-color: #fca5a5; }
.toast.info    { background: var(--primary-light); color: var(--primary); border-color: #c7d2fe; }
.toast-close { margin-left: auto; cursor: pointer; opacity: .6; background: none; border: none; font-size: 16px; color: inherit; padding: 0; }
.toast-close:hover { opacity: 1; }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slide-out { to { transform: translateX(20px); opacity: 0; } }

/* Utilities */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.small { font-size: 12px; }

/* Footer note */
.footer-note {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}
.footer-note a { color: var(--text-muted); text-decoration: underline; }
.footer-note a:hover { color: var(--text); }
