:root {
  --primary:      #C9922A;
  --primary-dark: #a8761f;
  --primary-light:#F0B429;
  --danger:       #e05252;
  --success:      #2ecc71;
  --warning:      #F0B429;
  --bg:           #0a0a0a;
  --bg2:          #111111;
  --surface:      #1a1a1a;
  --surface2:     #222222;
  --border:       #2e2e2e;
  --border-gold:  rgba(201,146,42,.35);
  --text:         #f0f0f0;
  --text-muted:   #888888;
  --radius:       10px;
  --shadow:       0 2px 12px rgba(0,0,0,.5);
}

/* ── KEYWORD CHIPS ── */
.kw-chip {
  display:inline-flex;align-items:center;gap:5px;
  background:rgba(201,146,42,.15);border:1px solid var(--border-gold);
  color:var(--primary-light);border-radius:20px;
  padding:4px 10px;font-size:.78rem;
}
.kw-chip button {
  background:none;border:none;color:var(--primary-light);cursor:pointer;
  font-size:.75rem;padding:0;line-height:1;opacity:.7;
}
.kw-chip button:hover { opacity:1; color:#e05252; }

/* ── MODO CLARO ── */
[data-theme="light"] {
  --bg:           #f4f4f4;
  --bg2:          #ebebeb;
  --surface:      #ffffff;
  --surface2:     #f0f0f0;
  --border:       #d5d5d5;
  --border-gold:  rgba(201,146,42,.4);
  --text:         #1a1a1a;
  --text-muted:   #666666;
  --shadow:       0 2px 12px rgba(0,0,0,.12);
}
[data-theme="light"] .topbar { background: #fff; }
[data-theme="light"] .card   { background: #fff; }
[data-theme="light"] .modal  { background: #fff; }
[data-theme="light"] .tabs   { background: #f0f0f0; border-bottom-color: var(--border); }
[data-theme="light"] .tab-btn { color: #555; }
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select  { background: #fff; color: #1a1a1a; border-color: #ccc; }
[data-theme="light"] .ql-toolbar   { background: #f0f0f0; }
[data-theme="light"] .ql-container { background: #fff; }
[data-theme="light"] .ql-editor    { color: #1a1a1a; }
[data-theme="light"] .ql-snow .ql-stroke { stroke: #555; }
[data-theme="light"] .ql-snow .ql-fill   { fill: #555; }
[data-theme="light"] .ql-snow .ql-picker  { color: #555; }

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

html { overflow-y: scroll; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ── TOPBAR ── */
.topbar {
  background: #000;
  border-bottom: 1px solid var(--border-gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar h1 { font-size: 1rem; font-weight: 600; color: var(--text); }
.topbar button {
  background: rgba(201,146,42,.15);
  color: var(--primary-light);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: .35rem .75rem;
  cursor: pointer;
  font-size: .85rem;
  transition: background .15s;
}
.topbar button:hover { background: rgba(201,146,42,.3); }

/* ── TABS ── */
.tabs {
  display: flex;
  background: #000;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  background: none;
  border: none;
  padding: .8rem 1.2rem;
  cursor: pointer;
  font-size: .9rem;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ── MAIN CONTENT ── */
.content { padding: 1.25rem; max-width: 800px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── CARDS / SECTIONS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--primary-light);
  font-weight: 700;
  letter-spacing: .5px;
}
.card p { color: var(--text-muted); font-size: .85rem; margin-bottom: .75rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: .35rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .8px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="url"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .55rem .75rem;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface2);
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}
input::placeholder, textarea::placeholder { color: #444; }
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--surface2); }
/* Ícono de calendario en dark/light mode */
input[type="date"], input[type="time"] { color-scheme: dark; }
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"] { color-scheme: light; }

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

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  letter-spacing: .3px;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #000;
}
.btn-primary:hover { opacity: .9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-success { background: var(--success); color: #000; }
.btn-warning { background: var(--warning); color: #000; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── ALERTS ── */
.alert {
  padding: .75rem 1rem;
  border-radius: 7px;
  font-size: .9rem;
  margin-bottom: 1rem;
}
.alert-error   { background: rgba(220,53,69,.15);  color: #f88; border: 1px solid rgba(220,53,69,.3); }
.alert-success { background: rgba(46,204,113,.12); color: #5ddb8c; border: 1px solid rgba(46,204,113,.3); }

/* ── FOTO GRID ── */
.foto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.foto-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: grab;
}
.foto-item:active { cursor: grabbing; }
.foto-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-item .foto-del {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 28px;
  text-align: center;
}
.foto-item .drag-handle {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.8);
  font-size: .7rem;
  background: rgba(0,0,0,.5);
  padding: 2px 6px;
  border-radius: 4px;
}
.foto-counter { font-size: .85rem; color: var(--text-muted); margin-bottom: .75rem; }
.sortable-ghost { opacity: .4; }

/* ── HORARIOS ── */
.horario-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 90px;
  align-items: center;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.horario-row:last-child { border-bottom: none; }
.horario-row .dia-label { font-weight: 600; font-size: .9rem; color: var(--text); }
.horario-row input[type="time"] { padding: .4rem .5rem; }
.horario-row .cerrado-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.horario-row input[type="checkbox"] { width: auto; accent-color: var(--primary); }

/* ── PROMO / BANNER CARDS ── */
.item-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.item-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem;
  background: var(--surface2);
}
.item-card img {
  width: 70px; height: 70px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg2);
}
.item-card .item-info { flex: 1; min-width: 0; }
.item-card .item-title { font-weight: 600; font-size: .95rem; margin-bottom: .2rem; color: var(--text); }
.item-card .item-dates { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.item-card .item-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-active   { background: rgba(46,204,113,.2);  color: #5ddb8c; }
.badge-inactive { background: rgba(240,180,41,.15); color: var(--primary-light); }
.badge-expired  { background: rgba(220,53,69,.2);   color: #f88; }

/* ── FILE UPLOAD ── */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .9rem;
  transition: border-color .15s, background .15s;
}
.file-upload-area:hover { border-color: var(--primary); background: rgba(201,146,42,.05); }
.file-upload-area input[type="file"] { display: none !important; }
.file-upload-area .preview-img {
  max-width: 200px;
  max-height: 120px;
  border-radius: 6px;
  margin: .5rem auto 0;
  display: block;
  object-fit: contain;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ── SPINNER ── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(201,146,42,.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MODAL ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}
.modal h3 { margin-bottom: 1.25rem; font-size: 1.1rem; color: var(--primary-light); }
.modal-footer {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* ── LOGO PLACEHOLDER ── */
#logoPlaceholder {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  color: #000 !important;
}

/* ── QUILL EDITOR ── */
.ql-toolbar { background: var(--surface2) !important; border-color: var(--border) !important; }
.ql-toolbar .ql-stroke { stroke: var(--text-muted) !important; }
.ql-toolbar .ql-fill { fill: var(--text-muted) !important; }
.ql-toolbar button:hover .ql-stroke { stroke: var(--primary-light) !important; }
.ql-toolbar .ql-picker-label { color: var(--text-muted) !important; }
.ql-container { background: var(--surface2) !important; border-color: var(--border) !important; color: var(--text) !important; }
.ql-editor.ql-blank::before { color: #444 !important; }

/* ── REDES SOCIALES ICONS ── */
.red-facebook  { color: #1877f2; }
.red-instagram { color: #e1306c; }
.red-youtube   { color: #ff0000; }
.red-tiktok    { color: #f0f0f0; }

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .row-2 { grid-template-columns: 1fr; }
  .horario-row { grid-template-columns: 75px 1fr 1fr; }
  .horario-row .cerrado-wrap { grid-column: 1 / -1; }
  .item-card { flex-direction: column; }
  .item-card img { width: 100%; height: 160px; }
}
