/* ix.VANADS — Main CSS — Dark Premium Theme */

:root {
  --ix-bg:        #0a0d12;
  --ix-surface:   #0f1520;
  --ix-surface2:  #151d2b;
  --ix-card-bg:   #131b27;
  --ix-border:    #1e2d40;
  --ix-gold:      #A3834A;
  --ix-gold-light:#D9BD7C;
  --ix-gold-faint:#FBE0A2;
  --ix-text:      #e8ecf0;
  --ix-muted:     #6b7a8d;
  --ix-accent:    #1B2B30;
  --ix-green:     #2d6a4f;
  --ix-amber:     #7a5c2a;
  --ix-purple:    #6f42c1;
  --ix-purple-light: #9d6fe8;
  --ix-navbar-h:  60px;
  --ix-sidebar-w: 220px;
  --ix-radius:    10px;
}

/* ── Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--ix-bg);
  color: var(--ix-text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.gold { color: var(--ix-gold) !important; }
.gold-link { color: var(--ix-gold-light); text-decoration: none; }
.gold-link:hover { color: var(--ix-gold-faint); }

/* ── Navbar ─────────────────────────────────────────── */
.ix-navbar {
  background: #080b10 !important;
  border-bottom: 1px solid var(--ix-border);
  height: var(--ix-navbar-h);
  z-index: 1040;
}

.ix-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  letter-spacing: .5px;
  color: var(--ix-text) !important;
}

.ix-dropdown {
  background: var(--ix-surface2);
  border: 1px solid var(--ix-border);
  border-radius: var(--ix-radius);
  min-width: 180px;
}
.ix-dropdown .dropdown-item {
  color: var(--ix-text);
  font-size: .875rem;
  padding: .4rem 1rem;
}
.ix-dropdown .dropdown-item:hover {
  background: var(--ix-border);
  color: var(--ix-gold-light);
}

/* ── Layout ─────────────────────────────────────────── */
.ix-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--ix-navbar-h);
}

.ix-sidebar {
  width: var(--ix-sidebar-w);
  background: var(--ix-surface);
  border-right: 1px solid var(--ix-border);
  position: fixed;
  top: var(--ix-navbar-h);
  left: 0;
  height: calc(100vh - var(--ix-navbar-h));
  overflow-y: auto;
  padding: 1.5rem 0;
  z-index: 900;
}

.ix-main {
  margin-left: var(--ix-sidebar-w);
  flex: 1;
  min-height: calc(100vh - var(--ix-navbar-h));
  background: var(--ix-bg);
}

.ix-content {
  padding: 2rem;
  max-width: 1400px;
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar-section { margin-bottom: 1.5rem; }

.sidebar-label {
  font-size: .65rem;
  letter-spacing: 1.5px;
  color: var(--ix-muted);
  text-transform: uppercase;
  padding: 0 1rem .5rem;
}
a.sidebar-label-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s;
}
a.sidebar-label-link:hover,
a.sidebar-label-link.active {
  color: var(--ix-gold-light);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  color: var(--ix-muted);
  text-decoration: none;
  font-size: .85rem;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar-link:hover, .sidebar-link.active {
  color: var(--ix-gold-light);
  background: rgba(163, 131, 74, .08);
  border-left-color: var(--ix-gold);
}

/* ── Sidebar hierarchy: MetaCampaign group ───────────── */
.sidebar-mc-group {
  margin-bottom: .25rem;
}
.sidebar-mc-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem 1rem .2rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ix-muted);
  opacity: .85;
  letter-spacing: .03em;
}
.sidebar-mc-badge {
  font-size: .6rem;
  background: rgba(163,131,74,.2);
  color: var(--ix-gold-light);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: auto;
}
.sidebar-link-sub {
  padding-left: 2rem;
  font-size: .82rem;
  border-left-width: 2px;
}

