/*
 * app.css – kopīgais noformējums visām lapām.
 * Krāsas un izmēri ir definēti vienuviet zemāk (:root), lai izskatu varētu mainīt šeit.
 */

:root {
    --paper: #F4F6F3;       /* lapas pamatkrāsa zem fona attēla */
    --surface: #FFFFFF;     /* paneļi, tabulas, formas */
    --ink: #16242B;         /* teksts un augšējā josla */
    --ink-soft: #3C4D55;    /* paskaidrojumu teksts */
    --muted: #51626A;       /* sekundārs teksts */
    --line: #D3DAD5;        /* līnijas un apmales */
    --line-soft: #E3E8E4;
    --head: #EEF1EE;        /* tabulu galvenes */
    --primary: #17616B;     /* galvenās pogas un saites */
    --primary-dark: #0E444B;
    --marker: #FFE25A;      /* dzeltenais: "jāpārbauda" un aktīvā izvēlne */
    --marker-soft: #FFF7CC;
    --danger: #A3261C;
    --ok-bg: #E6F4EA;  --ok-ink: #1E6B34;
    --err-bg: #FDECEA; --err-ink: #8F1D15;
    --info-bg: #E8F1FB; --info-ink: #1C4F82;
    --radius: 6px;
    --font: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
    --font-head: "Segoe UI Semibold", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper) url('background.png') center top / cover no-repeat fixed;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; }

