/* =========================================================
   THE EXECUTIVE COACH — Admin Panel Styles
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  background: #0d0d0d;
  color: #e0e0e0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Auth Screen --- */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}
.auth-box {
  width: 100%;
  max-width: 400px;
  padding: 48px 40px;
  background: #111;
  border: 1px solid #1e1e1e;
}
.auth-logo {
  display: block;
  height: 56px;
  width: auto;
  margin: 0 auto 32px;
  object-fit: contain;
}
.auth-box h1 {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #d4af37;
  text-align: center;
  margin-bottom: 8px;
  font-family: 'Cinzel', serif;
}
.auth-box p {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  margin-bottom: 32px;
}
.auth-error {
  background: rgba(220,53,69,0.15);
  border: 1px solid rgba(220,53,69,0.3);
  color: #ff6b7a;
  padding: 10px 14px;
  font-size: 0.8rem;
  margin-bottom: 16px;
  display: none;
}
.auth-error.show { display: block; }
.auth-success {
  background: rgba(39,174,96,0.12);
  border: 1px solid rgba(39,174,96,0.3);
  color: #27ae60;
  padding: 10px 14px;
  font-size: 0.8rem;
  margin-bottom: 16px;
  border-radius: 4px;
  display: block;
}

/* --- Form fields (shared) --- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field input[type="email"],
.field input[type="color"],
.field textarea,
.field select {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  color: #e0e0e0;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.2s;
  resize: vertical;
  appearance: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: #d4af37;
}
.field textarea { min-height: 80px; }
.field input[type="color"] {
  height: 44px;
  padding: 4px 6px;
  cursor: pointer;
}
.field small {
  display: block;
  font-size: 0.72rem;
  color: #555;
  margin-top: 4px;
}

/* --- Buttons (shared) --- */
.btn-admin {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-family: 'Cinzel', serif;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-gold {
  background: #d4af37;
  color: #000;
}
.btn-gold:hover { background: #c9a82e; }
.btn-outline-admin {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #aaa;
}
.btn-outline-admin:hover { border-color: #d4af37; color: #d4af37; }
.btn-danger {
  background: transparent;
  border: 1px solid rgba(220,53,69,0.4);
  color: #ff6b7a;
}
.btn-danger:hover { background: rgba(220,53,69,0.1); }
.btn-sm { padding: 7px 16px; font-size: 0.65rem; }

/* --- Admin Layout --- */
#admin-screen { display: none; height: 100vh; }
#admin-screen.active { display: flex; }

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #080808;
  border-right: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #1a1a1a;
}
.sidebar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 12px;
}
.sidebar-title {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d4af37;
  font-family: 'Cinzel', serif;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}
.nav-group-title {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #444;
  padding: 12px 20px 6px;
}
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 20px;
  background: none;
  border: none;
  color: #888;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.nav-item:hover { color: #ccc; background: #111; }
.nav-item.active { color: #d4af37; border-left-color: #d4af37; background: #0f0f0f; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- Admin Main --- */
.admin-main {
  flex: 1;
  overflow-y: auto;
  background: #0d0d0d;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #080808;
  border-bottom: 1px solid #1a1a1a;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-title {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #aaa;
  font-family: 'Cinzel', serif;
}
.topbar-actions { display: flex; gap: 10px; }

.admin-panel {
  display: none;
  padding: 40px 32px;
  max-width: 900px;
}
.admin-panel.active { display: block; }

.panel-section {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid #1a1a1a;
}
.panel-section:last-child { border-bottom: none; }
.panel-section h3 {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d4af37;
  font-family: 'Cinzel', serif;
  margin-bottom: 24px;
}

/* --- Color Grid --- */
.colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.color-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #111;
  border: 1px solid #1e1e1e;
}
.color-field input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 2px;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}
.color-field label {
  font-size: 0.75rem;
  color: #999;
  display: block;
}
.color-field span {
  font-size: 0.7rem;
  color: #555;
  font-family: monospace;
}

/* --- Toggle --- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #161616;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 0.85rem; color: #bbb; }
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #222;
  cursor: pointer;
  border-radius: 24px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #555;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(212,175,55,0.3); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #d4af37;
}

/* --- Image field --- */
.image-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  margin-bottom: 8px;
  border: 1px solid #1e1e1e;
  display: none;
}
.image-preview.show { display: block; }
.image-field-row { display: flex; gap: 8px; }
.image-field-row input { flex: 1; }

/* --- List editor --- */
.list-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.list-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.list-item-row input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  color: #e0e0e0;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-family: inherit;
}
.list-item-row input:focus { outline: none; border-color: #d4af37; }
.list-item-remove {
  background: none;
  border: none;
  color: #444;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  transition: color 0.2s;
}
.list-item-remove:hover { color: #ff6b7a; }

/* --- Toast --- */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1a1a;
  border: 1px solid #d4af37;
  color: #d4af37;
  padding: 14px 24px;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.error { border-color: #ff6b7a; color: #ff6b7a; background: #1a0a0a; }

/* --- Tabs (inline) --- */
.inner-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid #1e1e1e; }
.inner-tab {
  padding: 8px 20px;
  background: none;
  border: none;
  color: #666;
  font-size: 0.75rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: all 0.2s;
}
.inner-tab.active { color: #d4af37; border-bottom-color: #d4af37; }

/* --- Responsive --- */
@media (max-width: 700px) {
  .admin-sidebar { width: 180px; }
  .admin-panel { padding: 24px 16px; }
}