/* ── Layer Chips (L0-L6) ─────────────────────────────── */
.layer-chip {
  border-radius: 6px !important;
  overflow: hidden;
}
.layer-chip--active {
  border-color: var(--ix-gold) !important;
}
.layer-chip--empty {
  border-color: var(--ix-border) !important;
  opacity: .75;
}
/* JOB318: best-guess gold glow border */
.layer-chip--best {
  border-color: var(--ix-gold) !important;
  box-shadow: 0 0 0 2px rgba(163,131,74,.4), inset 0 0 8px rgba(163,131,74,.08) !important;
}
.layer-chip-placeholder {
  height: 72px;
  background: rgba(255,255,255,.04);
}
.layer-chip-img {
  object-fit: cover;
  width: 100%;
}
.layer-chip-text-preview {
  min-height: 72px;
  background: rgba(255,255,255,.04);
  border-radius: 4px 4px 0 0;
}
.layer-drop-hover {
  border-color: var(--ix-gold) !important;
  box-shadow: 0 0 0 2px rgba(163,131,74,.45) !important;
  opacity: 1 !important;
}
.asset-lib-card {
  cursor: grab;
  transition: border-color .15s, box-shadow .15s;
}
.asset-lib-card:hover {
  border-color: var(--ix-gold) !important;
}

/* ── Cards ──────────────────────────────────────────── */
.ix-card {
  background: var(--ix-surface) !important;
  border: 1px solid var(--ix-border) !important;
  border-radius: var(--ix-radius) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.ix-card-header {
  background: var(--ix-surface2) !important;
  border-bottom: 1px solid var(--ix-border) !important;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ix-text);
  padding: .75rem 1rem;
}

.ix-card-footer {
  background: transparent;
  border-top: 1px solid var(--ix-border);
  padding: .5rem 1rem;
  font-size: .75rem;
}

.campaign-card:hover {
  border-color: var(--ix-gold) !important;
  transform: translateY(-1px);
  transition: all .2s;
}

.campaign-icon { font-size: 1.5rem; }

/* ── Buttons ────────────────────────────────────────── */
.ix-btn-gold {
  background: var(--ix-gold);
  border: 1px solid var(--ix-gold);
  color: #0a0d12;
  font-weight: 600;
  border-radius: 6px;
  transition: all .15s;
}
.ix-btn-gold:hover {
  background: var(--ix-gold-light);
  border-color: var(--ix-gold-light);
  color: #0a0d12;
}
.ix-btn-gold:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ix-btn-outline {
  background: transparent;
  border: 1px solid var(--ix-border);
  color: var(--ix-text);
  border-radius: 6px;
  transition: all .15s;
}
.ix-btn-outline:hover {
  border-color: var(--ix-gold);
  color: var(--ix-gold-light);
}

/* ── Forms ──────────────────────────────────────────── */
.ix-input {
  background: var(--ix-surface2) !important;
  border: 1px solid var(--ix-border) !important;
  color: var(--ix-text) !important;
  border-radius: 6px !important;
  font-size: .875rem !important;
}
.ix-input:focus {
  border-color: var(--ix-gold) !important;
  box-shadow: 0 0 0 2px rgba(163,131,74,.2) !important;
}
.ix-input::placeholder { color: var(--ix-muted) !important; }

