/* Loopera näitude haldus — basic modern UI (build-free, served static). */
:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --border: #e3e8ef;
    --text: #1f2933;
    --muted: #647084;
    --accent: #1f7ae0;
    --accent-dark: #155bb0;
    --ok: #1f9d55;
    --warn: #b7791f;
    --danger: #d64545;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

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

/* ---- Top bar / nav ---- */
.topbar {
    background: #0f2540;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 56px;
    box-shadow: var(--shadow);
}
.topbar .brand { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.topbar .brand span { font-weight: 400; color: #9fb3cd; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.topbar nav a {
    color: #cdd9e8;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar nav a.active { background: var(--accent); color: #fff; }
.topbar nav a.logout { color: #9fb3cd; }

/* ---- Layout ---- */
.container { max-width: 1080px; margin: 28px auto; padding: 0 20px; }
h1 { font-size: 24px; margin: 0 0 20px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.muted { color: var(--muted); }
.row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    margin-bottom: 22px;
}
.card > h2:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 28px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }

/* ---- Tables ---- */
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data th, table.data td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
table.data th { background: #f7f9fc; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover, table.data tr:hover td { background: #fbfcfe; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.vesi { background: #e3f0fd; color: #155bb0; }
.badge.gaas { background: #fdeede; color: #9a6410; }
.badge.open { background: #e4f6ec; color: #1f7a43; }
.badge.closed { background: #eef1f5; color: #647084; }
.badge.est { background: #fdecec; color: #b23434; }

/* ---- Forms ---- */
form.stack { max-width: 460px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.field input, .field select {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 15px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 122, 224, .15); }

.btn {
    display: inline-block; padding: 9px 18px; border: none; border-radius: 8px;
    background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
    cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.secondary { background: #eef1f5; color: var(--text); }
.btn.secondary:hover { background: #e3e8ef; }
.btn.small { padding: 5px 12px; font-size: 13px; }

/* ---- Alerts ---- */
.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 18px; font-weight: 500; }
.alert.error { background: #fdecec; color: #b23434; border: 1px solid #f3c7c7; }
.alert.info { background: #e3f0fd; color: #155bb0; border: 1px solid #c6def8; }

/* ---- Login ---- */
.login-wrap { max-width: 360px; margin: 8vh auto; }
.login-wrap .card { padding: 28px; }
.login-wrap h1 { text-align: center; font-size: 20px; }

.empty { padding: 28px; text-align: center; color: var(--muted); }
