:root {
  --bg: #120a1a;
  --panel: #1e1430;
  --border: rgba(212,160,82,0.2);
  --gold: #d4a052;
  --gold-soft: #e8c98a;
  --text: #f3e9dc;
  --dim: #a89a8a;
  --danger: #c44;
  --love: #b5384d;
  --money: #3f7d5c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Jost', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px 32px;
}

.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-card > p { color: var(--dim); font-size: 14px; margin-bottom: 24px; }

label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dim);
  margin-bottom: 6px;
}

input, textarea, select {
  width: 100%;
  background: #0f0818;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 14px;
}

textarea { resize: vertical; }

.btn {
  background: var(--gold);
  color: #1a0f0a;
  border: none;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 4px;
  cursor: pointer;
}

.btn:hover { background: var(--gold-soft); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gold-soft);
  padding: 9px 16px;
  font-family: inherit;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-outline:hover { border-color: var(--gold); }

.hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--dim);
  text-align: center;
}

.hint code {
  background: #0f0818;
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--gold-soft);
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--dim);
  text-decoration: none;
}

.form-msg { font-size: 13px; margin: 8px 0; }
.form-msg.error { color: #e88; }
.form-msg.ok { color: #8d8; }

/* Admin panel */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.admin-header h1 { font-size: 22px; }
.admin-header p { font-size: 13px; color: var(--dim); }

.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.role-badge {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
}

.role-badge.super {
  color: #f4d9a0;
  background: rgba(212,160,82,0.15);
  border-color: rgba(212,160,82,0.4);
}

.role-badge.editor {
  color: #a8d4f0;
  background: rgba(80,140,200,0.15);
  border-color: rgba(80,140,200,0.35);
}

.role-pill {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
}

.role-pill.super { background: rgba(212,160,82,0.2); color: #f4d9a0; }
.role-pill.editor { background: rgba(80,140,200,0.2); color: #a8d4f0; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 28px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 28px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-nav-link {
  color: var(--dim);
  padding: 12px 20px;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.admin-nav-link:hover { color: var(--gold-soft); }

.admin-nav-link.active {
  color: var(--gold-soft);
  border-bottom-color: var(--gold);
}

.readonly-banner {
  background: rgba(80, 140, 200, 0.15);
  border: 1px solid rgba(80, 140, 200, 0.35);
  color: #a8d4f0;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 13px;
}

.settings-form.wide { max-width: 640px; }

.image-upload-block {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.image-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

.file-label {
  cursor: pointer;
  display: inline-block;
  margin: 0;
}

.image-preview {
  min-height: 120px;
  border-radius: 4px;
  overflow: hidden;
  background: #0f0818;
  border: 1px solid var(--border);
}

.image-preview-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

.image-preview-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.table-thumb {
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f0818;
}

.table-thumb.empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 12px;
}

.table-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.social-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.social-admin-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  background: #120a1e;
}

.social-admin-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.social-admin-head h3 {
  font-size: 16px;
  margin: 0;
}

.social-admin-icon-preview,
.social-admin-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(212,160,82,0.12);
  border: 1px solid var(--border);
  overflow: hidden;
}

.social-admin-icon-preview svg,
.social-admin-icon svg {
  width: 20px;
  height: 20px;
}

.social-admin-icon-preview .social-icon-img {
  width: 24px;
  height: 24px;
}

.role-pill.viewer { background: rgba(120,120,140,0.2); color: #c8c8d8; }

.role-badge.viewer {
  color: #c8c8d8;
  background: rgba(120,120,140,0.15);
  border-color: rgba(120,120,140,0.35);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--dim);
  padding: 12px 20px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--gold-soft);
  border-bottom-color: var(--gold);
}

.admin-main {
  padding: 28px;
  max-width: 1200px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.panel-bar h2 { font-size: 20px; }

.panel-note {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 20px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: #0f0818;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:last-child td { border-bottom: none; }

.clip {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions { white-space: nowrap; }

.btn-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gold-soft);
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  margin-right: 4px;
}

.btn-sm.danger { border-color: rgba(204,68,68,0.5); color: #e88; }

.pill {
  display: inline-block;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.pill.love { background: rgba(181,56,77,0.25); color: #f4c3ce; }
.pill.money { background: rgba(63,125,92,0.25); color: #c9ecd9; }
.pill.limpia { background: rgba(212,160,82,0.2); color: #e8dcc0; }

.settings-form {
  max-width: 420px;
  margin-top: 16px;
}

.settings-form h3 { margin-top: 32px; margin-bottom: 8px; font-size: 17px; }

.field-hint { font-size: 12px; color: var(--dim); margin: -8px 0 14px; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 16px;
}

.checkbox-label input { width: auto; margin: 0; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}

.modal[hidden] { display: none; }

.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-box h3 { margin-bottom: 18px; font-size: 18px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .admin-header, .tabs, .admin-main { padding-left: 16px; padding-right: 16px; }
}
