/* ═══════════════════════════════════════════════
   PENSÉES TCG — ui.css
   Topbar · Sidebars · Form controls · Buttons
   ═══════════════════════════════════════════════ */

/* ── LOGO ── */
.logo-wrap { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-gem {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #92400e, #c9a84c, #fde68a);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px rgba(201,168,76,.35);
}
.logo-title {
  font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700;
  letter-spacing: .15em; color: #fde68a; line-height: 1;
}
.logo-sub {
  font-family: 'Cinzel', serif; font-size: 8.5px;
  letter-spacing: .2em; color: rgba(201,168,76,.4); margin-top: 2px;
}

/* ── FILTER ROW ── */
.filter-row { display: flex; align-items: center; gap: 3px; }
.filter-btn {
  padding: 5px 10px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: rgba(232,213,163,.35);
  font-family: 'Cinzel', serif; font-size: 8.5px; letter-spacing: .1em;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.filter-btn.active { border-color: currentColor; background: rgba(255,255,255,.06); }

/* ── TOP ACTIONS ── */
.top-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.card-count {
  font-family: 'Cinzel', serif; font-size: 10px;
  letter-spacing: .1em; color: rgba(201,168,76,.35);
}
.btn-create {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; border: none; border-radius: 7px;
  background: linear-gradient(135deg, #92400e, #c9a84c);
  color: #1a0800; font-family: 'Cinzel', serif; font-size: 10px;
  font-weight: 700; letter-spacing: .12em; cursor: pointer;
  box-shadow: 0 2px 14px rgba(201,168,76,.28); transition: all .2s;
}
.btn-create:hover { box-shadow: 0 4px 20px rgba(201,168,76,.4); transform: translateY(-1px); }
.btn-create:active { transform: scale(.97) translateY(0); }

/* ── LEFT SIDEBAR ── */
#sidebar-left {
  width: 210px; min-width: 210px; flex-shrink: 0;
  background: #080f1e;
  border-right: 1px solid rgba(201,168,76,.08);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(201,168,76,.08); flex-shrink: 0;
}
.sidebar-label {
  font-family: 'Cinzel', serif; font-size: 8px;
  letter-spacing: .2em; color: rgba(201,168,76,.4); margin-bottom: 2px;
}
.sidebar-title {
  font-family: 'Cinzel', serif; font-size: 15px;
  color: #fde68a; font-weight: 700;
}
#card-list { overflow-y: auto; flex: 1; padding: 6px; }

.card-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px; border-radius: 8px; margin-bottom: 2px;
  cursor: pointer; border: 1px solid transparent; transition: all .2s;
}
.card-item:hover  { background: rgba(255,255,255,.04); }
.card-item.active { background: rgba(201,168,76,.09); border-color: rgba(201,168,76,.22); }
.card-item-stripe { width: 3px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.card-item-thumb  {
  width: 30px; height: 42px; border-radius: 3px; overflow: hidden;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,.1);
}
.card-item-thumb img   { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-item-thumb .empty { width: 100%; height: 100%; }
.card-item-info { flex: 1; min-width: 0; }
.card-item-name {
  font-family: 'Cinzel', serif; font-size: 9px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: rgba(201,168,76,.65); margin-bottom: 3px; letter-spacing: .03em;
}
.card-item.active .card-item-name { color: #fde68a; }
.card-item-meta { display: flex; align-items: center; gap: 5px; }
.card-item-rarity { font-size: 9px; opacity: .6; }
.card-item-num { font-family: monospace; font-size: 9px; color: rgba(255,255,255,.2); }

/* ── RIGHT SIDEBAR ── */
#sidebar-right {
  width: 272px; min-width: 272px; flex-shrink: 0;
  background: #080f1e;
  border-left: 1px solid rgba(201,168,76,.08);
  display: flex; flex-direction: column; overflow: hidden;
}
.rside-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(201,168,76,.08);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.rside-mode {
  font-family: 'Cinzel', serif; font-size: 8px;
  letter-spacing: .2em; color: rgba(201,168,76,.4); margin-bottom: 2px;
}
.rside-title {
  font-family: 'Cinzel', serif; font-size: 14px; color: #fde68a; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 165px;
}
.btn-cancel {
  padding: 4px 9px; background: none; border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px; color: rgba(255,255,255,.35);
  font-family: 'Cinzel', serif; font-size: 8.5px; letter-spacing: .08em; cursor: pointer;
  transition: all .2s; white-space: nowrap; flex-shrink: 0;
}
.btn-cancel:hover { border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.6); }

#rside-content { overflow-y: auto; flex: 1; padding: 14px 18px; }

/* ── VIEW PANEL ── */
.rarity-banner {
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
  text-align: center; border: 1px solid rgba(255,255,255,.08);
}
.rarity-banner-name {
  font-family: 'Cinzel', serif; font-size: 18px; font-weight: 900;
  letter-spacing: .12em; margin-bottom: 5px;
}
.rarity-banner-sub {
  font-family: 'Cormorant Garamond', serif; font-size: 10px;
  letter-spacing: .1em; margin-top: 5px; opacity: .5;
}
.prop-block { margin-bottom: 12px; }
.prop-label {
  font-family: 'Cinzel', serif; font-size: 7.5px;
  letter-spacing: .2em; color: rgba(201,168,76,.4); margin-bottom: 3px;
}
.prop-value {
  font-family: 'Cormorant Garamond', serif; font-size: 14px;
  color: #e8d5a3; font-weight: 500;
}
.prop-quote {
  font-family: 'IM Fell English', serif; font-style: italic;
  font-size: 13px; line-height: 1.7; color: rgba(232,213,163,.8);
  background: rgba(201,168,76,.04); border: 1px solid rgba(201,168,76,.1);
  border-radius: 6px; padding: 10px 12px;
}
.btn-delete {
  width: 100%; margin-top: 10px; padding: 8px;
  background: rgba(239,68,68,.06); border: 1px solid rgba(239,68,68,.15);
  border-radius: 7px; color: rgba(239,68,68,.5);
  font-family: 'Cinzel', serif; font-size: 8.5px; letter-spacing: .12em;
  cursor: pointer; transition: all .2s;
}
.btn-delete:hover { background: rgba(239,68,68,.12); color: rgba(239,68,68,.8); }

/* ── EDIT PANEL — FORM CONTROLS ── */
.field-label {
  font-family: 'Cinzel', serif; font-size: 7.5px; letter-spacing: .2em;
  color: rgba(201,168,76,.45); display: block; margin-bottom: 5px;
}
.tcg-input {
  width: 100%; background: rgba(255,255,255,.04);
  border: 1px solid rgba(201,168,76,.18); color: #e8d5a3;
  padding: 9px 12px; border-radius: 7px;
  font-family: 'Cormorant Garamond', serif; font-size: 14px;
  outline: none; transition: all .25s; -webkit-appearance: none; appearance: none;
}
.tcg-input::placeholder { color: rgba(232,213,163,.25); }
.tcg-input:focus {
  border-color: rgba(201,168,76,.55);
  background: rgba(255,255,255,.07);
  box-shadow: 0 0 0 3px rgba(201,168,76,.08);
}
textarea.tcg-input { resize: none; line-height: 1.6; }
select.tcg-input { cursor: pointer; background-color: #080f1e; }

.rarity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 4px; }
.rarity-option {
  padding: 8px 9px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.02);
  transition: all .2s; display: flex; flex-direction: column; gap: 4px;
}
.rarity-option:hover { border-color: rgba(255,255,255,.15); }
.rarity-option-name {
  font-family: 'Cinzel', serif; font-size: 8.5px; font-weight: 700;
  letter-spacing: .07em; color: rgba(255,255,255,.35);
}

