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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
}

#main-view {
  padding: 2rem 1rem;
}

/* SSO Login View */
.sso-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f1117 0%, #161d2a 100%);
}

.sso-content {
  text-align: center;
  background: #1a202c;
  padding: 3rem 2rem;
  border-radius: 12px;
  border: 1px solid #2d3748;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 400px;
}

.sso-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #f8fafc;
}

.sso-description {
  font-size: 1rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.sso-button {
  display: inline-block;
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-bottom: 1.5rem;
}

.sso-button:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.sso-button:active {
  transform: translateY(0);
}

.sso-footer {
  color: #64748b;
  font-size: 0.875rem;
  padding-top: 1rem;
  border-top: 1px solid #2d3748;
}

.sso-footer p {
  margin: 0;
}

.hidden {
  display: none;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.header-title {
  flex: 0 0 auto;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

header .actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#last-updated {
  font-size: 0.8rem;
  color: #64748b;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  transition: opacity 0.15s, transform 0.1s;
}
button:hover  { opacity: 0.85; }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-refresh {
  background: #334155;
  color: #e2e8f0;
}

.btn-start {
  background: #16a34a;
  color: #fff;
}

.btn-stop {
  background: #dc2626;
  color: #fff;
}

/* status badge */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-running     { background: #14532d; color: #4ade80; }
.badge-stopped     { background: #3b1010; color: #f87171; }
.badge-pending,
.badge-stopping,
.badge-starting    { background: #312e1a; color: #fbbf24; }
.badge-terminated  { background: #1e293b; color: #64748b; }

/* table */
.table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #1e293b;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: #1e293b;
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  white-space: nowrap;
}

tbody tr {
  border-top: 1px solid #1e293b;
  transition: background 0.1s;
}
tbody tr:hover { background: #161d2a; }

td {
  padding: 0.75rem 1rem;
  white-space: nowrap;
  vertical-align: middle;
}

td.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.82rem; }

.td-actions {
  display: flex;
  gap: 0.5rem;
}

/* notification bar */
#notification {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e40af;
  color: #eff6ff;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 999;
}
#notification.show { opacity: 1; }
#notification.error { background: #991b1b; }

/* spinner */
#spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid #334155;
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#error-banner {
  display: none;
  background: #3b1010;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* authentication UI */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
}

#user-display {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.btn-logout {
  background: #ef4444;
  color: #fff;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: #dc2626;
  opacity: 0.9;
}

.btn-logout:active {
  transform: scale(0.97);
}
