:root { 
  --bg: #0a0e1a;
  --bg-gradient: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
  --card: #141b2d;
  --card-hover: #1a2338;
  --card-bg: rgba(20, 27, 45, 0.8);
  --text: #e8ecf3;
  --text-bright: #ffffff;
  --muted: #8b9dc3;
  --line: #1e2a42;
  --line-bright: #2d3f5c;
  --primary: #4f7df9;
  --primary-hover: #5d8aff;
  --primary-dark: #3d6ae8;
  --primary-glow: rgba(79, 125, 249, 0.3);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(79, 125, 249, 0.3);
  --gradient-primary: linear-gradient(135deg, #4f7df9 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

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

body { 
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 125, 249, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(239, 68, 68, 0.1) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 32px 24px;
  animation: fadeIn 0.6s ease;
}

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

header { 
  margin-bottom: 48px;
  text-align: center;
  padding: 48px 0;
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

h1 { 
  margin: 0 0 12px; 
  font-size: 42px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  line-height: 1.2;
  text-shadow: 0 0 30px var(--primary-glow);
}

h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 16px;
  color: var(--text-bright);
  letter-spacing: -0.2px;
}

h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 20px 0 12px;
  color: var(--text-bright);
}

.sub { 
  margin: 0; 
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.card { 
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  margin: 20px 0;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

.card:hover::before {
  opacity: 1;
}

.hidden { display: none; }

.row { 
  display: flex;
  gap: 14px;
  margin: 16px 0;
  flex-wrap: wrap;
  align-items: center;
}

input, select { 
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: rgba(14, 21, 32, 0.7);
  color: var(--text);
  flex: 1;
  min-width: 220px;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(14, 21, 32, 0.9);
  box-shadow: 0 0 0 4px rgba(79, 125, 249, 0.15), 0 0 20px rgba(79, 125, 249, 0.2);
  transform: translateY(-1px);
}

input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

button { 
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: var(--gradient-primary);
  color: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(79, 125, 249, 0.4);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::before {
  width: 300px;
  height: 300px;
}

button:hover {
  background: linear-gradient(135deg, #5d8aff 0%, #9d7af9 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 125, 249, 0.5);
}

button.primary {
  background: var(--gradient-primary);
}

button:active {
  transform: translateY(0);
}

button.secondary { 
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  background: var(--card-hover);
  border-color: var(--line-bright);
}

button.danger {
  background: var(--danger);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

button.danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

button:disabled { 
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.hint { 
  color: var(--muted);
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
}

.hint strong {
  color: var(--text-bright);
  font-weight: 600;
}

.msg { 
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  min-height: 20px;
  font-size: 14px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.msg:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.15);
}

.msg.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.msg.success:hover {
  border-color: rgba(16, 185, 129, 0.6);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.15) 100%);
}

.msg.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.msg.error:hover {
  border-color: rgba(239, 68, 68, 0.6);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.15) 100%);
}

.small { 
  color: var(--muted);
  font-size: 13px;
}

.grid2 { 
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 900px) { 
  h1 {
    font-size: 32px;
  }
  
  h2 {
    font-size: 24px;
  }
  
  .wrap {
    padding: 20px 16px;
  }
  
  .card {
    padding: 24px;
  }
  
  header {
    padding: 32px 0;
  }
}

.list { 
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(14, 21, 32, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.item { 
  padding: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.item:hover {
  background: var(--card-hover);
  padding-left: 24px;
  border-left: 3px solid var(--primary);
}

.item:hover::before {
  opacity: 1;
}

.item:last-child { 
  border-bottom: 0;
}

.badge { 
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(79, 125, 249, 0.15);
  border: 1px solid rgba(79, 125, 249, 0.3);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.badge:hover {
  background: rgba(79, 125, 249, 0.25);
  transform: scale(1.05);
}

.badge.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.code { 
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 13px;
  color: #93c5fd;
  background: rgba(14, 21, 32, 0.6);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  font-weight: 500;
  transition: all 0.2s ease;
}

.code:hover {
  background: rgba(14, 21, 32, 0.8);
  border-color: rgba(147, 197, 253, 0.4);
}

.topbar { 
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--line);
  position: relative;
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 300px;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-info {
  border-left: 4px solid var(--info);
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(79, 125, 249, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(79, 125, 249, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.6;
}

/* Quick Stats */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-mini {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-mini:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.stat-mini-value {
  font-size: 2em;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 5px;
}

.stat-mini-label {
  font-size: 0.9em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 4em;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 10px;
}

/* Action Buttons Group */
.action-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Better Form Styling */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 125, 249, 0.1);
}

footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 2px solid var(--line);
  text-align: center;
  color: var(--muted);
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
}

footer code {
  background: rgba(14, 21, 32, 0.6);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--line);
}

footer a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 600;
}

footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}
