/* Verkkoversion (web_bot) tyylit. Suunniteltu ensisijaisesti puhelimelle:
   iso fontti, isot kosketusalueet, ei vaakavieritystä. Värit ovat samat kuin
   paikallisen dashboardin. */
:root {
    --bg: #eef1f0;
    --panel: #ffffff;
    --ink: #16232f;
    --muted: #5d6c78;
    --line: #dbe2e4;
    --steel: #2f5d75;
    --steel-dark: #1d3a4a;
    --amber: #8f590a;
    --amber-bg: #fbeed7;
    --green: #1f5c3a;
    --green-bg: #e2f2e7;
    --red: #a3352a;
    --red-bg: #f8e3e0;
    --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
    --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.45;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--steel); }

.top {
    background: var(--steel-dark);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.6rem 1rem;
}
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; font-size: 0.9rem; }
.top nav a { color: #fff; padding: 0.4rem 0; }
.top nav form { margin: 0; }
.link-button {
    background: none; border: none; color: #fff; font: inherit; font-size: 0.9rem;
    text-decoration: underline; cursor: pointer; padding: 0.4rem 0;
}

main { flex: 1; width: 100%; max-width: 60rem; margin: 0 auto; padding: 1rem; }

footer {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem;
    padding: 0.75rem 1rem; color: var(--muted); font-size: 0.8rem;
}

footer .attribution { flex-basis: 100%; font-size: 0.75rem; }
footer .attribution a { color: inherit; }

h1 { font-size: 1.4rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.narrow { max-width: 26rem; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.lead { font-size: 1.15rem; }

label { font-weight: 600; font-size: 0.9rem; }
input[type="text"], input[type="password"], input[type="search"], select {
    width: 100%;
    font: inherit;
    font-size: 1.1rem;
    padding: 0.65rem 0.75rem;
    border: 2px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    min-height: 3rem;
}
input:focus, select:focus, button:focus-visible, a:focus-visible {
    outline: 3px solid #7fb0c9;
    outline-offset: 1px;
    border-color: var(--steel);
}

.stack { display: flex; flex-direction: column; gap: 0.4rem; }
.stack .btn { margin-top: 0.75rem; }

.btn {
    font: inherit;
    font-weight: 700;
    background: var(--steel);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.65rem 1.25rem;
    min-height: 3rem;
    cursor: pointer;
}
.btn:hover { background: var(--steel-dark); }
.btn-small { font-size: 0.8rem; padding: 0.35rem 0.7rem; min-height: 2.25rem; font-weight: 600; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red-bg); }

.search label { display: block; margin-bottom: 0.4rem; }
.search-row { display: flex; gap: 0.5rem; }
.search-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 1.25rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.warn { color: var(--red); font-weight: 600; }

.alert { border-radius: 6px; padding: 0.75rem 1rem; margin: 0 0 1rem; }
.alert-error { background: var(--red-bg); color: var(--red); font-weight: 600; }
.alert-info { background: var(--amber-bg); color: var(--amber); }
.alert-ok { background: var(--green-bg); color: var(--green); font-weight: 600; }
.alert-empty { background: var(--panel); border: 1px solid var(--line); font-size: 1.1rem; }

.summary { font-size: 1.05rem; margin: 0 0 0.75rem; }
.freshness { color: var(--muted); font-size: 0.85rem; margin: 1rem 0 0; }

.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.order {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}
.order-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.75rem; }
.code { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; overflow-wrap: anywhere; }
.desc { margin: 0.2rem 0 0.6rem; color: var(--muted); overflow-wrap: anywhere; }
.order dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.5rem 1rem; margin: 0.5rem 0 0; }
dt { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 0.25rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-arrived { background: var(--green-bg); color: var(--green); }
.status-partial { background: var(--amber-bg); color: var(--amber); }
.status-transit { background: #dfeaf1; color: var(--steel-dark); }
.status-unknown { background: var(--line); color: var(--muted); }

.status-list { display: grid; gap: 0.5rem; margin: 0; }
.status-list div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.1rem 1rem; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.status-list dt { text-transform: none; font-size: 0.9rem; letter-spacing: 0; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
tr.inactive td { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.actions form { margin: 0; }

.inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.inline-form label { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 12rem; }

.temp-password { border-color: var(--green); background: var(--green-bg); }
.password { font-size: 1.4rem; font-weight: 700; user-select: all; }

@media (max-width: 30rem) {
    main { padding: 0.75rem; }
    .search-row { flex-direction: column; }
}