/* ── Tables ─────────────────────────────────────────── */
.ix-table {
  color: var(--ix-text);
  font-size: .85rem;
}
.ix-table thead th {
  background: var(--ix-surface2);
  border-bottom: 1px solid var(--ix-border);
  color: var(--ix-muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}
.ix-table td {
  border-bottom: 1px solid rgba(30,45,64,.5);
  vertical-align: middle;
  padding: .6rem .75rem;
}
.ix-table tr:last-child td { border-bottom: none; }

/* ── Badges ─────────────────────────────────────────── */
.ix-badge-gold {
  background: rgba(163,131,74,.2);
  color: var(--ix-gold-light);
  border: 1px solid rgba(163,131,74,.3);
  font-size: .75rem;
  padding: .25rem .6rem;
  border-radius: 20px;
  font-weight: 500;
}

.ix-badge-model {
  background: var(--ix-surface2);
  color: var(--ix-muted);
  border: 1px solid var(--ix-border);
  font-size: .7rem;
  font-family: monospace;
}

/* ── Status Badges ──────────────────────────────────── */
.ix-status-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ix-status-pending  { background: rgba(107,122,141,.15); color: #6b7a8d; border: 1px solid rgba(107,122,141,.3); }
.ix-status-running  { background: rgba(59,130,246,.15);  color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.ix-status-done     { background: rgba(45,106,79,.2);    color: #4ade80; border: 1px solid rgba(45,106,79,.4); }
.ix-status-approved { background: rgba(163,131,74,.2);   color: var(--ix-gold-light); border: 1px solid rgba(163,131,74,.4); }
.ix-status-failed   { background: rgba(185,28,28,.15);   color: #f87171; border: 1px solid rgba(185,28,28,.3); }
.ix-status-rejected { background: rgba(185,28,28,.15);   color: #f87171; border: 1px solid rgba(185,28,28,.3); }

/* ── Asset Previews ─────────────────────────────────── */
.asset-library-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.asset-preview-item {
  border: 1px solid var(--ix-border);
  background: var(--ix-surface2);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: var(--ix-text);
}

.asset-preview-item:hover {
  border-color: var(--ix-gold);
}

.asset-preview-item.active {
  border-color: var(--ix-gold);
  box-shadow: 0 0 0 1px rgba(163,131,74,.35);
}

.asset-preview-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  display: block;
  background: #0a0d12;
}

.code-multiline-3 {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.asset-preview-meta {
  display: block;
  padding: 6px 7px;
  line-height: 1.2;
}

.asset-preview-ref {
  display: inline-block;
  font-size: .68rem;
  color: var(--ix-gold-light);
  font-weight: 600;
}

.asset-preview-name {
  display: block;
  margin-top: 2px;
  font-size: .64rem;
  color: var(--ix-muted);
}

/* ── Progress ───────────────────────────────────────── */
.ix-progress {
  background: var(--ix-border);
  border-radius: 10px;
  overflow: hidden;
}
.ix-progress-bar {
  background: linear-gradient(90deg, var(--ix-gold), var(--ix-gold-light));
  border-radius: 10px;
  transition: width .3s ease;
}

/* ── Stats ──────────────────────────────────────────── */
.ix-stat-mini {
  background: var(--ix-surface2);
  border: 1px solid var(--ix-border);
  border-radius: 8px;
  padding: .5rem .25rem;
}
.ix-stat-num { font-size: 1.25rem; font-weight: 700; color: var(--ix-text); }
.ix-stat-label { font-size: .65rem; color: var(--ix-muted); text-transform: uppercase; }
.ix-stat-green .ix-stat-num { color: #4ade80; }
.ix-stat-amber .ix-stat-num { color: var(--ix-gold-light); }

/* ── Piece Cards ────────────────────────────────────── */
.piece-card { overflow: hidden; }
.piece-card:hover { border-color: var(--ix-gold) !important; }

.piece-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  height: auto;
  background: var(--ix-surface2);
  overflow: hidden;
  cursor: zoom-in;
}

.piece-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.piece-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.piece-status-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
}

.piece-vanessa-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
}

.piece-id { font-size: .7rem; font-family: monospace; color: var(--ix-muted); }
.piece-headline { font-size: .8rem; line-height: 1.3; }

/* ── Carousel Group ─────────────────────────────────── */
.carousel-group {
  background: var(--ix-surface);
  border: 1px solid var(--ix-border);
  border-radius: var(--ix-radius);
  padding: 1rem;
}
.carousel-group-header { padding-bottom: .5rem; border-bottom: 1px solid var(--ix-border); }

/* ── Page Headers ───────────────────────────────────── */
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ix-text);
  margin: 0;
}

.section-title {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--ix-muted);
  font-weight: 600;
}

/* ── Breadcrumb ─────────────────────────────────────── */
.ix-breadcrumb {
  font-size: .8rem;
  margin: 0;
}
.ix-breadcrumb .breadcrumb-item a { color: var(--ix-gold); text-decoration: none; }
.ix-breadcrumb .breadcrumb-item.active { color: var(--ix-muted); }
.ix-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--ix-muted); }

