/* ── Registry Page ─────────────────────────────────────────────────── */

/* Description */
.reg-description {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}
.reg-description p { margin: 0 0 8px; }
.reg-description p:last-child { margin-bottom: 0; }
.reg-desc-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0;
    font-size: 0.75rem;
}
.reg-desc-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.reg-desc-sources {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

/* Include-new toggle */
.reg-desc-toggle {
    margin: 10px 0 6px;
    display: flex;
    align-items: center;
}
.reg-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.reg-toggle-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    background: var(--bg-dark);
    border-radius: 9px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.reg-toggle-switch.on {
    background: #f59e0b;
    border-color: #f59e0b;
}
.reg-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
}
.reg-toggle-switch.on .reg-toggle-thumb {
    left: 16px;
}

/* Stats strip — reuses rov-strip/rov-chip from pipeline.css */
.reg-strip { margin-bottom: 20px; }
.reg-strip .rov-chip { transition: all 0.15s; }
.reg-strip .rov-chip:hover { background: var(--bg-hover); }
.reg-chip-active {
    outline: 2px solid currentColor;
    outline-offset: -2px;
    background: var(--bg-hover) !important;
}
.rov-c-muted { color: var(--text-muted); }

/* Filters — reuses sug-filters/sug-search from pipeline.css */
.reg-filters { margin-bottom: 16px; }
.reg-ms-pills { display: flex; gap: 6px; }
.reg-ms-pill {
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s;
    border: 1px solid transparent;
}
.reg-ms-pill:hover { opacity: 0.75; }
.reg-ms-active {
    opacity: 1 !important;
    outline: 1.5px solid currentColor;
    outline-offset: -1px;
}

/* Filter pill groups */
.reg-pill-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.reg-pill-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 2px;
}
.reg-filter-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    opacity: 0.55;
    transition: all 0.15s;
}
.reg-filter-pill:hover { opacity: 0.85; }
.reg-pill-active {
    opacity: 1 !important;
    color: #8b5cf6;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
}

/* Section header */
.reg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Bulk area */
.reg-bulk-area {
    display: flex;
    align-items: center;
    gap: 8px;
}
.reg-sel-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b5cf6;
}

/* Table — reuses camp-table/camp-row from pipeline.css */
.reg-table { font-size: 0.8rem; }
.reg-th-cb { width: 36px; text-align: center; }
.reg-th-right { text-align: right !important; }

/* Checkbox */
.reg-cell-cb { width: 36px; text-align: center; }
.registry-cb { width: 14px; height: 14px; cursor: pointer; accent-color: #8b5cf6; }

/* Selected row highlight */
.camp-row-selected {
    background: rgba(139, 92, 246, 0.08) !important;
}
.camp-row-selected td:first-child {
    box-shadow: inset 3px 0 0 #8b5cf6;
}

/* App cell */
.reg-cell-app {
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.78rem;
}
.reg-cell-app .sug-app-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 6px;
}
.reg-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* Campaign cell */
.reg-cell-campaign {
    max-width: 300px;
}
.reg-cid {
    display: block;
    font-size: 0.65rem;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 1px;
}

/* Meta */
.reg-cell-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Spend */
.reg-cell-spend {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.78rem;
}

/* Date */
.reg-cell-date {
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

/* Action cell */
.reg-cell-actions {
    white-space: nowrap;
    text-align: right;
}

/* Row action buttons — semantic colored pills */
.reg-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: 4px;
    background: transparent;
}
.reg-btn:first-child { margin-left: 0; }

.reg-btn-track {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.08);
}
.reg-btn-track:hover {
    background: rgba(34, 197, 94, 0.18);
    border-color: #22c55e;
}

.reg-btn-exclude {
    color: var(--text-muted);
    border-color: var(--border-color);
}
.reg-btn-exclude:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.reg-btn-restore {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
}
.reg-btn-restore:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
}

/* Empty state */
.reg-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.reg-empty-state p { margin: 4px 0; }

