/* ============================================================
   ISC Recrutare — Admin Dashboard Dark Theme
   Colors: bg #0f1117 | sidebar #161822 | border #2a2d3a
           text #e1e4ea | muted #6b7280 | accent #2563eb | active #60a5fa
   ============================================================ */

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

#app {
  display: flex;
  min-height: 100vh;
}

body {
  font-family: 'Inter', sans-serif;
  background: #0f1117;
  color: #e1e4ea;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #161822;
  border-right: 1px solid #2a2d3a;
  padding: 24px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  min-width: 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid #2a2d3a;
  margin-bottom: 16px;
}

.logo h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.logo span {
  font-size: 12px;
  color: #6b7280;
}

.nav-section {
  padding: 8px 16px;
}

.nav-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding: 0 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #9ca3af;
  transition: all 0.15s;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  background: #1e2130;
  color: #e1e4ea;
}

.nav-item.active {
  background: #2563eb20;
  color: #60a5fa;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.header-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-outline {
  background: transparent;
  color: #9ca3af;
  border: 1px solid #2a2d3a;
}

.btn-outline:hover {
  border-color: #4b5563;
  color: #e1e4ea;
}

.btn-danger {
  background: #dc262620;
  color: #f87171;
  border: 1px solid #dc262640;
}

.btn-danger:hover {
  background: #dc262630;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
  background: #161822;
  border: 1px solid #2a2d3a;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.section-desc {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
}

.form-input {
  background: #0f1117;
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  padding: 10px 14px;
  color: #e1e4ea;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: #2563eb;
}

.form-input::placeholder {
  color: #4b5563;
}

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

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============================================================
   COLOR SWATCHES
   ============================================================ */

.color-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #2a2d3a;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #2563eb40;
}

.color-hex {
  width: 100px;
}

/* ============================================================
   PAGE CARDS
   ============================================================ */

.page-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-card {
  background: #0f1117;
  border: 1px solid #2a2d3a;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.page-card:hover {
  border-color: #4b5563;
}

.page-card.active {
  border-color: #2563eb;
  background: #2563eb10;
}

.page-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #2563eb20;
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.page-info {
  flex: 1;
  min-width: 0;
}

.page-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-info p {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.page-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #2a2d3a;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}

.page-action-btn:hover {
  border-color: #4b5563;
  color: #e1e4ea;
}

.page-action-btn.danger:hover {
  border-color: #dc2626;
  color: #f87171;
}

.add-page {
  border: 2px dashed #2a2d3a;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  transition: all 0.15s;
  background: transparent;
  width: 100%;
  font-family: inherit;
}

.add-page:hover {
  border-color: #4b5563;
  color: #e1e4ea;
}

.add-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   EDITOR SPLIT LAYOUT
   ============================================================ */

.editor-split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

/* ============================================================
   PREVIEW PHONE
   ============================================================ */

.preview-panel {
  position: sticky;
  top: 20px;
}

.preview-strip {
  background: #161822;
  border: 1px solid #2a2d3a;
  border-radius: 12px;
  padding: 16px;
}

.preview-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-align: center;
}

.preview-phone {
  width: 260px;
  height: 520px;
  margin: 0 auto;
  background: #0a0b0f;
  border-radius: 24px;
  border: 2px solid #2a2d3a;
  overflow: hidden;
  position: relative;
}

.preview-phone iframe {
  width: 100%;
  height: 100%;
  border: none;
  transform-origin: top left;
}

.preview-refresh {
  margin-top: 10px;
  width: 100%;
}

/* ============================================================
   TOGGLES
   ============================================================ */

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #1e2130;
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-info h4 {
  font-size: 14px;
  color: #e1e4ea;
  font-weight: 500;
}

.toggle-info p {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #2a2d3a;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: none;
}

.toggle.on {
  background: #2563eb;
}

.toggle-knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  pointer-events: none;
}

.toggle.on .toggle-knob {
  transform: translateX(20px);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}

.status.live {
  background: #06543420;
  color: #34d399;
}

.status.draft {
  background: #92400e20;
  color: #fbbf24;
}

.status.verified {
  background: #06543420;
  color: #34d399;
}

