/* ============================================================
   Créditos Claude (#page-claude-credits) — prefixo .cc-*
   Card-resposta, linha do tempo SVG dos ciclos, ordem de uso
   arrastável e detalhe por conta. Reusa tokens e primitivas
   (.mini-table, .lane-dot, .btn, .form-input, .section-head).
   ============================================================ */

#page-claude-credits .page-subtitle { font-size: 12px; color: var(--text3); margin-top: 4px; line-height: 1.4; }
#page-claude-credits .page-header { margin-bottom: 20px; }
#page-claude-credits .cc-header-add { margin-left: auto; align-self: flex-end; white-space: nowrap; }
#page-claude-credits .section { overflow-x: visible; }
#page-claude-credits .lane-dot.is-red { background: var(--red); }

.cc-k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); }
.cc-v { font-family: var(--font-mono); font-size: 15px; font-weight: 600; margin-top: 3px; color: var(--text); white-space: nowrap; }
.cc-v small { font-size: 11px; color: var(--text3); font-weight: 400; }
.cc-v.is-ok { color: var(--green); }
.cc-v.is-bad { color: var(--red); }
.cc-v-sm { font-size: 13px; }
.cc-none { font-size: 12px; color: var(--text3); padding: 6px 0; }
.cc-panel { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.cc-section-head { margin-bottom: 12px; flex-wrap: wrap; row-gap: 8px; }
.cc-head-note { margin-left: auto; font-size: 11px; color: var(--text3); }
.cc-head-btn { margin-left: auto; }
.cc-btn-ico { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cc-btn-ico svg, .cc-icon-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#page-claude-credits .btn:disabled, .cc-form .btn:disabled, .cc-icon-btn:disabled, .cc-switch:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Aviso (store/KEK ausente) ---------- */
.cc-notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(242, 200, 125, 0.35);
  background: rgba(242, 200, 125, 0.08);
  color: var(--orange);
  font-size: 13px;
}
.cc-notice .mono { font-family: var(--font-mono); font-size: 12px; }

/* ---------- 1. Card-resposta ---------- */
.cc-verdict {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
}
.cc-verdict.is-ok { border-left-color: var(--green); }
.cc-verdict-q { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.cc-verdict-a { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.2px; line-height: 1.25; }
.cc-verdict-amt { font-family: var(--font-mono); color: var(--orange); font-weight: 800; white-space: nowrap; }
.cc-verdict-why { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 13px; color: var(--text2); }
.cc-verdict-why li { display: inline-flex; align-items: center; gap: 8px; }
.cc-verdict-side { display: grid; grid-template-columns: repeat(3, auto); gap: 26px; text-align: right; }

/* ---------- 2. Linha do tempo ---------- */
.cc-tl-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px 12px; }
.cc-tl { width: 100%; overflow-x: auto; }
.cc-tl-svg { display: block; font-family: var(--font-sans); }

.cc-tl-row.t-ok { --tone: var(--accent2); }
.cc-tl-row.t-warn { --tone: var(--orange); }
.cc-tl-row.t-bad { --tone: var(--red); }
.cc-tl-row.t-muted { --tone: var(--text3); }
.cc-tl-row.t-ok .cc-tl-dot { fill: var(--green); }

.cc-tl-grid { stroke: rgba(144, 143, 160, 0.08); }
.cc-tl-tick { fill: var(--text3); font-size: 10px; font-family: var(--font-mono); }
.cc-tl-dot { fill: var(--tone); }
.cc-tl-name { fill: var(--text); font-size: 13px; font-weight: 600; }
.cc-tl-sub { fill: var(--text3); font-size: 10.5px; font-family: var(--font-mono); }
.cc-tl-track { fill: var(--bg3); }
.cc-tl-area { fill: var(--tone); opacity: 0.18; }
.cc-tl-real { fill: none; stroke: var(--tone); stroke-width: 2; stroke-linejoin: round; }
.cc-tl-proj { stroke: var(--tone); stroke-width: 2; stroke-dasharray: 5 4; }
.cc-tl-stop { stroke: var(--tone); stroke-width: 2; stroke-dasharray: 2 4; }
.cc-tl-note { fill: var(--tone); font-size: 10.5px; }
.cc-tl-zero { fill: var(--orange); }
.cc-tl-expiring { fill: url(#ccHatch); opacity: 0.9; }
.cc-tl-hatch-stripe { fill: rgba(242, 200, 125, 0.35); }
.cc-tl-expiring-bar { fill: var(--orange); }
.cc-tl-end { stroke: var(--text); stroke-width: 1.2; }
.cc-tl-endlbl { fill: var(--text2); font-size: 10px; font-family: var(--font-mono); }
.cc-tl-out { font-size: 14px; font-weight: 700; font-family: var(--font-mono); fill: var(--text); }
.cc-tl-out.o-ok { fill: var(--green); }
.cc-tl-out.o-warn { fill: var(--orange); }
.cc-tl-out.o-bad { fill: var(--red); }
.cc-tl-out.o-muted { fill: var(--text3); }
.cc-tl-outsub { fill: var(--text3); font-size: 10.5px; }
.cc-tl-today { stroke: var(--accent); stroke-width: 1.5; }
.cc-tl-today-pill { fill: var(--accent); }
.cc-tl-today-lbl { fill: var(--bg); font-size: 10px; font-weight: 700; }

.cc-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 11px; color: var(--text3); margin-top: 8px; }
.cc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cc-sw { display: inline-block; width: 18px; height: 8px; border-radius: 2px; }
.cc-sw-real { background: var(--accent2); }
.cc-sw-proj { background: repeating-linear-gradient(90deg, var(--accent2) 0 5px, transparent 5px 9px); }
.cc-sw-exp { background: repeating-linear-gradient(135deg, rgba(242, 200, 125, 0.6) 0 3px, transparent 3px 6px); }
.cc-sw-zero { width: 8px; border-radius: 50%; background: var(--orange); }

/* ---------- 3 + 4. Ordem de uso + Detalhe ---------- */
.cc-bottom { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.cc-col-order, .cc-col-detail { min-width: 0; }

.cc-toggle-row { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.cc-toggle-title { font-size: 13px; font-weight: 600; color: var(--text); }
.cc-toggle-sub { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.4; }
.cc-switch {
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  margin-top: 1px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  transition: background 0.15s;
}
.cc-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text2);
  transition: transform 0.15s, background 0.15s;
}
.cc-switch[aria-checked="true"] { background: var(--accent2); border-color: var(--accent2); }
.cc-switch[aria-checked="true"]::after { transform: translateX(14px); background: var(--text); }

.cc-order { list-style: none; }
.cc-order-item {
  display: grid;
  grid-template-columns: 16px 8px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(144, 143, 160, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.cc-order-item:last-child { border-bottom: none; }
.cc-order-item:hover { background: rgba(255, 255, 255, 0.02); }
.cc-order-item.is-dragging { opacity: 0.45; background: var(--bg3); }
.cc-order-item[draggable="true"] .cc-grip { cursor: grab; }
.cc-grip { color: var(--text3); display: inline-flex; }
.cc-grip svg { width: 14px; height: 14px; fill: currentColor; }
.cc-order-text { min-width: 0; }
.cc-order-name { display: block; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-order-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
.cc-order-actions { display: flex; gap: 6px; align-items: center; }
.cc-icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.cc-icon-btn:hover { border-color: var(--accent2); color: var(--text); }
.cc-order-foot { font-size: 11px; color: var(--text3); margin-top: 10px; line-height: 1.5; }

.cc-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-tab {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  font: 500 12px var(--font-sans);
  cursor: pointer;
}
.cc-tab:hover { color: var(--text); background: var(--bg2); }
.cc-tab.is-on { background: var(--bg3); color: var(--accent); border-color: var(--border); }

.cc-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cc-detail-grid .mini-table { min-width: 0; }

.cc-bar-row { display: grid; grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) 74px; gap: 10px; align-items: center; margin: 7px 0; font-size: 12px; }
.cc-bar-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-bar-track { height: 10px; background: var(--bg3); border-radius: 5px; overflow: hidden; }
.cc-bar-fill { height: 100%; border-radius: 5px; }
.cc-bar-val { text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--text2); }
.cc-kv-row { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }

.cc-daily { display: flex; align-items: flex-end; gap: 3px; height: 104px; }
.cc-daily-col { flex: 1; min-width: 2px; height: 100%; display: flex; align-items: flex-end; }
.cc-daily-col i { display: block; width: 100%; border-radius: 2px; background: var(--accent2); opacity: 0.9; }
.cc-daily-col:hover i { opacity: 1; background: var(--accent); }
.cc-daily-empty { align-items: center; justify-content: center; font-size: 12px; color: var(--text3); border: 1px dashed var(--border); border-radius: 8px; }
.cc-daily-x { display: flex; justify-content: space-between; margin-top: 6px; font-size: 9px; color: var(--text3); font-family: var(--font-mono); }

.cc-top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; width: 100%; }
.cc-detail-grid .mini-table td:last-child { white-space: nowrap; }
.cc-nowrap { white-space: nowrap; }
.cc-unattr { color: var(--text3); font-style: italic; }

.cc-foot { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.cc-foot-err { min-width: 0; flex: 1 1 220px; }
.cc-err-msg { margin-top: 3px; font-size: 11px; color: var(--red); font-family: var(--font-mono); line-height: 1.4; overflow-wrap: anywhere; }
.cc-foot-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Estado vazio ---------- */
.cc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.cc-empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.cc-empty-desc { max-width: 560px; font-size: 13px; line-height: 1.6; color: var(--text2); margin-bottom: 8px; }
.cc-btn-lg { margin-top: 16px; padding: 11px 22px; font-size: 14px; }

/* ---------- Form de conta (modal) ---------- */
.cc-form { display: flex; flex-direction: column; gap: 14px; }
.cc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cc-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.cc-hint { font-size: 11px; color: var(--text3); line-height: 1.4; }
.cc-hint .mono { font-family: var(--font-mono); }
.cc-form-error {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--red);
  background: rgba(255, 180, 171, 0.07);
  border: 1px solid rgba(255, 180, 171, 0.25);
}
.cc-form .app-modal-actions { margin-top: 6px; }

@media (max-width: 1180px) {
  .cc-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .cc-verdict { grid-template-columns: minmax(0, 1fr); }
  .cc-verdict-side { text-align: left; justify-content: start; }
  .cc-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .cc-head-note { margin-left: 0; }
}
