* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: #e2e8f0;
  color: #1f2937;
  position: relative;
  overflow-x: hidden;
}
.screen { min-height: 100vh; }
.hidden { display: none !important; }

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  width: 320px;
}
.card h1 { margin: 0 0 4px; font-size: 20px; }
.subtitle { color: #6b7280; font-size: 14px; margin-bottom: 20px; }
label { display: block; font-size: 13px; margin: 12px 0 4px; color: #374151; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 38px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  padding: 0; color: #9ca3af; display: flex; align-items: center;
  width: auto; min-width: unset; line-height: 1; margin: 0;
}
.pw-toggle:hover { color: #6b7280; }
.pw-toggle svg { width: 18px; height: 18px; }

input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
button {
  margin-top: 18px;
  width: 100%;
  padding: 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { opacity: 0.9; }
button.secondary {
  background: #e5e7eb;
  color: #1f2937;
  width: auto;
  margin-top: 0;
}
button.danger { background: #dc2626; color: #fff; width: auto; margin-top: 0; }
.error { color: #dc2626; font-size: 13px; margin-top: 8px; min-height: 16px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
header h1 { margin: 0; font-size: 18px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions button { width: auto; margin-top: 0; }

.main { padding: 24px; max-width: 1100px; margin: 0 auto; }

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-value { display: block; font-size: 28px; font-weight: 700; color: #2563eb; }
.stat-label { font-size: 13px; color: #6b7280; }

.clients-section { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 20px; }
.clients-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.clients-header h2 { margin: 0; font-size: 16px; }
.clients-header input { width: 260px; margin: 0; }

.client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f9fafb;
  cursor: pointer;
  transition: background 0.15s;
}
.client-row:hover { background: #e5e7eb; }
.client-row.inactive { opacity: 0.5; }
.client-info { flex: 1; }
.client-name { font-weight: 600; font-size: 14px; }
.client-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.client-stats { font-size: 12px; color: #6b7280; text-align: right; margin-right: 16px; }
.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}
.status-badge.active { background: #dbeafe; color: #1e40af; }
.status-badge.inactive { background: #fee2e2; color: #991b1b; }

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content.wide { width: 540px; }
.modal-content h2 { margin: 0 0 16px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions button { margin-top: 0; width: auto; }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.detail-header h2 { margin: 0 0 4px; }
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
}
.badge.active { background: #dbeafe; color: #1e40af; }
.badge.inactive { background: #fee2e2; color: #991b1b; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.detail-item span:last-child { font-size: 14px; font-weight: 500; }

.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-actions button { margin-top: 0; width: auto; }

.empty-state { text-align: center; color: #6b7280; padding: 40px; }

.block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border-left: 3px solid #f59e0b;
  margin-bottom: 8px;
  gap: 12px;
}
.block-row-info { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.block-row-date { font-weight: 600; font-size: 13px; }
.block-row-time { font-size: 13px; color: #6b7280; }
.block-row-reason { font-size: 12px; color: #9ca3af; font-style: italic; }
.block-delete-btn { width: auto; margin-top: 0; padding: 4px 12px; font-size: 12px; flex-shrink: 0; }
body.dark .block-row { background: #0f172a; border-left-color: #f59e0b; }
body.phantom .block-row { background: #0d0b1e; border-left-color: #00e5ff; }
body.phantom .block-row-date { color: #e0e7ff; }
body.java .block-row { background: #12102a; border-left-color: #ffdd00; }
body.java .block-row-date { color: #f0e6ff; }

.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  margin: 0;
  padding: 0;
  width: auto;
  color: #6b7280;
}

/* ── Waves ─────────────────────────────────────────────────── */
.waves-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  line-height: 0;
}
.waves-container svg { display: block; width: 200%; }
.wave { animation: waveMove 8s cubic-bezier(.55,.5,.45,.5) infinite; }
.wave1 { animation-duration: 9s; }
.wave2 { animation-duration: 12s; animation-delay: -3s; }
.wave3 { animation-duration: 7s;  animation-delay: -5s; }
@keyframes waveMove {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* ── Floating particles ─────────────────────────────────────── */
.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  opacity: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  10%  { opacity: 0.6; }
  80%  { opacity: 0.3; }
  100% { transform: translateY(-110vh) scale(0.4); opacity: 0; }
}

.particle { background: rgba(37,99,235,0.15); }
body.dark    .particle { background: rgba(99,102,241,0.18); }
body.indigo  .particle { background: rgba(129,140,248,0.18); }
body.phantom .particle { background: rgba(0,229,255,0.12); }
body.java    .particle { background: rgba(255,45,120,0.14); }

#app-screen, #login-screen { position: relative; z-index: 1; }

/* ── Dark mode ────────────────────────────────────────────── */
body.dark {
  background: #0f172a;
  color: #e2e8f0;
}
body.dark .wave1 { fill: rgba(99,102,241,0.12); }
body.dark .wave2 { fill: rgba(99,102,241,0.08); }
body.dark .wave3 { fill: rgba(99,102,241,0.06); }
body.dark header { background: #1e293b; border-bottom-color: #334155; }
body.dark header h1 { color: #f1f5f9; }
body.dark .stat-card,
body.dark .clients-section,
body.dark .modal-content,
body.dark .card { background: #1e293b; box-shadow: none; }
body.dark .card h1,
body.dark .modal-content h2,
body.dark .client-name { color: #f1f5f9; }
body.dark label { color: #94a3b8; }
body.dark input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark .client-row { background: #0f172a; }
body.dark .client-row:hover { background: #334155; }
body.dark .client-meta,
body.dark .client-stats,
body.dark .stat-label,
body.dark .empty-state,
body.dark .subtitle,
body.dark .detail-label { color: #94a3b8; }
body.dark button.secondary { background: #334155; color: #e2e8f0; }

.icon-btn { width: auto; margin-top: 0; padding: 6px 10px; display: flex; align-items: center; }

/* ── Theme menu ────────────────────────────────────────────── */
.theme-menu-wrapper { position: relative; }
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  z-index: 1000;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  width: 100%;
  text-align: left;
  margin: 0;
}
.theme-option:hover { background: #f1f5f9; }
.theme-option.active { background: #dbeafe; color: #1e40af; font-weight: 600; }

/* dark theme-menu */
body.dark .theme-menu { background: #1e293b; border-color: #334155; }
body.dark .theme-option { color: #e2e8f0; }
body.dark .theme-option:hover { background: #334155; }
body.dark .theme-option.active { background: #1e3a8a; color: #bfdbfe; }

/* ── Indigo theme ──────────────────────────────────────────── */
body.indigo {
  background: #1e1b4b;
  color: #e0e7ff;
}
body.indigo .wave1 { fill: rgba(129,140,248,0.15); }
body.indigo .wave2 { fill: rgba(129,140,248,0.10); }
body.indigo .wave3 { fill: rgba(129,140,248,0.07); }
body.indigo header { background: #312e81; border-bottom-color: #4338ca; }
body.indigo header h1 { color: #e0e7ff; }
body.indigo .stat-card,
body.indigo .clients-section,
body.indigo .card,
body.indigo .modal-content { background: #2e2b63; border-color: #4338ca; color: #e0e7ff; }
body.indigo .stat-value { color: #a5b4fc; }
body.indigo .stat-label { color: #c7d2fe; }
body.indigo .client-row { background: #2e2b63; border-color: #4338ca; }
body.indigo .client-row:hover { background: #3730a3; }
body.indigo .client-meta, body.indigo .client-stats { color: #a5b4fc; }
body.indigo input, body.indigo select, body.indigo textarea { background: #3730a3; border-color: #4338ca; color: #e0e7ff; }
body.indigo label { color: #c7d2fe; }
body.indigo button.secondary { background: #3730a3; color: #e0e7ff; }
body.indigo .theme-menu { background: #312e81; border-color: #4338ca; }
body.indigo .theme-option { color: #e0e7ff; }
body.indigo .theme-option:hover { background: #3730a3; }
body.indigo .theme-option.active { background: #4338ca; color: #e0e7ff; }

/* ── Phantom theme ─────────────────────────────────────────── */
body.phantom {
  background: #0d0b1e;
  color: #e0e7ff;
}
body.phantom .wave1 { fill: rgba(0,229,255,0.10); }
body.phantom .wave2 { fill: rgba(224,64,251,0.07); }
body.phantom .wave3 { fill: rgba(0,229,255,0.05); }
body.phantom header {
  background: #13102b;
  border-bottom: 1px solid rgba(0,229,255,0.25);
}
body.phantom header h1 { color: #00e5ff; letter-spacing: 0.04em; }
body.phantom .stat-card,
body.phantom .clients-section,
body.phantom .card,
body.phantom .modal-content {
  background: #1a1535;
  border: 1px solid rgba(0,229,255,0.15);
  box-shadow: 0 0 20px rgba(0,229,255,0.05);
  color: #e0e7ff;
}
body.phantom .stat-value { color: #00e5ff; text-shadow: 0 0 10px rgba(0,229,255,0.5); }
body.phantom .stat-label { color: #9ca3af; }
body.phantom .client-row { background: #1a1535; border-color: rgba(0,229,255,0.15); }
body.phantom .client-row:hover { background: #221c45; border-color: rgba(0,229,255,0.4); }
body.phantom .client-meta, body.phantom .client-stats { color: #94a3b8; }
body.phantom .client-name { color: #e0e7ff; }
body.phantom label, body.phantom .subtitle,
body.phantom .empty-state { color: #94a3b8; }
body.phantom .modal-content h2 { color: #00e5ff; }
body.phantom input, body.phantom select, body.phantom textarea {
  background: #0d0b1e;
  border-color: rgba(0,229,255,0.25);
  color: #e0e7ff;
}
body.phantom input:focus, body.phantom select:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0,229,255,0.15);
  outline: none;
}
body.phantom button { background: linear-gradient(135deg, #00b4cc, #7b2ff7); color: #fff; border: none; }
body.phantom button:hover { opacity: 0.88; }
body.phantom button.secondary {
  background: transparent;
  border: 1px solid rgba(0,229,255,0.35);
  color: #00e5ff;
}
body.phantom button.secondary:hover { background: rgba(0,229,255,0.1); }
body.phantom .badge.active { background: rgba(0,229,255,0.15); color: #00e5ff; }
body.phantom .status-badge.active { background: rgba(0,229,255,0.15); color: #00e5ff; }
body.phantom .status-badge.inactive { background: rgba(224,64,251,0.15); color: #e040fb; }
body.phantom .theme-menu { background: #1a1535; border-color: rgba(0,229,255,0.25); }
body.phantom .theme-option { color: #e0e7ff; }
body.phantom .theme-option:hover { background: rgba(0,229,255,0.1); }
body.phantom .theme-option.active { background: rgba(0,229,255,0.2); color: #00e5ff; font-weight: 600; }

/* ── Java theme ────────────────────────────────────────────── */
body.java {
  background: #12102a;
  color: #f0e6ff;
}
body.java .wave1 { fill: rgba(255,45,120,0.12); }
body.java .wave2 { fill: rgba(255,150,0,0.08); }
body.java .wave3 { fill: rgba(255,45,120,0.06); }
body.java header {
  background: #1a1640;
  border-bottom: 1px solid rgba(255,45,120,0.35);
}
body.java header h1 {
  background: linear-gradient(90deg, #ffdd00, #ff6b00, #ff2d78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.java .stat-card,
body.java .clients-section,
body.java .card,
body.java .modal-content {
  background: #1c1a3a;
  border: 1px solid rgba(255,45,120,0.2);
  box-shadow: 0 0 20px rgba(255,45,120,0.06);
  color: #f0e6ff;
}
body.java .stat-value {
  background: linear-gradient(135deg, #ffdd00, #ff2d78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.java .stat-label { color: #9ca3af; }
body.java .client-row { background: #1c1a3a; border-color: rgba(255,45,120,0.2); }
body.java .client-row:hover { background: #241f4a; border-color: rgba(255,45,120,0.5); }
body.java .client-meta, body.java .client-stats { color: #a78bca; }
body.java .client-name { color: #f0e6ff; }
body.java label, body.java .subtitle, body.java .empty-state { color: #a78bca; }
body.java .modal-content h2 {
  background: linear-gradient(90deg, #ffdd00, #ff2d78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.java input, body.java select, body.java textarea {
  background: #12102a;
  border-color: rgba(255,45,120,0.3);
  color: #f0e6ff;
}
body.java input:focus, body.java select:focus {
  border-color: #ff2d78;
  box-shadow: 0 0 0 3px rgba(255,45,120,0.15);
  outline: none;
}
body.java button { background: linear-gradient(135deg, #ff6b00, #ff2d78, #8b00ff); color: #fff; border: none; }
body.java button:hover { opacity: 0.88; }
body.java button.secondary {
  background: transparent;
  border: 1px solid rgba(255,45,120,0.45);
  color: #ff2d78;
}
body.java button.secondary:hover { background: rgba(255,45,120,0.1); }
body.java .badge.active { background: rgba(255,180,0,0.15); color: #ffb400; }
body.java .status-badge.active { background: rgba(255,180,0,0.15); color: #ffb400; }
body.java .status-badge.inactive { background: rgba(255,45,120,0.15); color: #ff2d78; }
body.java .theme-menu { background: #1c1a3a; border-color: rgba(255,45,120,0.3); }
body.java .theme-option { color: #f0e6ff; }
body.java .theme-option:hover { background: rgba(255,45,120,0.1); }
body.java .theme-option.active { background: rgba(255,45,120,0.2); color: #ff2d78; font-weight: 600; }
