/* ── Pardo Clothes Creative Studio — tema oscuro premium ───────── */

:root {
  --bg: #070b16;
  --bg-2: #0a1020;
  --panel: #0e1628;
  --panel-2: #121c33;
  --border: #1d2a47;
  --border-soft: #16213a;
  --text: #e8eef9;
  --muted: #8a96b0;
  --accent: #29c5ff;
  --accent-2: #3b82f6;
  --accent-soft: rgba(41, 197, 255, 0.12);
  --danger: #ff5d6c;
  --warn: #ffb347;
  --ok: #3ddc97;
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 248px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(41, 197, 255, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; color: var(--muted); }

/* ── Sidebar ───────────────────────────────────────────────────── */

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-2), #080d1a);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  padding: 22px 14px;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #04101e;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 18px rgba(41, 197, 255, 0.35);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.3px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 13.5px;
  transition: all 0.15s ease;
}
.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-ico { width: 18px; text-align: center; opacity: 0.85; }

.badge {
  margin-left: auto; background: var(--accent); color: #04101e;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
}

.sidebar-footer { display: flex; flex-direction: column; gap: 8px; padding: 12px 8px 0; }
.mode-chip, .health-chip {
  font-size: 11px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--muted);
  background: var(--panel);
  overflow-wrap: anywhere;
}
.mode-chip.mock { color: var(--warn); border-color: rgba(255, 179, 71, 0.4); }
.mode-chip.real { color: var(--ok); border-color: rgba(61, 220, 151, 0.35); }
.health-chip.ok { color: var(--ok); }
.health-chip.bad { color: var(--danger); }

/* ── Layout principal ──────────────────────────────────────────── */

.main { margin-left: var(--sidebar-w); padding: 28px 34px 60px; max-width: 1500px; }

