/* NetMonkey Admin — standalone styles (does not depend on the public site CSS). */

:root {
    --bg:        #0b1220;
    --panel:    #111a2e;
    --panel-2:  #182240;
    --border:   #1f2a44;
    --text:     #e2e8f0;
    --muted:    #94a3b8;
    --accent:   #22d3ee;
    --accent-2: #3b82f6;
    --good:     #10b981;
    --warn:     #f59e0b;
    --bad:      #ef4444;
    --new:      #3b82f6;
    --contacted:#a855f7;
    --qualified:#22d3ee;
    --won:      #10b981;
    --lost:     #64748b;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
    font: inherit;
    cursor: pointer;
}

/* ── Login ─────────────────────────────────────────────── */

.admin-view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-view[hidden] {
    display: none !important;
}

#login-view {
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(circle at 20% 20%, rgba(59,130,246,0.12), transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(34,211,238,0.10), transparent 50%),
      var(--bg);
}

.login-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 28px;
    font-size: 18px;
}

.login-brand svg {
    width: 22px;
    height: 22px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
}

.login-submit {
    margin-top: 6px;
    padding: 12px 16px;
    background: var(--accent-2);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.15s ease, transform 0.1s ease;
}

.login-submit:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.login-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.login-error {
    color: #fca5a5;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 4px 0 0;
    font-size: 13px;
}

/* ── App layout ────────────────────────────────────────── */

.admin-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.admin-header-brand svg { width: 18px; height: 18px; }

.admin-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
}

.admin-tab {
    padding: 8px 16px;
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-tab:hover {
    color: var(--text);
    background: var(--panel-2);
}

.admin-tab.is-active {
    color: var(--text);
    background: var(--panel-2);
    border-color: var(--border);
}

.count-badge {
    background: var(--bg);
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.admin-tab.is-active .count-badge {
    background: var(--accent-2);
    color: white;
}

.admin-header-actions { flex-shrink: 0; }

.ghost-btn {
    padding: 8px 14px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.ghost-btn:hover:not(:disabled) {
    color: var(--text);
    background: var(--panel-2);
    border-color: var(--accent-2);
}

.ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.primary-btn {
    padding: 8px 14px;
    background: var(--accent-2);
    color: white;
    border: 1px solid var(--accent-2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s ease;
}

.primary-btn:hover { background: #2563eb; }

/* ── Toolbar ───────────────────────────────────────────── */

.admin-toolbar {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-2);
}

.export-group {
    display: flex;
    gap: 8px;
}

/* ── Status / loading ──────────────────────────────────── */

.loading, .error-banner {
    padding: 12px 24px;
    text-align: center;
    font-size: 13px;
}

.loading { color: var(--muted); }
.error-banner {
    color: #fca5a5;
    background: rgba(239,68,68,0.1);
    border-bottom: 1px solid rgba(239,68,68,0.25);
}

/* ── Row cards ─────────────────────────────────────────── */

.rows {
    flex: 1;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.row-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    grid-column: 1 / -1;
}

.row-title {
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
}

.row-email {
    color: var(--accent);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
}

.row-meta {
    color: var(--muted);
    font-size: 12px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.score-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    background: rgba(255,255,255,0.06);
}

.score-pill.s-good { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.score-pill.s-mid  { background: rgba(245,158,11,0.18); color: #fcd34d; }
.score-pill.s-bad  { background: rgba(239,68,68,0.18);  color: #fca5a5; }

.status-select {
    padding: 4px 8px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.row-body {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.row-body strong { color: var(--text); }

.row-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 8px;
}

.row-detail-row > div { min-width: 0; }

.row-detail-row .lbl {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 6px;
}

.row-message {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    white-space: pre-wrap;
    margin: 8px 0;
    font-size: 13px;
}

.cat-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.cat-pill {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    color: var(--muted);
}

.cat-pill strong { color: var(--text); margin-left: 4px; }

.notes-box {
    grid-column: 1 / -1;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notes-box label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
}

.notes-box textarea {
    width: 100%;
    min-height: 56px;
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    resize: vertical;
}

.notes-box textarea:focus {
    outline: none;
    border-color: var(--accent-2);
}

.notes-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.save-btn {
    padding: 6px 12px;
    background: var(--good);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.save-btn:hover { background: #059669; }
.save-btn.is-saved { background: var(--lost); }

.delete-btn {
    padding: 6px 12px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    margin-left: auto;
}

.delete-btn:hover { color: #fca5a5; border-color: var(--bad); }

.save-status {
    font-size: 11px;
    color: var(--muted);
}

.save-status.is-saved { color: var(--good); }
.save-status.is-error { color: var(--bad); }

/* ── Pager ─────────────────────────────────────────────── */

.pager {
    padding: 16px 24px 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.page-info { color: var(--muted); font-size: 13px; }

.empty {
    padding: 60px 24px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 720px) {
    .admin-header { flex-wrap: wrap; }
    .admin-tabs { width: 100%; order: 3; }
    .row-meta { width: 100%; margin-left: 0; }
}
