/* ===== AribMonitor Modern Flat Design System ===== */

:root {
  --am-primary: #4f46e5;
  --am-primary-hover: #4338ca;
  --am-primary-light: #eef2ff;
  --am-success: #10b981;
  --am-success-light: #ecfdf5;
  --am-danger: #ef4444;
  --am-danger-light: #fef2f2;
  --am-warning: #f59e0b;
  --am-warning-light: #fffbeb;
  --am-info: #3b82f6;
  --am-muted: #6b7280;
  --am-bg: #f8fafc;
  --am-surface: #ffffff;
  --am-border: #e2e8f0;
  --am-sidebar: #0f172a;
  --am-sidebar-hover: #1e293b;
  --am-sidebar-active: #4f46e5;
  --am-text: #1e293b;
  --am-text-secondary: #64748b;
  --am-radius: 10px;
  --am-radius-sm: 6px;
  --am-shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --am-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --am-transition: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; min-height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--am-bg);
  color: var(--am-text);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--am-primary); text-decoration: none; }
a:hover { color: var(--am-primary-hover); }

/* ===== Sidebar ===== */
.am-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 250px;
  background: var(--am-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform var(--am-transition);
}
.am-sidebar-brand {
  padding: 1.5rem 1.25rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.am-sidebar-brand svg { flex-shrink: 0; }
.am-sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.am-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.25rem;
  color: #94a3b8;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  margin: 1px 0;
  transition: all var(--am-transition);
}
.am-sidebar-nav a:hover { color: #fff; background: var(--am-sidebar-hover); }
.am-sidebar-nav a.active { color: #fff; background: var(--am-sidebar-active); }
.am-sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.am-sidebar-nav a.active svg, .am-sidebar-nav a:hover svg { opacity: 1; }
.am-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8rem;
}
.am-sidebar-footer .am-user-name {
  color: #e2e8f0;
  font-weight: 600;
  display: block;
  margin-bottom: .25rem;
}
.am-sidebar-footer .am-user-email { color: #64748b; font-size: .75rem; }

/* ===== Main Content ===== */
.am-main {
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.am-topbar {
  background: var(--am-surface);
  border-bottom: 1px solid var(--am-border);
  padding: .75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.am-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
}
.am-footer {
  padding: 1rem 2rem;
  text-align: center;
  color: var(--am-text-secondary);
  font-size: .8rem;
  border-top: 1px solid var(--am-border);
}

/* ===== Cards ===== */
.am-card {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  padding: 1.5rem;
  box-shadow: var(--am-shadow-sm);
}
.am-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.am-card-header h2, .am-card-header h3, .am-card-header h4 {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ===== Stat Cards ===== */
.am-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.am-stat {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--am-shadow-sm);
}
.am-stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--am-text-secondary); font-weight: 600; margin-bottom: .35rem; }
.am-stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.am-stat-value.text-success { color: var(--am-success) !important; }
.am-stat-value.text-danger { color: var(--am-danger) !important; }

/* ===== Tables ===== */
.am-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
}
.am-table thead th {
  background: var(--am-bg);
  color: var(--am-text-secondary);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--am-border);
  white-space: nowrap;
}
.am-table tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--am-border);
  vertical-align: middle;
}
.am-table tbody tr:last-child td { border-bottom: none; }
.am-table tbody tr:hover { background: #f8fafc; }

/* ===== Status Badges ===== */
.am-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.am-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.am-badge-up, .am-badge-operational { background: var(--am-success-light); color: #065f46; }
.am-badge-up::before, .am-badge-operational::before { background: var(--am-success); }
.am-badge-down { background: var(--am-danger-light); color: #991b1b; }
.am-badge-down::before { background: var(--am-danger); }
.am-badge-paused { background: #f1f5f9; color: #475569; }
.am-badge-paused::before { background: #94a3b8; }
.am-badge-pending { background: var(--am-warning-light); color: #92400e; }
.am-badge-pending::before { background: var(--am-warning); }
.am-badge-degraded { background: #fff7ed; color: #9a3412; }
.am-badge-degraded::before { background: #f97316; }
.am-badge-resolved { background: var(--am-success-light); color: #065f46; }
.am-badge-resolved::before { background: var(--am-success); }
.am-badge-open { background: var(--am-danger-light); color: #991b1b; }
.am-badge-open::before { background: var(--am-danger); }

/* ===== Buttons ===== */
.am-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--am-radius-sm);
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--am-transition);
  line-height: 1.4;
  text-decoration: none;
}
.am-btn svg { width: 16px; height: 16px; }
.am-btn-primary { background: var(--am-primary); color: #fff; }
.am-btn-primary:hover { background: var(--am-primary-hover); color: #fff; }
.am-btn-secondary { background: #f1f5f9; color: var(--am-text); border: 1px solid var(--am-border); }
.am-btn-secondary:hover { background: #e2e8f0; color: var(--am-text); }
.am-btn-danger { background: var(--am-danger-light); color: #dc2626; border: 1px solid #fecaca; }
.am-btn-danger:hover { background: #fee2e2; color: #b91c1c; }
.am-btn-ghost { background: transparent; color: var(--am-text-secondary); }
.am-btn-ghost:hover { background: #f1f5f9; color: var(--am-text); }
.am-btn-sm { padding: .3rem .65rem; font-size: .78rem; }
.am-btn-logout {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,.1);
  padding: .35rem .75rem;
  font-size: .78rem;
  border-radius: var(--am-radius-sm);
  cursor: pointer;
  transition: all var(--am-transition);
}
.am-btn-logout:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }

/* ===== Forms ===== */
.am-form-group { margin-bottom: 1.25rem; }
.am-form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--am-text);
  margin-bottom: .4rem;
}
.am-form-control {
  width: 100%;
  padding: .55rem .85rem;
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-sm);
  font-size: .875rem;
  color: var(--am-text);
  background: var(--am-surface);
  transition: border-color var(--am-transition);
}
.am-form-control:focus {
  outline: none;
  border-color: var(--am-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.am-form-select { appearance: auto; }
textarea.am-form-control { resize: vertical; }
.am-form-check { display: flex; align-items: center; gap: .5rem; }
.am-form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--am-primary);
  cursor: pointer;
}
.am-form-hint { font-size: .75rem; color: var(--am-text-secondary); margin-top: .25rem; }
.am-fieldset {
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.am-fieldset-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--am-text-secondary);
  margin-bottom: 1rem;
}

/* ===== Alerts ===== */
.am-alert {
  padding: .85rem 1rem;
  border-radius: var(--am-radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.am-alert-success { background: var(--am-success-light); color: #065f46; border: 1px solid #a7f3d0; }
.am-alert-danger { background: var(--am-danger-light); color: #991b1b; border: 1px solid #fecaca; }
.am-alert-info { background: var(--am-primary-light); color: #3730a3; border: 1px solid #c7d2fe; }
.am-alert-warning { background: var(--am-warning-light); color: #92400e; border: 1px solid #fde68a; }

/* ===== Page Header ===== */
.am-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.am-page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.02em;
}
.am-page-header-actions { display: flex; gap: .5rem; }

/* ===== Timeline ===== */
.am-timeline { position: relative; padding-left: 1.5rem; }
.am-timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 0; bottom: 0;
  width: 2px;
  background: var(--am-border);
}
.am-timeline-item { position: relative; padding-bottom: 1.25rem; }
.am-timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: .35rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--am-primary);
  border: 2px solid var(--am-surface);
  z-index: 1;
}
.am-timeline-item.resolved::before { background: var(--am-success); }
.am-timeline-item.created::before { background: var(--am-danger); }
.am-timeline-time { font-size: .75rem; color: var(--am-text-secondary); }
.am-timeline-content { font-size: .875rem; }

/* ===== Empty State ===== */
.am-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--am-text-secondary);
}
.am-empty svg { width: 48px; height: 48px; margin-bottom: .75rem; opacity: .4; }
.am-empty p { margin: 0; font-size: .9rem; }

/* ===== Validation ===== */
.text-danger { color: var(--am-danger) !important; font-size: .8rem; }
.field-validation-error { color: var(--am-danger); font-size: .78rem; display: block; margin-top: .2rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.25rem; }
.validation-summary-errors { background: var(--am-danger-light); border: 1px solid #fecaca; border-radius: var(--am-radius-sm); padding: .85rem 1rem; color: #991b1b; margin-bottom: 1rem; font-size: .85rem; }

/* ===== Auth Pages ===== */
.am-auth-wrapper {
  min-height: 100vh;
  display: flex;
  background: var(--am-bg);
}
.am-auth-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: linear-gradient(160deg, #4f46e5 0%, #6366f1 40%, #7c3aed 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.am-auth-panel::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -100px; right: -80px;
}
.am-auth-panel::after {
  content: '';
  position: absolute;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  bottom: -60px; left: -40px;
}
.am-auth-panel-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 1.5rem;
  z-index: 1;
}
.am-auth-panel-tagline {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  max-width: 340px;
  text-align: center;
  z-index: 1;
  margin-bottom: 2rem;
}
.am-auth-panel-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1;
}
.am-auth-panel-feature {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .88rem;
  font-weight: 500;
  opacity: .92;
}
.am-auth-panel-feature svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; }
.am-auth-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  max-width: 520px;
  min-width: 400px;
}
.am-auth-card {
  width: 100%;
  max-width: 420px;
}
.am-auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.am-auth-logo h1 { font-size: 1.35rem; font-weight: 800; color: var(--am-text); margin: 0; }
.am-auth-logo p { color: var(--am-text-secondary); font-size: .85rem; margin: .35rem 0 0; }
.am-auth-footer { text-align: center; margin-top: 1.5rem; font-size: .85rem; color: var(--am-text-secondary); }
.am-auth-version {
  text-align: center;
  margin-top: 2rem;
  font-size: .72rem;
  color: var(--am-text-secondary);
  opacity: .6;
  letter-spacing: .02em;
}
.am-auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0;
  color: var(--am-text-secondary);
  font-size: .8rem;
}
.am-auth-divider::before, .am-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--am-border);
}
@media (max-width: 900px) {
  .am-auth-wrapper { flex-direction: column; }
  .am-auth-panel { display: none; }
  .am-auth-form-side { max-width: 100%; min-width: 0; padding: 2rem 1.5rem; }
}

/* ===== Public Status Page ===== */
.am-status-page { max-width: 720px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.am-status-header { text-align: center; margin-bottom: 2rem; }
.am-status-header h1 { font-size: 1.75rem; font-weight: 800; margin: 0 0 .25rem; }
.am-status-header p { color: var(--am-text-secondary); margin: 0; }
.am-status-banner {
  padding: 1rem 1.5rem;
  border-radius: var(--am-radius);
  text-align: center;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 1.5rem;
}
.am-status-banner.all-good { background: var(--am-success); color: #fff; }
.am-status-banner.has-issues { background: var(--am-danger); color: #fff; }
.am-status-banner.degraded { background: var(--am-warning); color: #fff; }
.am-status-component {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 0;
  border-bottom: 1px solid var(--am-border);
  font-size: .9rem;
}
.am-status-component:last-child { border-bottom: none; }
.am-status-component-name { font-weight: 500; }
.am-status-component-target { color: var(--am-text-secondary); font-size: .8rem; margin-left: .5rem; }

/* ===== Mobile sidebar toggle ===== */
.am-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--am-text);
  cursor: pointer;
  padding: .25rem;
}
@media (max-width: 768px) {
  .am-sidebar { transform: translateX(-100%); }
  .am-sidebar.open { transform: translateX(0); }
  .am-main { margin-left: 0; }
  .am-content { padding: 1.25rem; }
  .am-topbar { padding: .75rem 1.25rem; }
  .am-sidebar-toggle { display: block; }
  .am-stats { grid-template-columns: 1fr 1fr; }
  .am-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1035;
    display: none;
  }
  .am-sidebar-backdrop.open { display: block; }
}

/* ===== Chart container ===== */
.am-chart-wrap {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ===== Misc ===== */
.am-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px; display: inline-block; vertical-align: middle; }
.am-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: .82rem; }
.am-divider { border: 0; border-top: 1px solid var(--am-border); margin: 1.5rem 0; }

/* ===== Type Selector Cards ===== */
.am-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.am-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.1rem .75rem;
  border: 2px solid var(--am-border);
  border-radius: var(--am-radius);
  cursor: pointer;
  transition: all var(--am-transition);
  background: var(--am-surface);
  text-align: center;
}
.am-type-card:hover { border-color: #c7d2fe; background: var(--am-primary-light); }
.am-type-card.selected { border-color: var(--am-primary); background: var(--am-primary-light); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.am-type-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.am-type-card .am-type-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  transition: all var(--am-transition);
}
.am-type-card.selected .am-type-icon { background: var(--am-primary); color: #fff; }
.am-type-card .am-type-icon svg { width: 20px; height: 20px; }
.am-type-card .am-type-name { font-size: .8rem; font-weight: 600; color: var(--am-text); }
.am-type-card .am-type-desc { font-size: .7rem; color: var(--am-text-secondary); line-height: 1.3; }

/* ===== Section Block ===== */
.am-section {
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
  background: var(--am-surface);
}
.am-section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: #fafbfc;
  border-bottom: 1px solid var(--am-border);
}
.am-section-icon {
  width: 36px; height: 36px;
  border-radius: var(--am-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.am-section-icon svg { width: 18px; height: 18px; }
.am-section-icon.purple  { background: #ede9fe; color: #7c3aed; }
.am-section-icon.blue    { background: #dbeafe; color: #2563eb; }
.am-section-icon.green   { background: #dcfce7; color: #16a34a; }
.am-section-icon.orange  { background: #ffedd5; color: #ea580c; }
.am-section-icon.red     { background: #fee2e2; color: #dc2626; }
.am-section-icon.indigo  { background: #e0e7ff; color: #4f46e5; }
.am-section-title { font-size: .85rem; font-weight: 700; color: var(--am-text); }
.am-section-desc  { font-size: .75rem; color: var(--am-text-secondary); }
.am-section-body  { padding: 1.25rem; }

/* ===== Input Addons ===== */
.am-input-group { display: flex; align-items: stretch; }
.am-input-addon {
  display: flex;
  align-items: center;
  padding: 0 .85rem;
  background: #f8fafc;
  border: 1px solid var(--am-border);
  font-size: .82rem;
  color: var(--am-text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.am-input-addon:first-child { border-right: 0; border-radius: var(--am-radius-sm) 0 0 var(--am-radius-sm); }
.am-input-addon:last-child  { border-left: 0; border-radius: 0 var(--am-radius-sm) var(--am-radius-sm) 0; }
.am-input-group .am-form-control:not(:first-child):not(:last-child) { border-radius: 0; }
.am-input-group .am-form-control:first-child { border-radius: var(--am-radius-sm) 0 0 var(--am-radius-sm); }
.am-input-group .am-form-control:last-child  { border-radius: 0 var(--am-radius-sm) var(--am-radius-sm) 0; }

/* ===== Form Row Grid ===== */
.am-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .am-form-row { grid-template-columns: 1fr; } }

/* ===== Toggle Switch ===== */
.am-toggle { display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.am-toggle input { display: none; }
.am-toggle-track {
  width: 42px; height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  position: relative;
  transition: background var(--am-transition);
  flex-shrink: 0;
}
.am-toggle-track::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--am-transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.am-toggle input:checked + .am-toggle-track { background: var(--am-primary); }
.am-toggle input:checked + .am-toggle-track::after { transform: translateX(18px); }
.am-toggle-label { font-size: .85rem; font-weight: 500; color: var(--am-text); }

/* ===== Profile Card ===== */
.am-profile-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: var(--am-radius) var(--am-radius) 0 0;
  margin: -1.5rem -1.5rem 1.5rem;
}
.am-profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,.3);
}
.am-profile-meta { color: #fff; }
.am-profile-meta .name { font-size: 1.15rem; font-weight: 700; }
.am-profile-meta .detail { font-size: .8rem; opacity: .8; margin-top: .15rem; }

.am-profile-badges { display: flex; gap: .5rem; margin-top: .5rem; }
.am-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 9999px;
  font-size: .7rem;
  font-weight: 600;
  background: rgba(255,255,255,.2);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* ===== Password Strength ===== */
.am-pw-strength { display: flex; gap: .25rem; margin-top: .5rem; }
.am-pw-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: background .3s;
}
.am-pw-bar.active.weak   { background: var(--am-danger); }
.am-pw-bar.active.fair   { background: var(--am-warning); }
.am-pw-bar.active.good   { background: #22d3ee; }
.am-pw-bar.active.strong { background: var(--am-success); }
.am-pw-text { font-size: .72rem; font-weight: 600; margin-top: .25rem; }

/* ===== Auth Feature List (kept for backward compat) ===== */
.am-auth-features {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--am-border);
}
.am-auth-feature {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  color: var(--am-text-secondary);
  font-size: .8rem;
  line-height: 1.4;
}
.am-auth-feature svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--am-success); margin-top: 1px; }

/* ===== Monitor Component Picker ===== */
.am-component-list { display: flex; flex-direction: column; gap: .5rem; }
.am-component-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-sm);
  transition: all var(--am-transition);
  cursor: pointer;
}
.am-component-item:hover { border-color: #c7d2fe; background: var(--am-primary-light); }
.am-component-item.checked { border-color: var(--am-primary); background: var(--am-primary-light); }
.am-component-item input[type="checkbox"] { accent-color: var(--am-primary); width: 16px; height: 16px; }
.am-component-item .am-component-name { font-size: .85rem; font-weight: 500; }
.am-component-item .am-component-type { font-size: .72rem; color: var(--am-text-secondary); }

/* ===== Security lock icon ===== */
.am-lock-hero {
  text-align: center;
  padding: 1.5rem 1rem .5rem;
}
.am-lock-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--am-primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
}
.am-lock-icon svg { width: 24px; height: 24px; color: var(--am-primary); }
.am-lock-hero h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .25rem; }
.am-lock-hero p { font-size: .8rem; color: var(--am-text-secondary); margin: 0; }

/* ===== Filter Bar ===== */
.am-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
}
.am-filter-group {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
}
.am-filter-group label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--am-text-secondary);
}
.am-filter-group .am-form-control {
  min-width: 130px;
}
.am-filter-actions {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
}

/* ===== Two-column detail layout ===== */
.am-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ===== Incident card list (mobile-first for index table) ===== */
.am-incident-cards { display: none; }

/* ===== Table scroll wrapper ===== */
.am-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
  .am-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .am-filter-group .am-form-control {
    min-width: 0;
    width: 100%;
  }
  .am-filter-actions {
    justify-content: flex-start;
  }
  .am-detail-grid {
    grid-template-columns: 1fr;
  }
  .am-incident-table { display: none; }
  .am-incident-cards { display: flex; flex-direction: column; gap: .75rem; }
  .am-incident-card {
    background: var(--am-surface);
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    padding: 1rem;
    box-shadow: var(--am-shadow-sm);
  }
  .am-incident-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .5rem;
  }
  .am-incident-card-summary {
    font-weight: 600;
    font-size: .88rem;
    margin-bottom: .5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .am-incident-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    font-size: .78rem;
    color: var(--am-text-secondary);
  }
  .am-incident-card-meta .am-mono { font-size: .75rem; }
  .am-incident-card-footer {
    margin-top: .65rem;
    display: flex;
    justify-content: flex-end;
  }
}