/* =============================================================================
   ADMIN.CSS — Admin Console & Sync UI
   AI Supply Chain Dashboard
   Created: 2025-02-27

   PURPOSE: Admin panel inputs, login form, sync button, and status indicators
   are replicated across index.html, universe.html, and screener.html.
   Extracted here as the single source of truth.

   SECURITY NOTE: These styles are always loaded but the admin UI is hidden
   behind the ?vault= URL param check. The CSS being present does not expose
   any admin functionality — it's purely presentational.

   USAGE: @import './admin.css'; in all pages (styles are inert unless
   the admin HTML elements are rendered).

   REVERT: Copy rules back inline into each page's <style> tag.
   ============================================================================= */

/* =============================================================================
   ADMIN CONSOLE WRAPPER
   Hidden by default; shown when ?vault= param matches.
   ============================================================================= */
#adminConsole {
    /* Layout handled inline — hidden class toggled by JS */
}

/* =============================================================================
   ADMIN INPUTS — email, password, API key fields
   ============================================================================= */
.admin-input {
    background: #0d0d12;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: var(--font-data);
    font-size: 10px;
    color: var(--text-hi);
    outline: none;
    width: 240px;
    transition: border-color 0.2s;
}

.admin-input:focus       { border-color: var(--acc); }
.admin-input::placeholder { color: var(--text-dim); }

/* =============================================================================
   ADMIN BUTTONS
   ============================================================================= */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-data);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    width: 240px;
}

/* Login button */
.admin-btn--login {
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.4);
    color: #60a5fa;
}

.admin-btn--login:hover {
    background: rgba(59,130,246,0.25);
    border-color: rgba(59,130,246,0.6);
}

.admin-btn--login.active {
    background: rgba(16,185,129,0.15);
    border-color: rgba(16,185,129,0.4);
    color: var(--gain);
    pointer-events: none;
}

/* Sync button */
.admin-btn--sync {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-hi);
    flex-direction: column;
    padding: 16px;
    min-height: 60px;
}

.admin-btn--sync:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.admin-btn--sync.running {
    pointer-events: none;
    background: #fff;
    color: #000;
}

/* Sync pulse dot */
.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.3s;
    flex-shrink: 0;
}

.sync-dot.running {
    background: var(--gain);
    animation: pulse-dot 1s infinite;
}

.sync-dot.done    { background: var(--gain); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(1.5); }
}

/* =============================================================================
   LOGIN STATUS — small italic text below login button
   ============================================================================= */
.login-status {
    font-family: var(--font-data);
    font-size: 9px;
    font-style: italic;
    color: var(--text-dim);
    margin-top: 2px;
}

.login-status.ok   { color: var(--gain); }
.login-status.err  { color: var(--loss); }
.login-status.busy { color: #60a5fa; }

/* =============================================================================
   DATA STATUS LABEL — e.g. "LIVE FROM CLOUD · 14:32 EST"
   ============================================================================= */
.data-status {
    font-family: var(--font-data);
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

.data-status.live   { color: var(--gain); }
.data-status.syncing { color: #60a5fa; }

/* =============================================================================
   SYNC LOG — optional verbose output during long syncs
   ============================================================================= */
.sync-log {
    background: #020204;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: var(--font-data);
    font-size: 9px;
    color: var(--text-dim);
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.6;
}

.sync-log .ok  { color: var(--gain); }
.sync-log .err { color: var(--loss); }
.sync-log .dim { color: var(--text-dim); }
