/* Apogee V2 - MVP-5 minimal UI styles.
 * Operational tool feel: dense, restrained, stable dimensions.
 * No decorative gradients, no orbs, no marketing surfaces. */

:root {
    --bg:        #f7f7f5;
    --surface:   #ffffff;
    --surface-2: #f1f0ec;
    --border:    #d6d4cf;
    --text:      #1c1c1a;
    --text-soft: #5a5854;
    --accent:    #2a5a4b;       /* deep teal-green; not Linear-purple */
    --accent-2:  #1f4438;
    --warn:      #8a5a00;
    --warn-bg:   #fff8e1;
    --err:       #8a1f1a;
    --err-bg:    #fbe9e7;
    --ok:        #1f5a2a;
    --ok-bg:     #e7f3e9;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
            Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.4;
}

a {
    color: var(--accent-2);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---- app shell ---- */
.app {
    display: grid;
    grid-template-rows: 44px 1fr 28px;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.topbar .brand {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent-2);
}
.topbar .brand .v { color: var(--text-soft); font-weight: 400; margin-left: 4px; }
.topbar nav {
    display: flex;
    gap: 0;
}
.topbar nav a {
    padding: 0.5rem 0.75rem;
    color: var(--text-soft);
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.topbar nav a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--text-soft); font-family: var(--mono); }
.topbar .who .email { color: var(--text); margin-left: 4px; }
.topbar button {
    padding: 0.3rem 0.7rem;
}

main {
    padding: 1rem 1rem 2rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

footer.statusbar {
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    font-family: var(--mono);
    font-size: 12px;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ---- forms ---- */
.form-row { display: grid; grid-template-columns: 110px 1fr; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.form-row label { color: var(--text-soft); font-size: 13px; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 3px;
    font-family: var(--sans);
    font-size: 14px;
}
input[type="file"] { font-size: 13px; }

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 0;
    border-color: var(--accent);
}

button {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    font-family: var(--sans);
    font-size: 13px;
    border-radius: 3px;
    cursor: pointer;
    min-width: 72px;
}
button:hover:not(:disabled) { background: var(--surface-2); }
button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
button.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---- panels ---- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}
.panel h1, .panel h2 {
    margin: 0 0 0.6rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.panel h1 { font-size: 16px; }
.panel .muted { color: var(--text-soft); font-size: 13px; }

/* ---- tables (file lists) ---- */
table.files {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}
table.files th, table.files td {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
table.files th { color: var(--text-soft); font-weight: 500; background: var(--surface-2); }
table.files tr:hover td { background: var(--surface-2); }
table.files td.id { font-family: var(--mono); font-size: 12px; color: var(--text-soft); }
table.files td.actions button { padding: 0.2rem 0.5rem; font-size: 12px; min-width: 0; }

/* ---- progress bar (stable height) ---- */
.progress {
    height: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.4rem 0;
}
.progress > .bar {
    height: 100%;
    background: var(--accent);
    transition: width 120ms linear;
}

/* ---- alerts ---- */
.alert {
    padding: 0.5rem 0.7rem;
    border-radius: 3px;
    margin: 0.5rem 0;
    font-size: 13px;
    border-left: 3px solid;
}
.alert.error { background: var(--err-bg); border-left-color: var(--err); color: var(--err); }
.alert.warn  { background: var(--warn-bg); border-left-color: var(--warn); color: var(--warn); }
.alert.ok    { background: var(--ok-bg);  border-left-color: var(--ok);  color: var(--ok); }

/* ---- code/hash readouts ---- */
.kv { font-family: var(--mono); font-size: 12px; color: var(--text-soft); word-break: break-all; }
code { font-family: var(--mono); font-size: 12px; }

/* ---- toolbar layout ---- */
.row { display: flex; gap: 0.5rem; align-items: center; }
.row > * + * { margin-left: 0; }
.spacer { flex: 1; }

/* ---- responsive ---- */
@media (max-width: 720px) {
    .form-row { grid-template-columns: 1fr; }
    .form-row label { font-size: 12px; }
    .topbar nav a { padding: 0.5rem 0.5rem; }
    main { padding: 0.75rem; }
}