/* ===== Augšējā josla ar izvēlni ===== */
.topbar {
    background: var(--ink);
    color: #FFFFFF;
    padding: 0 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 40px;
    row-gap: 0;
    min-height: 64px;
}
.topbar .brand {
    display: flex; align-items: center; gap: 10px;
    color: #FFFFFF; text-decoration: none;
    font-family: var(--font-head); font-weight: 600; font-size: 22px;
    min-height: 44px;
}
.topbar .brand::before { content: ""; width: 14px; height: 14px; background: var(--marker); }
.topbar nav { display: flex; flex-wrap: wrap; column-gap: 26px; flex-grow: 1; }
.topbar nav a {
    color: #C9D3D0; text-decoration: none;
    min-height: 64px; display: flex; align-items: center;
}
.topbar nav a:hover { color: #FFFFFF; }
.topbar nav a[aria-current="page"] { color: #FFFFFF; font-weight: 600; box-shadow: inset 0 -4px 0 var(--marker); }
.topbar .account { display: flex; align-items: center; gap: 20px; font-size: 14px; color: #C9D3D0; }
.topbar .account a { color: #FFFFFF; min-height: 44px; display: flex; align-items: center; }

/* ===== Lapas saturs ===== */
.page { max-width: 1180px; margin: 0 auto; padding: 40px 32px 72px; }
.page.narrow { max-width: 760px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 38px; overflow-wrap: anywhere; }
.page-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.page-links a { min-height: 44px; display: flex; align-items: center; }

.container { max-width: none; margin: 0; padding: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.card h2 { margin: 0 0 12px; font-size: 22px; }
.card h3 { margin: 16px 0 8px; font-size: 18px; }
.card.warn { border-left: 6px solid var(--marker); }
.card ul { margin: 8px 0; padding-left: 20px; line-height: 1.6; }

.note { color: var(--ink-soft); max-width: 78ch; margin: 0 0 12px; }
.sub, .hint { display: block; font-size: 13px; color: var(--muted); font-weight: normal; }
.hint { display: inline; }

/* ===== Paziņojumi ===== */
.msg, .success, .error {
    padding: 12px 16px; border-radius: var(--radius); margin: 0 0 20px;
    overflow-wrap: anywhere;
}
.msg.ok, .success { background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.msg.err, .error { background: var(--err-bg); color: var(--err-ink); }
.msg.info { background: var(--info-bg); color: var(--info-ink); }
.msg.err div { margin: 2px 0; }

/* ===== Formas ===== */
label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=number] {
    font: inherit; color: var(--ink); background: var(--surface);
    border: 1px solid #8A9A94; border-radius: var(--radius);
    padding: 0 12px; min-height: 44px; width: 100%; max-width: 520px;
}
input[type=file] { font: inherit; max-width: 100%; }
td input[type=text] { min-height: 36px; width: auto; min-width: 180px; max-width: 320px; }
.row { display: flex; gap: 10px; max-width: 520px; }
.row input { flex: 1; }

.type-switch { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0; }
.type-switch label, label.check, label.inline-check {
    display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer;
}
label.check { margin-top: 16px; }
label.inline-check { font-size: 13px; font-weight: normal; margin: 0 8px; white-space: nowrap; }
.type-fixed { background: var(--head); border-radius: var(--radius); padding: 10px 14px; max-width: 520px; }

/* ===== Pogas ===== */
button, a.btn, a.back-btn, .file-label {
    font: inherit; font-weight: 600;
    color: #FFFFFF; background: var(--primary);
    border: 0; border-radius: var(--radius);
    padding: 0 20px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; text-decoration: none;
    margin: 12px 8px 0 0;
}
button:hover, a.btn:hover, .file-label:hover { background: var(--primary-dark); color: #FFFFFF; }
button:disabled { background: #B9C3BE; cursor: not-allowed; }

button.secondary, a.back-btn, button.reset, button.edit {
    background: var(--surface); color: var(--ink); border: 1px solid #8A9A94;
}
button.secondary:hover, a.back-btn:hover, button.reset:hover, button.edit:hover { background: var(--head); color: var(--ink); }

button.danger, button.delete, button.stop, #abort-btn { background: var(--danger); }
button.danger:hover, button.delete:hover, button.stop:hover, #abort-btn:hover { background: #7C1B13; }

/* Pogas tabulās: mazākas, dzēšana kā klusa saite atstatu no pārējām */
td button, td a.btn, button.small, a.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; margin: 2px 6px 2px 0; }
td button.delete, td a.delete {
    background: none; color: var(--muted); border: 0; padding: 0 4px; margin-left: 12px;
    text-decoration: underline; font-weight: normal;
}
td button.delete:hover, td a.delete:hover { background: none; color: var(--danger); }
td a.edit, td a.delete { display: inline-flex; align-items: center; min-height: 36px; font-size: 14px; }
td a:has(> button) { text-decoration: none; }
form.inline, td form { display: inline; margin: 0; }
td button.danger { background: var(--danger); color: #FFFFFF; text-decoration: none; padding: 0 12px; }

/* ===== Tabulas ===== */
table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
th { background: var(--head); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.table-box, .scroll {
    overflow-x: auto; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0 20px;
}
.scroll { max-height: 420px; overflow-y: auto; }
.scroll th { position: sticky; top: 0; }
a.filename, a.sheetname { font-weight: 600; }
.file-title, .group-title { font-family: var(--font-head); font-weight: 600; font-size: 18px; margin: 28px 0 8px; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 8px; }
.top-actions .info { font-weight: 600; }

details { margin-top: 10px; font-size: 14px; }
details div { max-height: 220px; overflow: auto; background: var(--head); padding: 10px; border-radius: var(--radius); overflow-wrap: anywhere; }

/* ===== Skaitļi un atzīmes ===== */
.stats-row, .stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.stat { background: var(--head); border-radius: var(--radius); padding: 10px 16px; font-size: 14px; }
.stat strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.chip, .mark-chip { background: var(--marker); color: #2B2600; padding: 2px 8px; border-radius: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mark { display: inline-block; width: 14px; height: 14px; background: var(--marker); vertical-align: middle; margin-right: 6px; }

.meter { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter i { display: block; width: 96px; height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.meter i b { display: block; height: 8px; background: var(--primary); }

/* ===== Norises josla (ielāde un analīze) ===== */
.progress-container, .bar { width: 100%; max-width: 560px; height: 28px; background: var(--line-soft); border-radius: var(--radius); overflow: hidden; margin: 16px 0 8px; }
.progress-bar, .bar .fill { height: 28px; width: 0; background: var(--primary); color: #FFFFFF; text-align: center; line-height: 28px; font-weight: 600; transition: width 0.3s; }
#progress-text, #txt { font-weight: 600; }
#sub { color: var(--muted); min-height: 24px; margin: 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 0 4px; }

/* ===== Sākumlapa ===== */
.home { display: flex; flex-wrap: wrap; gap: 48px; }
.home-main { flex: 999 1 560px; min-width: 0; }
.home-side { flex: 1 1 300px; min-width: 0; padding-top: 8px; }
.home-main h1 { margin: 0 0 16px; font-size: 44px; }
.lead { margin: 0 0 20px; max-width: 56ch; font-size: 18px; color: var(--ink-soft); }
.home-side h2 { margin: 0 0 16px; font-size: 22px; }
.home-fact { margin: 0 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; flex-direction: column; gap: 4px; padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.recent a { font-weight: 600; overflow-wrap: anywhere; }
.recent span { font-size: 14px; color: var(--muted); }
.upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
.upload-actions button { margin: 0; min-height: 48px; padding: 0 24px; }
.upload-actions p { margin: 0; font-size: 14px; color: var(--muted); max-width: 44ch; }

/* Tāmes lapas paraugs: kuras kolonnas aizpilda klients, kuras programma */
.sheet-box { overflow-x: auto; }
.sheet { min-width: 520px; display: grid; grid-template-columns: 44px minmax(0, 3fr) 76px 88px minmax(0, 2fr); font-size: 14px; border: 1px solid var(--line); }
.sheet > div { padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sheet > div:nth-child(5n) { border-right: 0; }
.sheet > div:nth-last-child(-n+5) { border-bottom: 0; }
.sheet .h { background: var(--head); font-weight: 600; }
.sheet .h span { font-weight: 400; color: var(--muted); }
.sheet .n { background: var(--head); color: var(--muted); text-align: right; }
.sheet .q { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .f { background: var(--marker-soft); color: #4A4100; }
.sheet .h.f { background: var(--marker); color: #2B2600; }

/* ===== Saišu saraksts (datu bāzes lapa) ===== */
.links { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.links li { border-bottom: 1px solid var(--line-soft); }
.links li:last-child { border-bottom: 0; }
.links a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; padding: 16px 20px; text-decoration: none; color: var(--ink); }
.links a:hover { background: var(--head); }
.links strong { flex: 0 0 240px; color: var(--primary); font-size: 17px; }
.links span { flex: 1 1 300px; color: var(--ink-soft); }
.links em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== Pieslēgšanās lapa ===== */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-side {
    flex: 1 1 420px; background: var(--ink); color: #FFFFFF; padding: 48px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.login-side .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 22px; }
.login-side .brand::before { content: ""; width: 14px; height: 14px; background: var(--marker); }
.login-side .claim { color: #FFFFFF; margin: 0 0 24px; max-width: 14ch; font-family: var(--font-head); font-weight: 600; font-size: 48px; line-height: 1.05; }
.login-side p { margin: 0; max-width: 40ch; color: #C9D3D0; font-size: 18px; }
.login-main { flex: 1 1 420px; padding: 48px 24px; display: flex; align-items: center; justify-content: center; }
.login-form { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.login-form h1 { margin: 24px 0 4px; font-size: 32px; }
.login-form input { max-width: none; min-height: 48px; }
.login-form button { width: 100%; min-height: 48px; margin: 24px 0 0; }
.lang { display: inline-flex; border: 1px solid #B9C3BE; border-radius: var(--radius); overflow: hidden; }
.lang a { padding: 0 16px; min-height: 44px; display: flex; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface); }
.lang a[aria-current="true"] { background: var(--ink); color: #FFFFFF; font-weight: 600; }

/* Vecās ikonas un rindkopas, kas jaunajā izskatā nav vajadzīgas */
.icon { display: none; }
footer { display: none; }

@media (max-width: 700px) {
    .topbar { padding: 8px 16px; column-gap: 20px; }
    .topbar nav a { min-height: 44px; }
    .page { padding: 24px 16px 56px; }
    .page-head h1, .home-main h1 { font-size: 30px; }
    .login-side { padding: 32px 24px; }
    .login-side .claim { font-size: 34px; }
    .links strong { flex-basis: 100%; }
}

/* ===== Atsevišķu lapu elementi ===== */
.file-upload-row, .form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-top: 12px; }
.file-upload-row button, .form-row button { margin: 0; }
.file-label { display: block; background: none; color: var(--ink); padding: 0; min-height: 0; margin: 0; cursor: default; font-weight: 600; }
.file-label:hover { background: none; color: var(--ink); }
.file-label input[type=file], input.file-input { display: block; margin-top: 8px; font-weight: normal; }
a.back-btn { display: none; }
.stats { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 20px; line-height: 1.8; }
.card .stats { border: 0; padding: 0; }
a.btn.dashboard { background: var(--surface); color: var(--ink); border: 1px solid #8A9A94; }
a.btn.dashboard:hover { background: var(--head); color: var(--ink); }
p.info { color: var(--ink-soft); max-width: 60ch; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.box h2 { margin: 0; font-size: 22px; }

/* Labojumi pēc pārbaudes ar ekrānuzņēmumiem */
td.actions { white-space: nowrap; }
.row { align-items: center; }
.row button { margin: 0; }
a.btn.backup, button.backup { background: #2E7D4F; }
a.btn.backup:hover, button.backup:hover { background: #1F5E3A; }

/* ===== Paroles lauks: poga "Rādīt" un Caps Lock brīdinājums ===== */
.pw-wrap { position: relative; max-width: 520px; }
.login-form .pw-wrap { max-width: none; }
.pw-wrap input[type=password], .pw-wrap input[type=text] { max-width: none; padding-right: 96px; }
.pw-wrap .pw-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: auto; min-height: 36px; margin: 0; padding: 0 12px;
    background: none; color: var(--primary); border: 0; border-radius: var(--radius);
    font-size: 14px; font-weight: 600;
}
.pw-wrap .pw-toggle:hover { background: var(--head); color: var(--primary-dark); }
.pw-caps {
    display: inline-block; margin: 8px 0 0; padding: 4px 10px;
    background: var(--marker); color: #2B2600; border-radius: var(--radius);
    font-size: 14px; font-weight: 600;
}
.pw-caps[hidden] { display: none; }

/* ===== Sākumlapa: trīs galvenās sadaļas ===== */
.page-head .lead { margin-top: 8px; }
.sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 8px 0 48px; }
.section-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; color: var(--ink); text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.section-card:hover { color: var(--ink); border-color: var(--primary); transform: translateY(-2px); }
.section-card.primary { border-top: 6px solid var(--marker); padding-top: 18px; }
.section-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-icon { width: 48px; height: 48px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.section-badge { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--marker-soft); color: #4A4100; white-space: nowrap; }
.section-badge.muted { background: var(--head); color: var(--muted); }
.section-card h2 { margin: 0 0 10px; font-size: 24px; }
.section-card p { margin: 0 0 18px; color: var(--ink-soft); }
.section-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 22px; font-size: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.section-card dt { color: var(--muted); }
.section-card dd { margin: 0; font-weight: 600; }
.section-go { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: var(--radius); background: var(--primary); color: #FFFFFF; font-weight: 600; }
.section-card:hover .section-go { background: var(--primary-dark); }
.home-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.home-lists h2 { margin: 0 0 16px; font-size: 20px; }
.home-lists .home-fact { border-bottom: 0; }

/* ===== Tāme pēc projekta ===== */
.crumbs { margin: 0 0 6px; font-size: 14px; }
.project-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.project-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 4px; }
.project-upload input[type=file] { flex: 1 1 260px; }
.hint-line { font-size: 14px; color: var(--muted); margin: 6px 0 12px; }
.empty-state { padding: 20px; background: var(--head); border-radius: var(--radius); color: var(--ink-soft); margin: 12px 0 0; }
.file-type { font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 4px; background: var(--head); color: var(--ink-soft); }
.card textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #8A9A94; border-radius: var(--radius); resize: vertical; }
button:disabled { background: #9AA8A3; cursor: not-allowed; }
.dev-card { max-width: 760px; }
.dev-card .section-badge { display: inline-block; margin-bottom: 12px; }

@media (max-width: 1000px) {
    .sections, .home-lists { grid-template-columns: 1fr; }
    .project-grid { grid-template-columns: 1fr; }
}
.page-head.stack { display: block; }
.page-head.stack h1 { margin-bottom: 0; }
td form.inline button.delete { margin: 0; min-height: 0; padding: 0; }

/* ===== Pieslēgšanās: portāla sadaļas ===== */
.login-side .claim { max-width: 16ch; }
.login-features { list-style: none; margin: 32px 0 0; padding: 0; max-width: 46ch; }
.login-features li { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.14); }
.login-features strong { display: block; color: #FFFFFF; font-size: 17px; margin-bottom: 2px; }
.login-features em { font-style: normal; font-size: 12px; font-weight: 600; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--marker); color: #2B2600; vertical-align: 2px; }
.login-features span { color: #C9D3D0; font-size: 15px; }
@media (max-width: 860px) {
    .login-main { order: -1; padding-bottom: 24px; }
    .login-side { gap: 24px; }
}

.sub-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 12px 0 0; font-weight: 600; }
.topbar .account a[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--marker); }

/* Garākam nosaukumam un izvēlnei – mazākas atstarpes, lai ietilptu vienā rindā */
.topbar { column-gap: 28px; }
.topbar nav { column-gap: 20px; }
.topbar { padding: 0 24px; column-gap: 24px; }
.topbar nav { column-gap: 18px; }
.topbar nav a { font-size: 15px; }
.topbar .account { gap: 14px; }

/* =====================================================================
   Dizains "Būvlaukums" (B): Archivo virsrakstiem, Source Sans 3 tekstam,
   brīdinājuma josla zem galvenes. Šis bloks pārraksta iepriekšējos stilus.
   ===================================================================== */
:root {
    --font: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
    --font-head: "Archivo", "Segoe UI Semibold", "Helvetica Neue", Arial, system-ui, sans-serif;
    --radius: 4px;
    --radius-card: 6px;
}
body { font-size: 17px; background-color: #F1F3EF; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; }

/* Galvene */
.topbar { min-height: 68px; padding: 0 32px; column-gap: 32px; }
.topbar .brand { font-family: var(--font-head); font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
.topbar .brand::before { width: 16px; height: 16px; }
.topbar nav { column-gap: 24px; }
.topbar nav a { min-height: 68px; font-size: 16px; }
.topbar nav a[aria-current="page"] { font-weight: 700; }
.topbar .account { gap: 16px; font-size: 15px; }
.topbar .account a.account-name { gap: 10px; color: #FFFFFF; text-decoration: none; font-weight: 600; }
.topbar .account a.account-name:hover span:last-child { text-decoration: underline; }
.topbar .account a.account-name[aria-current="page"] { box-shadow: none; }
.topbar .account a.account-name[aria-current="page"] .avatar { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.avatar {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
    background: var(--marker); color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 0;
}
.topbar .account a.logout { color: #C9D3D0; }
.stripe { height: 6px; background: repeating-linear-gradient(-45deg, var(--marker) 0 14px, var(--ink) 14px 28px); }

/* Lapas virsraksti */
.page { padding-top: 44px; }
.page-head h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.04; }
.page-head .lead { color: var(--ink-soft); font-size: 18px; }

/* Kartītes, tabulas, pogas */
.card, .box, .links, .table-box { border-radius: var(--radius-card); }
.card h2, .box h2 { font-size: 24px; }
button, a.btn, a.back-btn, .file-label { border-radius: var(--radius); font-weight: 700; }
th { font-family: var(--font); font-weight: 700; }
input[type=text], input[type=email], input[type=password], input[type=number], .card textarea { border-radius: var(--radius); min-height: 46px; }

/* Sadaļu virsraksts ar biezu līniju (sarakstiem) */
.rule-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 4px; }
.rule-head h2 { margin: 0; font-size: 22px; }
.rule-head a { font-weight: 600; min-height: 44px; display: flex; align-items: center; }

/* ===== Sākumlapa (B) ===== */
.home-b { display: flex; flex-direction: column; gap: 36px; }
.home-b .home-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.home-b h1 { margin: 0; max-width: 17ch; font-size: 52px; font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; }
.home-b .home-title p { margin: 0; max-width: 36ch; color: var(--ink-soft); }
.feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.feature-main {
    display: flex; flex-direction: column; gap: 16px; min-height: 360px;
    background: var(--ink); color: #C9D3D0; border-radius: var(--radius-card); padding: 32px; text-decoration: none;
}
.feature-main:hover { color: #C9D3D0; }
.feature-main h2 { margin: 0; color: #FFFFFF; font-size: 34px; line-height: 1.05; }
.feature-main p { margin: 0; max-width: 42ch; font-size: 18px; }
.feature-main .feature-go { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; font-size: 15px; }
.feature-main .feature-go span:first-child { display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; border-radius: var(--radius); background: var(--marker); color: var(--ink); font-weight: 700; font-size: 18px; }
.feature-main:hover .feature-go span:first-child { background: #FFF0A0; }
.feature-side { display: grid; grid-auto-rows: 1fr; gap: 20px; }
.feature-tile {
    display: flex; gap: 20px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-card); padding: 24px; text-decoration: none; color: var(--ink);
}
.feature-tile:hover { color: var(--ink); border-color: var(--ink); }
.feature-tile svg { flex: 0 0 40px; }
.feature-tile div { display: flex; flex-direction: column; gap: 6px; }
.feature-tile .tile-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.feature-tile h2 { margin: 0; font-size: 24px; line-height: 1.1; }
.feature-tile p { margin: 0; color: var(--ink-soft); }
.feature-tile .tile-go { margin-top: 4px; font-weight: 700; color: var(--primary); }
.pill { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #FFF2A8; color: #4A4100; white-space: nowrap; }
.pill.muted { background: var(--head); color: var(--muted); }
.lower-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.item-list li a > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.item-list strong { color: var(--primary); font-weight: 700; overflow-wrap: anywhere; }
.item-list li a:hover strong { text-decoration: underline; }
.item-list small { font-size: 15px; color: var(--muted); }
.item-list .flag { background: var(--marker); color: #2B2600; padding: 2px 8px; border-radius: 3px; font-size: 15px; white-space: nowrap; }
.empty-line { color: var(--ink-soft); padding: 12px 0; margin: 0; }

/* ===== Projekts (B) ===== */
.file-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.file-tile { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; }
.file-tile a.filename { font-weight: 700; overflow-wrap: anywhere; }
.file-tile .file-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.file-tile form button.delete { font-size: 14px; }
.ftype { align-self: flex-start; font-family: var(--font-head); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 3px; background: var(--ink); color: var(--marker); }
.ftype.pdf { background: #8F1D15; color: #FFFFFF; }
.ftype.xls, .ftype.xlsx, .ftype.ods, .ftype.csv { background: #1E6B34; color: #FFFFFF; }
.ftype.doc, .ftype.docx, .ftype.odt, .ftype.rtf, .ftype.txt { background: #1C4F82; color: #FFFFFF; }
.ftype.jpg, .ftype.jpeg, .ftype.png { background: #6B4E9B; color: #FFFFFF; }
.drop {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
    padding: 20px 24px; border: 2px dashed #8A9A94; border-radius: var(--radius-card); background: rgba(255,255,255,0.75); margin: 0;
}
.drop strong { display: block; }
.drop small { font-size: 15px; color: var(--muted); font-weight: normal; }
.drop input[type=file] { max-width: 280px; }
.ai-bar { background: var(--ink); color: #C9D3D0; border-radius: var(--radius-card); padding: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.ai-bar h2 { margin: 0 0 6px; color: #FFFFFF; font-size: 22px; }
.ai-bar p { margin: 0; max-width: 60ch; }
.ai-bar button:disabled { background: #3A4E56; color: #A9B8B3; }

/* Pieslēgšanās lapa ar jaunajiem fontiem */
.login-side .brand { font-weight: 800; }
.login-side .claim { font-weight: 800; letter-spacing: -0.02em; }

@media (max-width: 900px) {
    .feature, .lower-lists { grid-template-columns: 1fr; }
    .home-b h1, .page-head h1 { font-size: 34px; }
    .topbar .account a.account-name span:last-child { display: none; }
}

/* Labojumi: dzēšanas saites, galvene ar daudz punktiem, telefons */
.file-tile form button.delete, .danger-link button {
    background: none; border: 0; padding: 0; min-height: 44px; font-weight: 600; font-size: 14px;
    color: var(--danger); text-decoration: underline; cursor: pointer;
}
.file-tile form button.delete:hover, .danger-link button:hover { background: none; color: #7C1B13; }
.danger-link { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-top: 4px; }
.danger-link button { font-size: 15px; }
.danger-link span { font-size: 14px; color: var(--muted); }
@media (max-width: 1440px) {
    .topbar.many .account a.account-name span:last-child { display: none; }
}
@media (max-width: 900px) {
    .topbar { padding: 8px 16px; }
    .topbar nav a { min-height: 44px; }
}
