/* src/augmentor/assets/admin.css */
/* ==========================================================================
   AUGmentor Admin Interface
   Shared stylesheet for:
     - admin_login.html
     - admin_data_sync.html
     - admin_upload.html
   ========================================================================== */


/* ==========================================================================
   Design tokens (shared)
   ========================================================================== */

:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --border: #dee2e6;

    --text: #212529;
    --text-muted: #6c757d;

    --blue: #228be6;
    --blue-dark: #1971c2;

    --green: #2f9e44;
    --amber: #e67700;
    --red: #c92a2a;

    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    --radius: 6px;
}


/* ==========================================================================
   Reset & base typography (shared)
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Login page centres its card */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ==========================================================================
   Shared page layout
   (Data Sync + Upload)
   ========================================================================== */

.page-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;

    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}

.page-header a:hover {
    color: var(--text);
}

.page-header .sep {
    color: var(--border);
}

.page-header h1 {
    font-size: 16px;
    font-weight: 600;
}

.header-right {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 12px;
}

.user-label {
    font-size: 12px;
    color: var(--text-muted);
}

.page-body {
    max-width: 900px;
    margin: 32px auto;
    padding: 0 24px;

    display: flex;
    flex-direction: column;
    gap: 24px;
}


/* ==========================================================================
   Shared cards
   (Data Sync + Upload)
   ========================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h2 {
    font-size: 14px;
    font-weight: 600;
}

.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--mono);
}


/* ==========================================================================
   Shared tables
   (Data Sync + Upload)
   ========================================================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 10px 20px;

    text-align: left;

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;

    color: var(--text-muted);
    background: var(--bg);

    border-bottom: 1px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid var(--border);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 14px 20px;
    vertical-align: middle;
}

.job-name {
    font-size: 13px;
    font-weight: 600;
}

.s3-key {
    margin-top: 2px;

    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
}

.ts {
    font-family: var(--mono);
    font-size: 12px;
}

.ts-missing {
    color: var(--text-muted);
    font-style: italic;
}


/* ==========================================================================
   Shared buttons
   (Login + Data Sync + Upload)
   ========================================================================== */

.btn,
.btn-primary {
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.15s, opacity 0.15s;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 14px;

    font-size: 12px;

    border: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--blue-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--blue);

    border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
    background: #e7f5ff;
}

.btn-danger-ghost {
    background: transparent;
    color: var(--red);

    border: 1px solid var(--border);
}

.btn-danger-ghost:hover:not(:disabled) {
    background: #fff5f5;
}


/* Login page button */

.login-card .btn-primary {
    width: 100%;
    padding: 9px 14px;
    font-size: 13px;
}


/* ==========================================================================
   Shared form controls
   (Login + Upload)
   ========================================================================== */

.field {
    margin-bottom: 16px;
}

label {
    display: block;

    margin-bottom: 6px;

    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;

    color: var(--text-muted);
}

input[type="password"] {
    width: 100%;

    padding: 8px 12px;

    font-family: inherit;
    font-size: 14px;

    color: var(--text);
    background: var(--bg);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    outline: none;
    transition: border-color 0.15s;
}

input[type="password"]:focus {
    background: var(--surface);
    border-color: var(--blue);
}

input[type="file"] {
    max-width: 260px;

    font-family: inherit;
    font-size: 12px;
    color: var(--text);
}


/* ==========================================================================
   Shared console / log viewer
   (Data Sync + Upload)
   ========================================================================== */

.console-wrap {
    padding: 0 20px 20px;
}

.console-hidden {
    display: none;
}

#log-console {
    height: 280px;
    overflow-y: auto;

    padding: 14px 16px;

    background: #1e1e2e;
    color: #cdd6f4;

    border-radius: var(--radius);

    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.6;

    white-space: pre-wrap;
    word-break: break-all;
}

#log-console .log-info {
    color: #a6e3a1;
}

#log-console .log-warn {
    color: #f9e2af;
}

#log-console .log-error {
    color: #f38ba8;
}

#log-console .log-debug {
    color: #6c7086;
}

#log-console .log-done {
    color: #89dceb;
    font-weight: 600;
}


/* ==========================================================================
   Shared spinner
   (Data Sync + Upload)
   ========================================================================== */

.spinner {
    display: none;

    width: 14px;
    height: 14px;

    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;

    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ==========================================================================
   Upload page only
   ========================================================================== */

.banner-warn {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 12px 16px;

    background: #fff3bf;
    color: #664d00;

    border: 1px solid #ffe066;
    border-radius: var(--radius);

    font-size: 13px;
}

.banner-warn strong {
    font-weight: 600;
}

.file-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-hint {
    max-width: 260px;

    font-size: 11px;
    line-height: 1.5;

    color: var(--text-muted);
}

.file-hint code {
    padding: 1px 4px;

    background: var(--bg);

    border: 1px solid var(--border);
    border-radius: 3px;

    font-family: var(--mono);
    font-size: 10.5px;
}

.job-label {
    margin-top: 3px;

    font-size: 12px;
    color: var(--text-muted);
}

.s3-current {
    display: flex;
    flex-direction: column;
    gap: 2px;
}


/* ==========================================================================
   Data Sync page only
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 3px 8px;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
}

.badge-ok {
    background: #ebfbee;
    color: var(--green);
}

.badge-stale {
    background: #fff3bf;
    color: var(--amber);
}

.badge-unknown {
    background: #f1f3f5;
    color: var(--text-muted);
}

.action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}


/* ==========================================================================
   Login page only
   ========================================================================== */

.login-card {
    width: 100%;
    max-width: 360px;

    padding: 32px 36px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.login-header {
    margin-bottom: 24px;
}

.app-name {
    margin-bottom: 6px;

    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;

    color: var(--text-muted);
}

.login-header h1 {
    font-size: 20px;
    font-weight: 700;
}

.error-msg {
    margin-bottom: 14px;
    padding: 8px 12px;

    background: #fff5f5;
    color: var(--red);

    border: 1px solid #ffc9c9;
    border-radius: var(--radius);

    font-size: 13px;
}

.login-footer {
    margin-top: 20px;

    text-align: center;

    font-size: 12px;
    color: var(--text-muted);
}

.login-footer a {
    color: inherit;
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--text);
}