.rarity-bar { height: 2.5px; border-radius: 2px; margin-bottom: 14px; transition: background .3s; }
.char-count { text-align: right; margin-top: 2px; font-family: monospace; font-size: 9px; color: rgba(255,255,255,.18); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.quick-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
.quick-img-btn {
  aspect-ratio: 1; border-radius: 5px; overflow: hidden;
  border: 1.5px solid rgba(255,255,255,.07); padding: 0;
  cursor: pointer; position: relative; transition: border-color .2s;
  background: none;
}
.quick-img-btn:hover { border-color: rgba(201,168,76,.4); }
.quick-img-btn img   { width: 100%; height: 100%; object-fit: cover; display: block; }
.quick-img-btn.sel   { border-color: #c9a84c; }
.quick-img-check {
  position: absolute; inset: 0; background: rgba(201,168,76,.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fde68a;
}

.btn-save {
  width: 100%; padding: 13px; border-radius: 9px; border: none;
  font-family: 'Cinzel', serif; font-size: 11px; font-weight: 700;
  letter-spacing: .15em; cursor: pointer; transition: all .3s;
}
.btn-save:active { transform: scale(.98); }
.btn-save.ready {
  background: linear-gradient(135deg, #92400e 0%, #c9a84c 50%, #f59e0b 100%);
  background-size: 200% 100%; color: #1a0800;
  box-shadow: 0 4px 20px rgba(201,168,76,.28);
}
.btn-save.ready:hover { background-position: 100% 0; }
.btn-save.done  { background: linear-gradient(135deg, #065f46, #10b981); color: #ecfdf5; animation: savedPulse .4s ease; }
.btn-save.off   { background: rgba(255,255,255,.05); color: rgba(255,255,255,.2); cursor: not-allowed; }

/* ── PREVIEW META BAR ── */
.preview-meta {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; z-index: 2;
  background: rgba(255,255,255,.03); border: 1px solid rgba(201,168,76,.1);
  border-radius: 8px; padding: 7px 18px; flex-wrap: wrap;
}
.preview-meta-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.preview-meta-label {
  font-family: 'Cinzel', serif; font-size: 8.5px;
  letter-spacing: .14em; color: rgba(201,168,76,.45);
}
.preview-actions { display: flex; gap: 7px; margin-left: auto; }
.btn-sm {
  padding: 5px 13px; border-radius: 5px;
  font-family: 'Cinzel', serif; font-size: 8.5px; letter-spacing: .1em;
  cursor: pointer; transition: all .2s;
}
.btn-sm:active { transform: scale(.96); }
.btn-ghost { background: rgba(201,168,76,.09); border: 1px solid rgba(201,168,76,.22); color: #c9a84c; }
.btn-ghost:hover { background: rgba(201,168,76,.16); }
.btn-gold {
  background: linear-gradient(135deg, rgba(146,64,14,.85), rgba(201,168,76,.9));
  border: none; color: #1a0800; font-weight: 700;
  display: flex; align-items: center; gap: 5px;
}
.btn-gold:hover { box-shadow: 0 2px 12px rgba(201,168,76,.35); }

/* ── STRIP LABEL ── */
.strip-label {
  font-family: 'Cinzel', serif; font-size: 7.5px; letter-spacing: .2em;
  color: rgba(201,168,76,.22); writing-mode: vertical-lr;
  text-orientation: mixed; transform: rotate(180deg); flex-shrink: 0;
}

/* ── EDIT FORM FIELD GROUPS ── */
.field-group { margin-bottom: 13px; }
