/* ─── ORI COST DASHBOARD — STYLES ──────────────────────────────────────────── */

:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-table: #0d1117;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-green: #3fb950;
    --accent-amber: #d29922;
    --accent-red: #f85149;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

/* ─── Logo GAME My LiFE ──────────────────────────────────────────────────── */

.logo {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    margin-bottom: 10px;
    overflow: visible;
    text-decoration: none;
    cursor: pointer;
}
.logo:hover { opacity: 0.8; transition: opacity 0.15s; }

.logo-game {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 30px;
    color: #fff;
    letter-spacing: 4px;
    line-height: 1;
}

.logo-my {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-style: italic;
    line-height: 1.3;
    margin: 0 8px;
    transform: translateY(10px);
    display: inline-flex;
    align-items: baseline;
    clip-path: inset(0px 3px 0px -2px);
    background: linear-gradient(90deg, #90EE90, #00CED1, #4169E1, #8A2BE2, #FF8C00, #FFD700, #90EE90);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 18s linear infinite;
}

.logo-my-m { font-size: 30px; }
.logo-my-y { font-size: 36px; }

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.logo-l {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #fff;
    line-height: 1;
}

.logo-i-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 2px 0;
    padding-right: 3px;
}

.ori-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: oriDotCycle 30s linear infinite, oriDotPulse 8s ease-in-out infinite;
}

