body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0b1224 100%);
  color: #e2e8f0;
  min-height: 100vh;
}

header {
  padding: 16px;
  background: linear-gradient(135deg, #1e293b, #0b1224);
  border-bottom: 1px solid #1f2937;
}

h1 {
  margin: 0 0 12px 0;
  font-size: 22px;
  letter-spacing: 0.5px;
}

h2 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

label {
  font-size: 13px;
  color: #cbd5e1;
}

input, select, button {
  margin-left: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
}

button {
  background: #2563eb;
  border: none;
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 600;
  padding: 8px 12px;
}

button:hover {
  background: #1d4ed8;
}

.tab-bar {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.tab {
  background: #0f172a;
  border: 1px solid #334155;
}

.tab.active {
  background: #2563eb;
  border-color: #2563eb;
}

.ghost {
  background: transparent;
  border: 1px solid #334155;
}

.ghost:hover {
  background: #1e293b;
}

main {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th, td {
  padding: 6px 8px;
  border-bottom: 1px solid #1f2937;
  font-size: 13px;
}

th {
  text-align: left;
  color: #cbd5e1;
  background: #0b1224;
}

td {
  color: #e2e8f0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

input[type="range"] {
  accent-color: #2563eb;
}

.sec-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 999px;
  padding: 6px 10px;
}

.chip.active {
  background: #2563eb;
  border-color: #2563eb;
}

/* Authentication Styles */
.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.auth-card {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: slideUp 0.4s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  color: white;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.auth-logo h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 24px;
  font-weight: 600;
  color: #f1f5f9;
}

.auth-subtitle {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  margin: 0;
}

.input-group input {
  padding: 12px 16px;
  border: 2px solid #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 16px;
  transition: all 0.2s ease;
  margin: 0;
}

.input-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(15, 23, 42, 0.95);
}

.input-group input::placeholder {
  color: #64748b;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  border: 2px solid #334155;
  color: #cbd5e1;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: #475569;
  background: rgba(51, 65, 85, 0.2);
  color: #e2e8f0;
}

.auth-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  margin: 0;
  min-height: 20px;
  transition: all 0.3s ease;
}

.auth-message.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.auth-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.auth-message.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.auth-footer {
  text-align: center;
  margin-top: 1rem;
}

.switch-mode {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
}

.link-btn {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  padding: 0;
  margin-left: 4px;
}

.link-btn:hover {
  color: #60a5fa;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state */
.btn-primary.loading {
  position: relative;
  color: transparent;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 480px) {
  .auth-card {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .auth-logo h1 {
    font-size: 24px;
  }
  
  .auth-header h2 {
    font-size: 20px;
  }
}

@media (min-width: 900px) {
  main {
    grid-template-columns: 1fr 1fr;
  }
  main section:nth-child(1) {
    grid-column: 1 / span 2;
  }
}