.status.unverified {
  background: #92400e20;
  color: #fbbf24;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status.live .status-dot { background: #34d399; }
.status.draft .status-dot { background: #fbbf24; }
.status.verified .status-dot { background: #34d399; }
.status.unverified .status-dot { background: #fbbf24; }

/* ============================================================
   KPI CARDS
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #161822;
  border: 1px solid #2a2d3a;
  border-radius: 12px;
  padding: 20px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 13px;
  color: #6b7280;
}

.kpi-change {
  font-size: 12px;
  margin-top: 4px;
}

.kpi-change.up { color: #34d399; }
.kpi-change.down { color: #f87171; }

/* ============================================================
   TABLES
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  background: #0f1117;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid #2a2d3a;
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid #1e2130;
  color: #e1e4ea;
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: #1e213060;
}

.table .muted {
  color: #6b7280;
  font-size: 13px;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  align-items: center;
}

.pagination-info {
  font-size: 13px;
  color: #6b7280;
  margin: 0 8px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1117;
  padding: 24px;
}

.login-card {
  background: #161822;
  border: 1px solid #2a2d3a;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.login-card p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form .form-group {
  gap: 6px;
}

.login-submit {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 15px;
}

.login-error {
  background: #dc262620;
  border: 1px solid #dc262640;
  color: #f87171;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}

.login-logo {
  font-size: 22px;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 24px;
}

/* ============================================================
   TOAST
   ============================================================ */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1e2130;
  border: 1px solid #2a2d3a;
  color: #e1e4ea;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  min-width: 220px;
  max-width: 360px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success {
  border-color: #34d39940;
  color: #34d399;
}

.toast.error {
  border-color: #f8717140;
  color: #f87171;
}

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

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast.removing {
  animation: slideOut 0.2s ease forwards;
}

/* ============================================================
   LOADING
   ============================================================ */

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #2a2d3a;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}

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

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 16px;
  color: #6b7280;
  font-size: 14px;
}

/* ============================================================
   DNS INFO BOX
   ============================================================ */

.info-box {
  background: #0f1117;
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #60a5fa;
}

.info-box p {
  margin-bottom: 6px;
  color: #9ca3af;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

.dns-row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #2a2d3a;
  font-size: 13px;
}

.dns-row:last-child { border-bottom: none; }

.dns-type {
  background: #2563eb20;
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.dns-value {
  font-family: monospace;
  color: #e1e4ea;
}

/* ============================================================
   DOMAIN VERIFY RESULT
   ============================================================ */

.verify-result {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-top: 12px;
}

.verify-result.success {
  background: #06543420;
  border: 1px solid #34d39940;
  color: #34d399;
}

.verify-result.error {
  background: #dc262620;
  border: 1px solid #dc262640;
  color: #f87171;
}

/* ============================================================
   SUBSCRIPTION CARD
   ============================================================ */

.plan-card {
  background: #0f1117;
  border: 1px solid #2563eb40;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.plan-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.plan-detail {
  font-size: 13px;
  color: #6b7280;
}

/* ============================================================
   PERIOD SELECTOR
   ============================================================ */

.period-selector {
  display: flex;
  gap: 0;
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  overflow: hidden;
}

.period-btn {
  padding: 8px 16px;
  font-size: 13px;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.period-btn:hover { background: #1e2130; color: #e1e4ea; }
.period-btn.active { background: #2563eb; color: #fff; }

/* ============================================================
   EMPTY STATE
   ============================================================ */

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

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 16px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}

/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
  border: none;
  border-top: 1px solid #2a2d3a;
  margin: 20px 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .sidebar {
    width: 220px;
  }

  .main {
    padding: 20px;
  }

  .editor-split {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full {
    grid-column: 1;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 16px 0;
  }

  .logo {
    padding: 0 16px 16px;
  }

  .main {
    padding: 16px;
  }

  .header {
    flex-direction: column;
    gap: 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .plan-card {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* ── ASPECT RATIO BUTTONS ── */
.btn-aspect {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid #2a2d3a;
  background: #1a1d2a;
  color: #8b8fa8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-aspect:hover {
  border-color: #3b4060;
  color: #c8cad8;
}
.btn-aspect.active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
  color: #60a5fa;
}

/* ── EMAIL TAB ── */
.email-status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.email-badge-ok { background: rgba(37,211,102,0.15); color: #25D366; }
.email-badge-pending { background: rgba(255,193,7,0.15); color: #ffc107; }
.email-error-text { color: #ef4444; font-size: 13px; margin-bottom: 12px; }
.form-hint { font-size: 11px; color: #6b7280; margin-top: 4px; }
.email-html-editor {
  font-family: monospace;
  font-size: 12px;
  background: rgba(0,0,0,0.3);
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 10px;
  width: 100%;
  resize: vertical;
  min-height: 180px;
}
