/* style-45-api-keys.css — FEAT-232-P2 API Key Management */
/* Prefix: ak- | Themes: dark (default) + light override */

/* ── Header actions ─────────────────────────────────────────────────────── */
.ak-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ak-btn {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    transition: opacity 0.15s, background 0.15s;
    white-space: nowrap;
}
.ak-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.ak-btn-primary {
    background: #4a9eff;
    color: #fff;
}
.ak-btn-primary:hover:not(:disabled) { background: #2d82e0; }
.ak-btn-secondary {
    background: #3a3f4b;
    color: #d0d4dc;
}
.ak-btn-secondary:hover:not(:disabled) { background: #454b5a; }
.ak-btn-danger {
    background: #c0392b;
    color: #fff;
}
.ak-btn-danger:hover:not(:disabled) { background: #a93226; }
.ak-btn-copy {
    background: #2ecc71;
    color: #fff;
    padding: 5px 12px;
    font-size: 12px;
    flex-shrink: 0;
}
.ak-btn-copy:hover { background: #27ae60; }
.ak-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ── Status bar ──────────────────────────────────────────────────────────── */
.ak-status-bar { min-height: 32px; margin-bottom: 8px; }
.ak-status-success {
    background: #1a4731;
    color: #4ade80;
    border: 1px solid #166534;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
}
.ak-status-error {
    background: #4a1414;
    color: #f87171;
    border: 1px solid #7f1d1d;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
}

/* ── Table ───────────────────────────────────────────────────────────────── */
.ak-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 4px;
}
.ak-thead-row th {
    background: #1e2230;
    color: #8b95a5;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2f3e;
    text-align: left;
}
.ak-col-actions { text-align: center; }
.ak-tr td {
    padding: 10px 12px;
    border-bottom: 1px solid #1e2230;
    color: #c8cdd8;
    vertical-align: middle;
}
.ak-tr:hover td { background: rgba(74, 158, 255, 0.05); }
.ak-tr-disabled td { opacity: 0.55; }
.ak-cell-muted { color: #636b7a; font-size: 12px; }

/* Key prefix monospace */
.ak-prefix {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    background: #161a24;
    padding: 2px 6px;
    border-radius: 4px;
    color: #7dd3fc;
}

/* Status badges */
.ak-badge {
    display: inline-block;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    letter-spacing: 0.03em;
}
.ak-badge-active   { background: #14532d; color: #4ade80; }
.ak-badge-disabled { background: #450a0a; color: #f87171; }

/* Action buttons row */
.ak-action-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Empty state */
.ak-empty {
    color: #636b7a;
    padding: 32px;
    text-align: center;
    font-size: 14px;
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.ak-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Modal box ───────────────────────────────────────────────────────────── */
.ak-modal {
    background: #1e2230;
    border: 1px solid #2a2f3e;
    border-radius: 10px;
    width: 480px;
    max-width: 95vw;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}
.ak-modal-sm  { width: 380px; }
.ak-modal-wide { width: 640px; }

.ak-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #2a2f3e;
    background: #252b3a;
    border-radius: 10px 10px 0 0;
}
.ak-modal-header-warn   { background: #3d2c00; border-bottom-color: #7c5a00; }
.ak-modal-header-danger { background: #3d0e0e; border-bottom-color: #7c1d1d; }

.ak-modal-title { font-size: 15px; font-weight: 600; color: #e0e5f0; }
.ak-modal-close {
    background: none;
    border: none;
    color: #636b7a;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
}
.ak-modal-close:hover { color: #c8cdd8; }

.ak-modal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ak-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 14px 18px;
    border-top: 1px solid #2a2f3e;
}

/* ── Form controls ───────────────────────────────────────────────────────── */
.ak-form-label {
    font-size: 12px;
    font-weight: 600;
    color: #8b95a5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.ak-form-input {
    width: 100%;
    background: #141720;
    border: 1px solid #2a2f3e;
    border-radius: 6px;
    color: #c8cdd8;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    box-sizing: border-box;
}
.ak-form-input:focus { border-color: #4a9eff; }
.ak-form-select { font-size: 13px; }

/* ── Show-once modal content ─────────────────────────────────────────────── */
.ak-showonce-warning {
    background: #3d2c00;
    border: 1px solid #7c5a00;
    border-radius: 6px;
    color: #fcd34d;
    font-size: 13px;
    padding: 10px 14px;
}
.ak-showonce-key-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #141720;
    border: 1px solid #2a2f3e;
    border-radius: 6px;
    padding: 10px 12px;
}
.ak-showonce-key {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    color: #7dd3fc;
    word-break: break-all;
    flex: 1;
    user-select: all;
}
.ak-copy-feedback {
    font-size: 12px;
    color: #4ade80;
    white-space: nowrap;
}
.ak-showonce-meta {
    font-size: 12px;
    color: #636b7a;
}

/* ── Edit / disable modal info ───────────────────────────────────────────── */
.ak-edit-info,
.ak-disable-info {
    background: #141720;
    border: 1px solid #2a2f3e;
    border-radius: 6px;
    color: #8b95a5;
    font-size: 13px;
    padding: 8px 12px;
}
.ak-edit-prefix,
.ak-disable-prefix {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
}
.ak-disable-warning {
    color: #f87171;
    font-size: 13px;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ══════════════════════════════════════════════════════════════ */
body[data-theme="light"] .ak-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}
body[data-theme="light"] .ak-btn-secondary:hover:not(:disabled) { background: #d1d5db; }

body[data-theme="light"] .ak-status-success {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
body[data-theme="light"] .ak-status-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

body[data-theme="light"] .ak-thead-row th {
    background: #f1f5f9;
    color: #64748b;
    border-bottom-color: #e2e8f0;
}
body[data-theme="light"] .ak-tr td {
    color: #374151;
    border-bottom-color: #e5e7eb;
}
body[data-theme="light"] .ak-tr:hover td { background: rgba(59, 130, 246, 0.04); }
body[data-theme="light"] .ak-cell-muted  { color: #94a3b8; }

body[data-theme="light"] .ak-prefix {
    background: #f1f5f9;
    color: #2563eb;
}

body[data-theme="light"] .ak-badge-active   { background: #dcfce7; color: #166534; }
body[data-theme="light"] .ak-badge-disabled { background: #fee2e2; color: #991b1b; }

body[data-theme="light"] .ak-modal {
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
body[data-theme="light"] .ak-modal-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}
body[data-theme="light"] .ak-modal-header-warn   { background: #fffbeb; border-bottom-color: #fde68a; }
body[data-theme="light"] .ak-modal-header-danger { background: #fff1f2; border-bottom-color: #fecaca; }
body[data-theme="light"] .ak-modal-title  { color: #1e293b; }
body[data-theme="light"] .ak-modal-close  { color: #94a3b8; }
body[data-theme="light"] .ak-modal-close:hover { color: #475569; }
body[data-theme="light"] .ak-modal-footer { border-top-color: #e2e8f0; }

body[data-theme="light"] .ak-form-label { color: #64748b; }
body[data-theme="light"] .ak-form-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}
body[data-theme="light"] .ak-form-input:focus { border-color: #3b82f6; }

body[data-theme="light"] .ak-showonce-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
body[data-theme="light"] .ak-showonce-key-row {
    background: #f8fafc;
    border-color: #cbd5e1;
}
body[data-theme="light"] .ak-showonce-key  { color: #2563eb; }
body[data-theme="light"] .ak-showonce-meta { color: #94a3b8; }

body[data-theme="light"] .ak-edit-info,
body[data-theme="light"] .ak-disable-info {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
}
body[data-theme="light"] .ak-disable-warning { color: #dc2626; }
body[data-theme="light"] .ak-empty { color: #94a3b8; }