/* ── Prompt Preview ─────────────────────────────────── */
.prompt-preview {
  background: var(--ix-surface2);
  border: 1px solid var(--ix-border);
  border-radius: 6px;
  padding: .75rem;
  color: var(--ix-muted);
  font-family: monospace;
  font-size: .78rem;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.payload-preview {
  background: var(--ix-surface2);
  border: 1px solid var(--ix-border);
  border-radius: 6px;
  padding: .75rem;
  color: var(--ix-muted);
  font-family: monospace;
  font-size: .75rem;
  line-height: 1.5;
  max-height: 420px;
  overflow-x: auto;
  overflow-y: auto;
  white-space: pre;
  margin: 0;
}

/* ── Result Images ──────────────────────────────────── */
.result-img {
  border-radius: 0;
  max-height: 400px;
  object-fit: contain;
  background: var(--ix-surface2);
}
.result-thumb { overflow: hidden; }
.result-thumb-img { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; }
.border-gold { border-color: var(--ix-gold) !important; }

/* ── Spinner ────────────────────────────────────────── */
.ix-spinner { color: var(--ix-gold); }

/* ── Lightbox ───────────────────────────────────────── */
.ix-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.ix-lightbox.active { display: flex; }
.ix-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--ix-radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.8);
}
.ix-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--ix-surface);
  border: 1px solid var(--ix-border);
  color: var(--ix-text);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

/* ── Borders ────────────────────────────────────────── */
.ix-border { border-color: var(--ix-border) !important; }

/* ── Scrollbars ─────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--ix-surface); }
::-webkit-scrollbar-thumb { background: var(--ix-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ix-muted); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .ix-sidebar { display: none; }
  .ix-main { margin-left: 0; }
  .ix-content { padding: 1rem; }
}

/* ── Modais — Glass Effect ──────────────────────────── */
.modal-content {
  background: rgba(18, 28, 50, 0.85) !important;
  backdrop-filter: blur(22px) saturate(1.6) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.6) !important;
  border: 1px solid rgba(163, 131, 74, 0.28) !important;
  border-radius: 12px !important;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  color: var(--ix-text) !important;
}

.modal-header {
  background: rgba(22, 34, 60, 0.90) !important;
  border-bottom: 1px solid rgba(163, 131, 74, 0.20) !important;
  border-radius: 12px 12px 0 0 !important;
}

.modal-footer {
  background: rgba(16, 24, 44, 0.80) !important;
  border-top: 1px solid rgba(30, 45, 64, 0.7) !important;
  border-radius: 0 0 12px 12px !important;
}

.modal-backdrop {
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

.modal-backdrop.show {
  opacity: 0.65 !important;
}

/* Tag cloud chips */
.lib-tag-chip:hover { opacity: 0.85; transform: scale(1.05); }
.lib-tag-chip.active { box-shadow: 0 0 0 2px currentColor; }

/* ── J103: Visual Consistency Additions ──────────────────────────────────── */

/* Flash messages */
.flash-container {
  position: sticky;
  top: var(--ix-navbar-h);
  z-index: 1040;
}
.flash-container .alert {
  border-radius: 8px;
  border-left: 3px solid currentColor;
  margin-bottom: .5rem;
}

/* ix-btn-purple — for AI/LLM action buttons */
.ix-btn-purple {
  background: var(--ix-purple);
  color: #fff;
  border: 1px solid var(--ix-purple);
  border-radius: 6px;
  padding: .375rem .75rem;
  font-size: .875rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.ix-btn-purple:hover { background: var(--ix-purple-light); border-color: var(--ix-purple-light); color: #fff; }
.ix-btn-purple:disabled { opacity: .55; cursor: not-allowed; }

/* select element using ix-input */
select.ix-input {
  appearance: auto;
  -webkit-appearance: auto;
}

/* Consistent label spacing */
.form-label { margin-bottom: .35rem; font-size: .8125rem; color: var(--ix-muted); font-weight: 500; }

/* Global search (J113) — fade-in animation */
#globalSearchBox { animation: fadeDown .15s ease; }
@keyframes fadeDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
#globalSearchBox .dropdown-item:hover { background: rgba(255,255,255,.06); }
#globalSearchBox .dropdown-header { color: var(--ix-muted); }

/* Bell badge (J112) */
#bellBadge { transform: translate(0, -4px) !important; }
#notifDropdown { max-height: 380px; overflow-y: auto; }
#notifList > div { padding: .25rem 0; font-size: .78rem; }

/* Slot empty state (campaign.html) */
.slot-empty-state { color: var(--ix-muted); font-size: .65rem; pointer-events: none; padding: 4px; }

/* Spinner utility */
.ix-loading { opacity: .6; pointer-events: none; }
