/* history.css */

.btn-topbar-primary {
    display:inline-flex; align-items:center; gap:7px;
    padding:9px 18px; border-radius:8px;
    background:var(--blue-primary); color:white;
    font-size:13px; font-weight:600; text-decoration:none;
    margin-right:12px; transition:background 0.2s;
}
.btn-topbar-primary:hover { background:#1e3a8a; }

/* Stats */
.history-stats {
    display:grid; grid-template-columns:repeat(4,1fr);
    gap:16px; padding:24px 32px 0;
}
.hstat-card {
    background:white; border-radius:12px; padding:18px 20px;
    display:flex; align-items:center; gap:14px;
    box-shadow:0 1px 3px rgba(0,0,0,0.06);
}
.hstat-icon {
    width:44px; height:44px; border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    font-size:18px; flex-shrink:0;
}
.hstat-icon.blue   { background:#dbeafe; color:#1a56db; }
.hstat-icon.green  { background:#d1fae5; color:#059669; }
.hstat-icon.indigo { background:#ede9fe; color:#7c3aed; }
.hstat-icon.orange { background:#fef3c7; color:#d97706; }
.hstat-info h3 { font-family:'DM Serif Display',serif; font-size:22px; color:#1e293b; line-height:1; }
.hstat-info p  { font-size:12px; color:#94a3b8; margin-top:3px; }

/* Table Wrap */
.history-table-wrap {
    margin:20px 32px; background:white;
    border-radius:12px; box-shadow:0 1px 3px rgba(0,0,0,0.06);
    overflow:hidden;
}
.history-table-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:16px 20px; border-bottom:1px solid #f1f5f9;
}
.history-table-title {
    display:flex; align-items:center; gap:8px;
    font-size:15px; font-weight:600; color:#1e293b;
}
.history-table-title i { color:#1a56db; }
.history-search {
    padding:8px 14px; border:1.5px solid #e2e8f0;
    border-radius:8px; font-size:13px;
    font-family:'DM Sans',sans-serif; outline:none;
    width:280px; transition:border-color 0.2s;
}
.history-search:focus { border-color:#1a56db; }

/* Table */
.history-table { width:100%; border-collapse:collapse; font-size:13px; }
.history-table thead tr { background:#f8fafc; }
.history-table th {
    padding:11px 16px; text-align:left;
    font-size:11px; font-weight:700; color:#94a3b8;
    text-transform:uppercase; letter-spacing:0.5px;
    border-bottom:1px solid #f1f5f9;
}
.history-table tbody tr {
    border-bottom:1px solid #f8fafc;
    transition:background 0.15s; cursor:pointer;
}
.history-table tbody tr:last-child { border-bottom:none; }
.history-table tbody tr:hover { background:#f8faff; }

.td-num { padding:14px 8px; text-align:center; color:#94a3b8; font-weight:700; font-size:12px; }
.td-company { padding:14px 16px; }
.company-cell { display:flex; align-items:center; gap:10px; }
.company-avatar {
    width:32px; height:32px; border-radius:8px;
    background:#dbeafe; color:#1a56db;
    font-size:13px; font-weight:700;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.td-date { padding:14px 16px; font-size:13px; color:#475569; }
.td-time { font-size:11px; color:#94a3b8; margin-top:2px; }

.phase-pill {
    display:inline-flex; align-items:center; gap:5px;
    padding:4px 10px; border-radius:20px;
    font-size:11px; font-weight:600; white-space:nowrap;
}
.persp-pill {
    background:#f1f5f9; color:#475569;
    padding:4px 10px; border-radius:20px;
    font-size:11px; font-weight:500;
    display:inline-block;
}
.avg-score-cell { display:flex; align-items:baseline; gap:2px; justify-content:center; }
.avg-score-num { font-size:18px; font-weight:700; font-family:'DM Serif Display',serif; }
.avg-score-max { font-size:11px; color:#94a3b8; }
.indicator-count-badge {
    background:#f1f5f9; color:#475569;
    padding:3px 10px; border-radius:20px;
    font-size:12px; font-weight:600;
    display:inline-block;
}

.action-btns { display:flex; gap:6px; justify-content:center; }
.btn-view, .btn-delete {
    width:32px; height:32px; border-radius:8px;
    border:none; cursor:pointer; font-size:13px;
    display:flex; align-items:center; justify-content:center;
    transition:all 0.2s; text-decoration:none;
}
.btn-view   { background:#dbeafe; color:#1a56db; }
.btn-view:hover { background:#1a56db; color:white; }
.btn-delete { background:#fee2e2; color:#dc2626; }
.btn-delete:hover { background:#dc2626; color:white; }

/* Empty state */
.history-empty {
    display:flex; flex-direction:column; align-items:center;
    padding:60px 32px; text-align:center;
}
.history-empty-icon {
    width:64px; height:64px; background:#f1f5f9; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:26px; color:#94a3b8; margin-bottom:16px;
}
.history-empty h3 { font-family:'DM Serif Display',serif; font-size:20px; margin-bottom:8px; }
.history-empty p { color:#64748b; font-size:14px; margin-bottom:20px; }
.btn-start-empty {
    display:inline-flex; align-items:center; gap:8px;
    background:#1a56db; color:white; padding:10px 22px;
    border-radius:8px; font-size:14px; font-weight:600; text-decoration:none;
}

/* Delete Modal */
.modal-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,0.4);
    display:flex; align-items:center; justify-content:center; z-index:999;
}
.modal-box {
    background:white; border-radius:16px; padding:32px;
    width:400px; text-align:center;
    box-shadow:0 20px 60px rgba(0,0,0,0.15);
}
.modal-icon {
    width:56px; height:56px; background:#fee2e2; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:22px; color:#dc2626; margin:0 auto 16px;
}
.modal-box h3 { font-family:'DM Serif Display',serif; font-size:20px; margin-bottom:8px; }
.modal-box p { font-size:13px; color:#64748b; line-height:1.5; margin-bottom:24px; }
.modal-actions { display:flex; gap:10px; justify-content:center; }
.modal-cancel, .modal-confirm {
    padding:10px 24px; border-radius:8px;
    font-size:14px; font-weight:600; cursor:pointer;
    border:none; font-family:'DM Sans',sans-serif;
}
.modal-cancel  { background:#f1f5f9; color:#475569; }
.modal-confirm { background:#dc2626; color:white; }
.modal-confirm:hover { background:#b91c1c; }

@media (max-width:768px) {
    .history-stats { grid-template-columns:repeat(2,1fr); padding:16px; }
    .history-table-wrap { margin:16px; }
    .history-search { width:180px; }
}

/* ── Code Gate ── */
.code-gate {
    max-width:480px; margin:60px auto; text-align:center;
    background:white; border-radius:16px; padding:48px 36px;
    box-shadow:0 4px 24px rgba(0,0,0,0.08);
}
.code-gate-icon {
    width:64px; height:64px; background:#dbeafe; color:#1a56db;
    border-radius:50%; display:flex; align-items:center; justify-content:center;
    font-size:26px; margin:0 auto 20px;
}
.code-gate h3 { font-family:'DM Serif Display',serif; font-size:20px; margin-bottom:10px; }
.code-gate p { font-size:13px; color:#64748b; line-height:1.6; margin-bottom:24px; }
.code-gate-form { display:flex; flex-direction:column; gap:12px; margin-bottom:20px; }
.code-gate-input {
    padding:13px 16px; border:2px solid #e2e8f0; border-radius:10px;
    font-size:16px; text-align:center; font-family:monospace; letter-spacing:1px;
    font-weight:600; outline:none; transition:border-color 0.2s;
}
.code-gate-input:focus { border-color:#1a56db; }
.code-gate-btn {
    display:flex; align-items:center; justify-content:center; gap:8px;
    background:#1a56db; color:white; padding:13px; border:none;
    border-radius:10px; font-size:14px; font-weight:600; cursor:pointer;
    transition:background 0.2s;
}
.code-gate-btn:hover { background:#1e3a8a; }
.code-gate-link { font-size:12px; color:#1a56db; text-decoration:none; }
.code-gate-link:hover { text-decoration:underline; }

/* ── Active Code Bar ── */
.code-active-bar {
    margin:24px 32px 0; display:flex; align-items:center; justify-content:space-between;
    background:#eff6ff; border:1px solid #bfdbfe; border-radius:10px;
    padding:12px 18px;
}
.code-active-info { display:flex; align-items:center; gap:8px; font-size:13px; color:#1e3a8a; }
.code-active-info i { color:#1a56db; }
.code-active-info strong { font-family:monospace; letter-spacing:0.5px; }
.code-switch-btn {
    display:flex; align-items:center; gap:6px;
    color:#1a56db; font-size:12px; font-weight:600; text-decoration:none;
}
.code-switch-btn:hover { text-decoration:underline; }

/* ── Compare button ── */
.btn-compare {
    display:inline-flex; align-items:center; gap:7px;
    background:#7c3aed; color:white; padding:8px 16px;
    border:none; border-radius:8px; font-size:13px; font-weight:600;
    cursor:pointer; transition:all 0.2s;
}
.btn-compare:hover:not(:disabled) { background:#6d28d9; }
.btn-compare:disabled { background:#e2e8f0; color:#94a3b8; cursor:not-allowed; }
.compare-check { width:16px; height:16px; accent-color:#7c3aed; cursor:pointer; }