:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-hover: #243044;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --error: #ef4444;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

/* Launch */
#launch-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.launch-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
}

.launch-card h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.launch-card p {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-muted);
}

.people-illustration {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  min-height: 180px;
}

.person {
  position: relative;
  width: 90px;
  height: 160px;
  animation: floatY 2.4s ease-in-out infinite;
}

.person .head {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border-radius: 50%;
  background: #cbd5e1;
}

.person .body {
  position: absolute;
  top: 50px;
  left: 50%;
  width: 56px;
  height: 78px;
  margin-left: -28px;
  border-radius: 14px;
  background: var(--primary);
}

.person-left .laptop,
.person-center .card,
.person-right .phone {
  position: absolute;
  border-radius: 8px;
  background: #0b1220;
  border: 1px solid var(--border);
}

.person-left .laptop {
  top: 95px;
  left: 8px;
  width: 52px;
  height: 32px;
}

.person-center .card {
  top: 88px;
  left: 30px;
  width: 30px;
  height: 44px;
}

.person-right .phone {
  top: 94px;
  left: 58px;
  width: 16px;
  height: 30px;
}

.person-center .body {
  background: #6366f1;
}

.person-right .body {
  background: #0ea5e9;
}

.person-left {
  animation-delay: 0s;
}

.person-center {
  animation-delay: 0.2s;
}

.person-right {
  animation-delay: 0.4s;
}

@keyframes floatY {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.login-card .subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

#login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

#login-form input::placeholder {
  color: var(--text-muted);
}

#login-form button {
  margin-top: 0.5rem;
}

.error-msg {
  margin: 0.75rem 0 0;
  color: var(--error);
  font-size: 0.875rem;
  min-height: 1.25rem;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

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

.admin-email {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 0.875rem 1.25rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Content */
.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.tab-panel {
  display: none;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.select-all-label input {
  width: 1.1rem;
  height: 1.1rem;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--surface-hover);
}

.btn-danger {
  background: #7f1d1d;
  color: #fecaca;
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

/* List */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 12px;
  border: 1px dashed var(--border);
}

/* Job cards */
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.job-card-select {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  flex-shrink: 0;
}

.job-card-select input {
  width: 1.1rem;
  height: 1.1rem;
}

.job-select-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .job-select-label {
    display: none;
  }
}

.job-card-info h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.job-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.job-card-meta span + span::before {
  content: ' · ';
}

.job-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge-inactive {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

/* Banners grid */
.banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.banner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.banner-card-image {
  aspect-ratio: 16/9;
  background: var(--bg);
  object-fit: cover;
  width: 100%;
}

.banner-card-body {
  padding: 0.75rem 1rem;
}

.banner-card-body h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.banner-card-body p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
}

.banner-card-actions {
  padding: 0.5rem 1rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
}

.image-preview {
  margin-top: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  max-height: 160px;
  background: var(--bg);
}

.image-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}

.free-plan-notice {
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.free-plan-notice p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.free-plan-notice p:last-child {
  margin-bottom: 0;
}

.free-plan-notice strong {
  color: var(--text);
}

.free-plan-notice ol {
  margin: 0.5rem 0 1rem 1.25rem;
  padding: 0;
}

.free-plan-notice li {
  margin-bottom: 0.5rem;
}

.free-plan-notice a {
  color: var(--primary);
}

.free-plan-notice code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 0.9rem 1.5rem 1.2rem;
  text-align: center;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
}

.policy-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.policy-page h1 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
}

.policy-page p {
  color: var(--text-muted);
  margin: 0.5rem 0 1rem;
}

.policy-page h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
}

.policy-page ul {
  margin: 0.25rem 0 1rem 1.25rem;
  padding: 0;
}

.policy-page li {
  margin: 0.3rem 0;
  color: var(--text-muted);
}