@keyframes oriDotCycle {
    0%   { background: #90EE90; box-shadow: 0 0 6px rgba(144,238,144,0.6), 0 0 14px rgba(144,238,144,0.3); }
    16%  { background: #00CED1; box-shadow: 0 0 6px rgba(0,206,209,0.6), 0 0 14px rgba(0,206,209,0.3); }
    33%  { background: #4169E1; box-shadow: 0 0 6px rgba(65,105,225,0.6), 0 0 14px rgba(65,105,225,0.3); }
    50%  { background: #8A2BE2; box-shadow: 0 0 6px rgba(138,43,226,0.6), 0 0 14px rgba(138,43,226,0.3); }
    66%  { background: #FF8C00; box-shadow: 0 0 6px rgba(255,140,0,0.6), 0 0 14px rgba(255,140,0,0.3); }
    83%  { background: #FFD700; box-shadow: 0 0 6px rgba(255,215,0,0.6), 0 0 14px rgba(255,215,0,0.3); }
    100% { background: #90EE90; box-shadow: 0 0 6px rgba(144,238,144,0.6), 0 0 14px rgba(144,238,144,0.3); }
}

@keyframes oriDotPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

.logo-i-stick {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 19px;
    color: #fff;
    line-height: 1;
    margin-top: 2px;
}

.logo-fe {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #fff;
    line-height: 1;
    letter-spacing: 3px;
}

.slogan {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: 8px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 7px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.gradient-bar {
    width: 100px;
    height: 1px;
    border-radius: 1px;
    background: linear-gradient(90deg, transparent, #90EE90, #00CED1, #4169E1, #8A2BE2, #FF8C00, #FFD700, transparent);
    background-size: 300% 100%;
    animation: barShift 24s linear infinite;
    margin: 0 auto 8px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, white 15%, white 85%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, white 15%, white 85%, transparent 100%);
}

@keyframes barShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* ─── Header Stats Bar ──────────────────────────────────────────────────── */

.header-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    padding: 6px 16px;
    background: rgba(88, 166, 255, 0.06);
    border: 1px solid rgba(88, 166, 255, 0.15);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-stat strong {
    color: var(--text);
    font-weight: 700;
}

.header-stat-icon {
    font-size: 0.9rem;
}

.header-stat-sep {
    color: var(--text-muted);
    opacity: 0.5;
}

.header-stat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.header-stat-dot.active {
    background: var(--accent-green);
    box-shadow: 0 0 4px var(--accent-green);
}

.header-stat-dot.recent {
    background: var(--accent-amber);
    box-shadow: 0 0 4px var(--accent-amber);
}

.header-stat-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

@media (max-width: 600px) {
    .header-stats-bar {
        flex-wrap: wrap;
        gap: 6px 12px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

/* ─── Tabs ──────────────────────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab {
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ─── Badges ────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-used {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-amber);
}

.badge-available {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.badge-expired {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
}

/* ─── Filtres ────────────────────────────────────────────────────────────── */

.filters {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.filters form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.filters label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.filters select, .filters input, .filters button {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

.filters input[type="date"],
.filters input[type="month"] {
    min-width: 150px;
}

.filters input[type="number"] {
    width: 120px;
}

.filter-user-search {
    min-width: 220px;
}

.filter-user-note {
    max-width: 320px;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #f2b36f;
}

.filters button {
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.filters button:hover {
    opacity: 0.85;
}

.filter-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.filter-field > select,
.filter-field > input,
.filter-picker,
.filter-actions button {
    min-height: 42px;
}

.filter-period-toggle {
    display: inline-flex;
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    height: 42px;
    flex-shrink: 0;
}

.filter-period-btn {
    padding: 0 10px;
    background: transparent;
    color: var(--text-muted, #8b949e);
    border: none;
    border-right: 1px solid rgba(88, 166, 255, 0.15);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, padding 0.15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0;
}

.filter-period-btn:last-child {
    border-right: none;
}

/* Icône toujours visible */
.fpb-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Label masqué sur les boutons inactifs */
.fpb-label {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.2s ease, opacity 0.15s ease, margin-left 0.2s ease;
    margin-left: 0;
    white-space: nowrap;
}

.filter-period-btn:hover {
    background: rgba(88, 166, 255, 0.08);
    color: var(--text, #e6edf3);
}

.filter-period-btn.is-active {
    background: rgba(88, 166, 255, 0.14);
    color: var(--text, #e6edf3);
    font-weight: 600;
    padding: 0 12px;
}

/* Label visible uniquement sur le bouton actif */
.filter-period-btn.is-active .fpb-label {
    max-width: 80px;
    opacity: 1;
    margin-left: 5px;
}

.filter-panel,
.filter-inline {
    display: inline-flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.filter-panel-rolling,
.filter-panel-calendar {
    flex-wrap: nowrap;
}

.filter-field-period select,
.filter-field-window select,
.filter-field-calendar-type select,
.filter-field-provider select {
    min-width: 150px;
}

.filter-field-year input {
    width: 120px;
}

.filter-inline-dates {
    gap: 12px;
}

.filter-picker {
    position: relative;
    min-width: 190px;
}

.filter-picker-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.filter-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: linear-gradient(180deg, rgba(15, 20, 30, 0.96), rgba(13, 18, 27, 0.98));
    color: var(--text);
    border: 1px solid rgba(88, 166, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.filter-picker-trigger:hover {
    opacity: 1;
    border-color: rgba(88, 166, 255, 0.34);
    background: linear-gradient(180deg, rgba(18, 25, 37, 0.98), rgba(14, 19, 29, 0.98));
}

.filter-picker-trigger:focus-visible {
    outline: 2px solid rgba(88, 166, 255, 0.85);
    outline-offset: 1px;
}

.filter-picker-value {
    font-weight: 600;
    color: var(--text);
}

.filter-picker-icon {
    flex-shrink: 0;
    font-size: 1rem;
    opacity: 0.85;
}

.filter-hint {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin-left: auto;
    padding: 9px 12px;
    border: 1px solid rgba(88, 166, 255, 0.18);
    border-radius: 12px;
    background: rgba(88, 166, 255, 0.08);
    white-space: nowrap;
}

.filter-hint strong {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
}

.filter-hint span {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.filters .is-hidden {
    display: none;
}

/* ─── Summary Cards ──────────────────────────────────────────────────────── */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.summary-cards-signal {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#reg-stats {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

#reg-stats .card {
    min-width: 0;
    padding: 14px 12px;
}

#reg-stats .card-value {
    font-size: clamp(1.55rem, 1.55vw, 2.2rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

#reg-stats .card-label {
    font-size: 0.88rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.card-signal {
    position: relative;
    overflow: hidden;
}

.card-signal::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 1;
    pointer-events: none;
}

.card-signal > * {
    position: relative;
    z-index: 1;
}

.card-signal-text {
    border-color: rgba(88, 166, 255, 0.35);
    box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.06);
}

.card-signal-text::before {
    background:
        linear-gradient(135deg, rgba(88, 166, 255, 0.12), rgba(88, 166, 255, 0.02) 60%),
        radial-gradient(circle at top right, rgba(88, 166, 255, 0.12), transparent 45%);
}

.card-signal-image {
    border-color: rgba(210, 153, 34, 0.35);
    box-shadow: inset 0 0 0 1px rgba(210, 153, 34, 0.06);
}

.card-signal-image::before {
    background:
        linear-gradient(135deg, rgba(210, 153, 34, 0.13), rgba(210, 153, 34, 0.03) 60%),
        radial-gradient(circle at top right, rgba(210, 153, 34, 0.14), transparent 45%);
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
}

.card-value.accent { color: var(--accent); }
.card-value.green { color: var(--accent-green); }
.card-value.amber { color: var(--accent-amber); }
.card-value.red { color: var(--accent-red); }
.card-value.small { font-size: 1rem; }

.card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.card-trend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    max-width: 100%;
    white-space: normal;
    border: 1px solid transparent;
}

.card-trend-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.card-trend-text {
    color: inherit;
    overflow-wrap: anywhere;
}

.card-trend-explosive {
    color: #ffb86b;
    background: rgba(255, 184, 107, 0.12);
    border-color: rgba(255, 184, 107, 0.24);
}

.card-trend-up {
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.10);
    border-color: rgba(88, 166, 255, 0.22);
}

.card-trend-stable {
    color: var(--text-muted);
    background: rgba(139, 148, 158, 0.10);
    border-color: rgba(139, 148, 158, 0.22);
}

.card-trend-down {
    color: #7ee787;
    background: rgba(126, 231, 135, 0.10);
    border-color: rgba(126, 231, 135, 0.22);
}

.card-trend-sharp-down {
    color: #ff7b72;
    background: rgba(255, 123, 114, 0.10);
    border-color: rgba(255, 123, 114, 0.22);
}

/* ─── Charts ─────────────────────────────────────────────────────────────── */

.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.chart-container h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.table-section {
    margin-bottom: 24px;
}

.cost-view-switch-section {
    margin-bottom: 12px;
}

.cost-view-switch {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.cost-view-switch-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cost-view-switch-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.cost-view-switch-btn.active {
    color: #fff;
    background: rgba(88, 166, 255, 0.16);
    border-color: rgba(88, 166, 255, 0.28);
}

.cost-detail-panel.is-hidden {
    display: none;
}

.table-section h2 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead {
    background: var(--bg-card);
}

th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th.sortable {
    position: relative;
    cursor: pointer;
    user-select: none;
    padding-right: 26px;
    transition: color 0.18s ease;
}

th.sortable:hover {
    color: var(--text);
}

th.sortable::after {
    content: '↕';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: rgba(139, 148, 158, 0.7);
}

th.sortable.is-sort-asc::after {
    content: '↑';
    color: rgba(88, 166, 255, 0.95);
}

th.sortable.is-sort-desc::after {
    content: '↓';
    color: rgba(88, 166, 255, 0.95);
}

th.sortable:focus-visible {
    outline: 2px solid rgba(88, 166, 255, 0.85);
    outline-offset: -2px;
}

td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
    background: rgba(88, 166, 255, 0.06);
}

td code {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-amber);
}

.empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 24px;
}

/* ─── Promo form ─────────────────────────────────────────────────────────── */

.coupon-form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.coupon-form-section h2 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 12px;
}

.coupon-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.coupon-form label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.coupon-form input[type="number"],
.coupon-form input[type="date"] {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    width: 120px;
}

.coupon-form button {
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.coupon-form button:hover {
    opacity: 0.85;
}

.coupon-result {
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.4);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: var(--accent-green);
}

.coupon-codes-list {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.coupon-codes-list code,
.table-section td code {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    user-select: all;
}

.coupon-codes-list code:hover,
.table-section td code:hover {
    background: rgba(88, 166, 255, 0.15);
}

.coupon-codes-list code.copied,
.table-section td code.copied {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ─── Coupons ───────────────────────────────────────────────────────────── */

.coupon-gen-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.coupon-gen-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.coupon-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coupon-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coupon-field input {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    width: 140px;
}

.coupon-field input:focus {
    border-color: var(--accent);
    outline: none;
}

.coupon-field-btn {
    justify-content: flex-end;
}

.coupon-field-btn button {
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.coupon-field-btn button:hover {
    opacity: 0.85;
}

.coupon-field-btn button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gen-result {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.5;
    word-break: break-all;
}

.gen-result.success {
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: var(--accent-green);
}

.gen-result.error {
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--accent-red);
}

.coupon-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.coupon-stat {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.coupon-stat strong {
    color: var(--text);
}

.coupon-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.coupon-filter-btn {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}

.coupon-filter-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.coupon-filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-available {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.badge-used {
    background: rgba(139, 148, 158, 0.15);
    color: var(--text-muted);
}

.badge-expired {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
}

.coupon-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--accent-amber);
    user-select: all;
    cursor: pointer;
}

.coupon-code:hover {
    color: var(--accent);
}

.btn-action {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    color: var(--text-muted);
    margin-right: 4px;
    transition: all 0.15s;
}

.btn-action:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-action.btn-delete:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-action:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.edit-input {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.82rem;
    width: 90px;
    outline: none;
}

/* ─── Projections ────────────────────────────────────────────────────────── */

.proj-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.proj-mode-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.proj-mode-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.proj-mode-btn.active {
    color: #fff;
    background: #8A2BE2;
}

.proj-mode-btn:last-child.active {
    background: var(--accent-green);
}

.proj-mode-icon {
    font-size: 1rem;
}

.proj-live-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.proj-scenarios {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.proj-scenario-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.proj-scenario-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.proj-scenario-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.proj-sliders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.proj-slider-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.proj-slider-group h3 {
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 12px;
}

.proj-slider-row {
    display: grid;
    grid-template-columns: 1fr 120px 60px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.proj-slider-row label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.proj-slider-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.proj-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8A2BE2;
    cursor: pointer;
}

.proj-slider-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8A2BE2;
    cursor: pointer;
    border: none;
}

.proj-slider-row input[type="range"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.proj-slider-row input[type="range"]:disabled::-webkit-slider-thumb {
    background: var(--text-muted);
    cursor: not-allowed;
}

.proj-slider-val {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-align: right;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.proj-growth-controls {
    margin-bottom: 12px;
}

/* ─── Configuration ────────────────────────────────────────────────────── */

.config-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px 16px;
    margin-bottom: 12px;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.config-row:last-child {
    border-bottom: none;
}

.config-row label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.config-row input,
.config-row select {
    padding: 6px 10px;
    background: var(--bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.config-row input:focus,
.config-row select:focus {
    outline: none;
    border-color: #7c3aed;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    body { padding: 12px; }
    header h1 { font-size: 1.3rem; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 2px; }
    .tab { padding: 8px 12px; font-size: 0.75rem; white-space: nowrap; flex-shrink: 0; }
    .filters form { align-items: stretch; }
    .filter-field,
    .filter-panel,
    .filter-inline,
    .filter-panel-calendar {
        width: 100%;
    }
    .filter-panel-rolling,
    .filter-panel-calendar {
        flex-wrap: wrap;
    }
    .filter-picker {
        width: 100%;
        min-width: 0;
    }
    .filters select,
    .filters input,
    .filters button {
        width: 100%;
    }
    .filter-hint {
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: flex-start;
        white-space: normal;
    }
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    #reg-stats { grid-template-columns: repeat(2, 1fr); }
    .charts { grid-template-columns: 1fr; }
    .chart-container { min-width: 0; }
    .cost-view-switch {
        width: 100%;
        justify-content: stretch;
    }
    .cost-view-switch-btn {
        flex: 1;
        padding: 10px 12px;
    }
    .coupon-gen-row { flex-direction: column; align-items: stretch; }
    .coupon-field input { width: 100%; }
    .proj-sliders-grid { grid-template-columns: 1fr; }
    .proj-slider-row { grid-template-columns: 1fr 100px 50px; }
    .proj-scenarios { flex-wrap: wrap; }
}

@media (max-width: 1500px) {
    #reg-stats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    #reg-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