.topbar { margin-bottom: 26px; }
.app-title { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.app-subtitle { color: var(--muted); font-size: 12.5px; letter-spacing: 1.2px; text-transform: uppercase; margin-top: 3px; }

.page { display: none; animation: fadeIn 0.2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Cards ─────────────────────────────────────────────────────── */

.card {
  background: linear-gradient(180deg, var(--panel), rgba(14, 22, 40, 0.7));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin-bottom: 0; }
.card-head.standalone { margin-bottom: 18px; }
.row-gap { display: flex; align-items: center; gap: 10px; }

/* ── Métricas Overview ─────────────────────────────────────────── */

.metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.metric-card {
  background: linear-gradient(180deg, var(--panel), rgba(14, 22, 40, 0.6));
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.metric-card:hover { border-color: var(--border); transform: translateY(-1px); }
.metric-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.metric-value { font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--text); }
.metric-value.accent { color: var(--accent); }
.metric-extra { font-size: 12px; color: var(--muted); margin-top: 2px; }

.chart-card canvas { width: 100%; }

/* ── Empty states ──────────────────────────────────────────────── */

.empty-state {
  text-align: center; padding: 46px 20px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: rgba(14, 22, 40, 0.4);
}
.empty-ico { font-size: 30px; margin-bottom: 10px; opacity: 0.8; }

/* ── Formularios ───────────────────────────────────────────────── */

label { display: block; font-size: 12.5px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
label.req::after { content: ' *'; color: var(--accent); }
label:first-child { margin-top: 0; }

input[type="text"], input[type="password"], input[type="number"], input[type="time"],
input[type="date"], input[type="datetime-local"], textarea, select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent-2); }
textarea { resize: vertical; }
select { cursor: pointer; }
input[readonly] { opacity: 0.85; }

.checkbox-inline { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 12px 0 6px; }
.checkbox-inline input { width: auto; accent-color: var(--accent); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ── Botones ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover:not(:disabled) { border-color: var(--accent-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border: none; color: #04101e;
  box-shadow: 0 4px 16px rgba(41, 197, 255, 0.25);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-secondary { border-color: var(--accent-2); color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(255, 93, 108, 0.5); color: var(--danger); }
.btn-lg { width: 100%; padding: 13px; font-size: 14px; margin-top: 18px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ── Dropzones ─────────────────────────────────────────────────── */

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(10, 16, 32, 0.5);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dz-inner { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.dz-ico { font-size: 16px; color: var(--accent); }
.dz-previews { display: flex; gap: 8px; flex-wrap: wrap; }
.dz-previews:not(:empty) { margin-top: 10px; }
.dz-thumb { position: relative; }
.dz-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border); }
.dz-thumb .dz-remove {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none;
  font-size: 10px; cursor: pointer; line-height: 1;
}

.form-result {
  margin-top: 16px; padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-2); font-size: 13px;
}
.form-result.ok { border-color: rgba(61, 220, 151, 0.4); }
.form-result.warn { border-color: rgba(255, 179, 71, 0.4); }
.form-result.err { border-color: rgba(255, 93, 108, 0.4); }

/* ── Tabs ──────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  background: var(--panel); border: 1px solid var(--border-soft);
  color: var(--muted); padding: 9px 20px; border-radius: 99px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: all 0.15s ease;
}
.tab.active {
  color: #04101e;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: transparent;
}

/* ── Human Review ──────────────────────────────────────────────── */

.review-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.manual-task { display: flex; gap: 8px; margin-bottom: 12px; }

.task-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.task-item {
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 12px 14px; cursor: pointer; transition: all 0.15s ease;
  background: rgba(10, 16, 32, 0.4);
}
.task-item:hover { border-color: var(--border); }
.task-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.task-item-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-item-meta { display: flex; gap: 8px; margin-top: 6px; align-items: center; flex-wrap: wrap; }

.status-pill {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 9px; border-radius: 99px; border: 1px solid var(--border);
  color: var(--muted);
}
.status-pill.blocked { color: var(--warn); border-color: rgba(255, 179, 71, 0.45); background: rgba(255, 179, 71, 0.08); }
.status-pill.in_progress, .status-pill.doing { color: var(--accent); border-color: rgba(41, 197, 255, 0.4); }
.status-pill.done { color: var(--ok); border-color: rgba(61, 220, 151, 0.4); }

.task-id-mono { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }

.detail-section { margin-top: 18px; }
.detail-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 8px; }
.detail-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fact { background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px 12px; }
.fact .k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.fact .v { font-size: 13px; font-weight: 600; margin-top: 2px; word-break: break-all; }
.fact .v.cost { color: var(--accent); }

.comments { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.comment {
  background: var(--bg-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
.comment .c-author { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.comment .c-time { font-size: 10.5px; color: var(--muted); margin-left: 8px; }
.comment .c-text { margin-top: 4px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }

.action-box { background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px; margin-top: 10px; }
.raw-details { margin-top: 12px; }
.raw-details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.raw-details pre { margin-top: 8px; max-height: 220px; overflow: auto; background: var(--bg-2); padding: 10px; border-radius: 8px; }

/* ── Archivos ──────────────────────────────────────────────────── */

.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.files-grid.compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); max-height: 55vh; overflow-y: auto; }

.file-card {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.15s ease;
}
.file-card:hover { border-color: var(--border); transform: translateY(-2px); }
.file-thumb {
  height: 170px; background: var(--bg-2);
  display: grid; place-items: center; cursor: pointer; overflow: hidden;
  color: var(--muted); font-size: 28px;
}
.files-grid.compact .file-thumb { height: 110px; }
.file-thumb img, .file-thumb video { width: 100%; height: 100%; object-fit: cover; }
.file-body { padding: 12px 14px; }
.file-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.file-actions { display: flex; gap: 6px; padding: 0 12px 12px; flex-wrap: wrap; }
.tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 1px 7px; border-radius: 99px; letter-spacing: 0.4px;
  background: var(--accent-soft); color: var(--accent);
}
.tag.assets { background: rgba(255, 179, 71, 0.12); color: var(--warn); }

/* ── Publicar / Programación ───────────────────────────────────── */

.publish-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.asset-pick { display: flex; gap: 8px; }
.pub-preview { margin-top: 10px; }
.pub-preview img, .pub-preview video { max-height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.list-item {
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 8px; background: rgba(10, 16, 32, 0.4);
}
.list-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-item-title { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list-item p { font-size: 12px; color: var(--muted); margin-top: 4px; word-break: break-all; }

/* ── Ajustes ───────────────────────────────────────────────────── */

.settings-card { max-width: 1000px; }
.settings-sub { margin: 22px 0 4px; font-size: 13px; color: var(--muted); }
#formSettings .btn-primary { margin-top: 22px; }

/* ── Modales ───────────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 14, 0.8); backdrop-filter: blur(3px); }
.modal-box {
  position: relative; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; max-width: min(860px, 92vw); max-height: 88vh; overflow: auto;
}
.modal-wide { width: min(1000px, 94vw); }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
}
.modal-box img, .modal-box video { max-width: 100%; max-height: 68vh; border-radius: var(--radius-sm); }
.modal-box pre { max-height: 60vh; overflow: auto; color: var(--text); }
.modal-caption { margin-top: 10px; font-size: 12px; color: var(--muted); word-break: break-all; }

/* ── Toasts ────────────────────────────────────────────────────── */

.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--panel-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: 13px; max-width: 380px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  animation: slideIn 0.2s ease;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast.ok { border-left-color: var(--ok); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .form-grid, .publish-layout, .review-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: static; width: 100%; flex-direction: row; align-items: center; padding: 10px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .sidebar-footer, .brand-sub { display: none; }
  .main { margin-left: 0; padding: 18px; }
}