/* ── Expansion tab chip color ────────────────────────────────────── */
.rov-c-cyan { color: #06b6d4; }

/* ── Expansion table cells ───────────────────────────────────────── */
.reg-cell-bid {
    font-variant-numeric: tabular-nums;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.75rem;
    white-space: nowrap;
}
.reg-exp-reductions {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    margin-left: 4px;
    vertical-align: middle;
}
.reg-exp-cap {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
}
.reg-exp-cap-yes {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}
.reg-exp-cap-partial {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}
.reg-exp-table {
    table-layout: fixed;
}
.reg-exp-table td.reg-cell-app {
    width: 160px;
    white-space: normal;
    overflow: hidden;
}
.reg-exp-table .reg-cell-spend,
.reg-exp-table .reg-cell-bid {
    text-align: center;
}
.reg-exp-table .reg-cid {
    display: inline;
    color: var(--text-primary);
    opacity: 1;
}

/* ── Expansion campaign name subtitle ────────────────────────────── */
.reg-exp-camp-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 1px;
}
.reg-exp-camp-name a {
    color: var(--text-muted);
    text-decoration: none;
}
.reg-exp-camp-name a:hover {
    color: #8b5cf6;
    text-decoration: underline;
}

/* ── Expansion utilization badge ────────────────────────────────── */
.reg-exp-util {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.reg-exp-util-high {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}
.reg-exp-util-mid {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}
.reg-exp-util-low {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

/* ── Expansion badges ────────────────────────────────────────────── */
.reg-exp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.reg-exp-suggested { color: #a78bfa; background: rgba(167, 139, 250, 0.12); }
.reg-exp-approved  { color: #60a5fa; background: rgba(96, 165, 250, 0.12); }
.reg-exp-new_campaign { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.reg-exp-stand_by  { color: #fb923c; background: rgba(251, 146, 60, 0.12); }
.reg-exp-active    { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.reg-exp-closed    { color: var(--text-muted); background: var(--bg-secondary); }

/* ── Expansion Metrics Columns ─────────────────────────────────────── */
/* ── Header Tooltips ─────────────────────────────────────────────── */
.reg-th-tip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--text-muted);
}
.reg-th-tip::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
}
.reg-th-tip:hover::after {
    opacity: 1;
}

.reg-cell-metric {
    text-align: center;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    white-space: nowrap;
}
.reg-cell-spark {
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
}
.reg-sparkline {
    display: inline-block;
    vertical-align: middle;
}
.reg-spark-click {
    cursor: pointer;
}
.reg-spark-click:hover .reg-sparkline {
    opacity: 0.7;
    transition: opacity 0.15s;
}
.reg-metric-dash {
    color: var(--text-muted);
    opacity: 0.5;
}
.reg-metric-shimmer {
    color: var(--text-muted);
    opacity: 0.3;
    animation: reg-shimmer 1.5s ease-in-out infinite;
}
@keyframes reg-shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.15; }
}

/* ── Expandable Rows ──────────────────────────────────────────────── */
.reg-exp-clickable {
    cursor: pointer;
    transition: background 0.15s;
}
.reg-exp-clickable:hover {
    background: rgba(139, 92, 246, 0.04);
}
.reg-row-expanded {
    background: rgba(139, 92, 246, 0.06) !important;
    border-bottom: none !important;
}
.reg-expanded-row {
    background: rgba(139, 92, 246, 0.03);
    border-bottom: 2px solid rgba(139, 92, 246, 0.12);
}
.reg-expanded-row > td {
    padding: 0 !important;
}
.reg-exp-daily {
    padding: 16px 20px;
    min-height: 80px;
}
.reg-exp-daily .exp-daily-header {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}
.reg-exp-daily .exp-daily-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 12px 0;
}
.reg-exp-daily .exp-daily-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.reg-exp-daily .exp-daily-empty {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
}

/* ── Light theme ──────────────────────────────────────────────────── */
html[data-theme="light"] .reg-chip-active { background: rgba(0,0,0,0.04) !important; }
html[data-theme="light"] .reg-sel-label { color: #7c3aed; }
html[data-theme="light"] .reg-btn-track { color: #16a34a; background: rgba(22, 163, 74, 0.06); border-color: rgba(22, 163, 74, 0.2); }
html[data-theme="light"] .reg-btn-track:hover { background: rgba(22, 163, 74, 0.12); }
html[data-theme="light"] .reg-btn-restore { color: #d97706; background: rgba(217, 119, 6, 0.06); border-color: rgba(217, 119, 6, 0.2); }
html[data-theme="light"] .reg-btn-restore:hover { background: rgba(217, 119, 6, 0.12); }
html[data-theme="light"] .reg-ms-active { outline-color: currentColor; }
html[data-theme="light"] .reg-exp-clickable:hover { background: rgba(139, 92, 246, 0.06); }
html[data-theme="light"] .reg-row-expanded { background: rgba(139, 92, 246, 0.08) !important; }
html[data-theme="light"] .reg-expanded-row { background: rgba(139, 92, 246, 0.04); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .reg-section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .reg-filters { flex-direction: column; }
}
