/* Wiva – branded, neutral, white-label-vennlig stil. */
:root {
    --brand: #4f46e5;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --ink: #1e2233;
    --muted: #6b7280;
    --line: #e6e8ef;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .2em; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
h3 { font-size: 1rem; margin: 1.1em 0 .35em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
code { background: #f0f1f6; padding: .1em .4em; border-radius: 6px; font-size: .9em; }

/* Topbar */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 1.5rem;
    padding: .7rem 1.5rem;
    position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 1.1rem; flex: 1; }
.topbar nav a { color: var(--ink); font-weight: 500; }
.topbar nav .spacer { flex: 1; }
.topbar nav .who { color: var(--muted); font-size: .9em; }
.searchbox input {
    border: 1px solid var(--line); border-radius: 999px;
    padding: .4rem .9rem; min-width: 220px; background: var(--bg);
}

/* Layout */
.container { width: 100%; max-width: 1060px; margin: 0 auto; padding: 1.8rem 1.5rem; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.4rem; margin-bottom: 1.2rem;
}
.foot { text-align: center; color: var(--muted); font-size: .85em; padding: 1.5rem; }
.back { font-size: .9em; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; padding: .55rem 1rem; font-weight: 600; font-size: .92rem;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: #d2d6e2; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; }

/* Tables / lists */
table.list, table.tasks { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.list td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: #fafbff; }
table.list .title { font-weight: 600; }

.tag { display: inline-block; font-size: .75rem; padding: .12rem .5rem; border-radius: 6px;
    background: #eef0f7; color: #495066; }
.tag.hq { background: #fef3c7; color: #92590b; }

.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: .18rem .6rem; border-radius: 999px; }
.badge.queued { background: #eef0f7; color: #5b6172; }
.badge.processing { background: #e0f2fe; color: #075985; }
.badge.done { background: #dcfce7; color: #166534; }
.badge.failed { background: #fee2e2; color: #991b1b; }

/* Forms */
label { display: block; font-weight: 500; margin-bottom: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=file] {
    display: block; width: 100%; margin-top: .35rem;
    border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; font: inherit; background: var(--surface);
}
input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
fieldset.choice { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; }
fieldset.choice legend { font-weight: 600; padding: 0 .4rem; }
label.radio { font-weight: 400; display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
label.radio input { width: auto; margin: 0; }
.actions { display: flex; gap: .6rem; margin-top: .5rem; }
.form-card { max-width: 620px; }

/* Login */
.login-wrap { min-height: 70vh; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 380px; }
.login-head { text-align: center; margin-bottom: 1.2rem; }
.login-head h1 { margin: .4rem 0 .1rem; }

.alert { border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; }
.alert.error { background: #fee2e2; color: #991b1b; }

.empty { text-align: center; padding: 2.5rem; }

/* Meeting view */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.head-actions { display: flex; align-items: center; gap: .5rem; }
.meta { margin: .2rem 0 0; }

.note-section { margin-bottom: 1rem; }
.note-section h3 { color: var(--brand); }
table.tasks th, table.tasks td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.tasks th { font-size: .76rem; text-transform: uppercase; color: var(--muted); }

.transcript-head { display: flex; justify-content: space-between; align-items: center; }
.segments { max-height: 70vh; overflow-y: auto; padding-right: .4rem; }
.seg.new-speaker { margin-top: .9rem; }
.seg-speaker { font-weight: 700; font-size: .85rem; color: var(--c, var(--brand)); margin-bottom: .15rem; }
.seg-line { display: flex; gap: .6rem; align-items: baseline; }
.seg-line .ts { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; flex: 0 0 auto; }
.relabel { background: #fafbff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.relabel label { font-size: .85rem; }

/* Processing */
.processing { display: flex; align-items: center; gap: 1.2rem; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand);
    border-radius: 50%; animation: spin 1s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Search */
.search-form { display: flex; gap: .6rem; }
.search-form input { margin: 0; }
ul.results { list-style: none; margin: 0; padding: 0; }
ul.results li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
ul.results li:last-child { border-bottom: 0; }
.snippet { margin: .4rem 0 0; color: #444b5e; }
.snippet mark { background: #fff3bf; padding: 0 .1em; }
.hint { background: #fafbff; }
