﻿:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --ink: #13233a;
    --muted: #607086;
    --line: #d9e1ec;
    --brand: #0b5cab;
    --brand-2: #11999e;
    --danger: #cf304a;
    --ok: #1a8755;
    --shadow: 0 10px 30px rgba(8, 33, 70, 0.08);
    --shadow-soft: 0 6px 18px rgba(8, 33, 70, 0.06);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top right, #eaf4ff, transparent 40%), var(--bg);
}

a { color: var(--brand); text-decoration: none; }

.app-body {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    gap: 10px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    padding: 10px 18px 12px;
    margin: 0;
}

.topbar-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.topbar-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #e8eef7;
    padding-top: 8px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand img { width: 110px;  object-fit: contain; }

.topnav { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.topnav a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-size: 14px;
    background: #fff;
}
.topnav a.active { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }

.userbox { text-align: right; min-width: 0; }
.userbox strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox a { font-size: 13px; }

.quick-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.quick-link {
    font-size: 13px;
    padding: 7px 10px;
    border: 1px solid #cfe0f3;
    border-radius: 8px;
    background: #fff;
    color: #0b5cab;
    white-space: nowrap;
}
.quick-link:hover {
    border-color: #0b5cab;
    background: #f1f7ff;
}

.container {
    max-width: 1360px;
    margin: 12px auto 0;
    padding: 12px 18px 32px;
    display: grid;
    gap: 16px;
}

.page-head {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 16px 18px;
}
.page-head h1 { margin: 0; font-size: 26px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.cards { display: grid; gap: 14px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px;
}
.card h2, .card h3 { margin-top: 0; }
.card.stat strong { font-size: 34px; color: var(--brand); }

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, select, textarea, button {
    font: inherit;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
textarea { resize: vertical; }

table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 10px; font-size: 14px; }
th { color: var(--muted); font-weight: 600; }

.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
}
.btn-primary { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; }
.w-full { width: 100%; }

.alert {
    margin: 10px 0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}
.alert-error { background: #ffeaf0; color: #8e1f36; }
.alert-ok { background: #e8f8f0; color: #16623f; }

.flat-list, .timeline-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}
.inline-edit { cursor: pointer; border-bottom: 1px dashed #90a1b8; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background: linear-gradient(130deg, #0a2947, #185f97, #1f7f7a);
}

.login-shell {
    width: min(1060px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 50px rgba(4, 15, 31, 0.35);
}

.login-brand {
    padding: 36px;
    color: #fff;
    background: linear-gradient(170deg, #0a2d53, #11558c);
}
.brand-logo { width: 74px; height: 74px; object-fit: contain; }
.login-card { padding: 36px; }

@media (max-width: 1100px) {
    .topbar {
        text-align: center;
    }
    .topbar-main,
    .topbar-sub {
        flex-direction: column;
    }
    .userbox { text-align: center; }
    .cards.two, .cards.three, .grid.two { grid-template-columns: 1fr; }
    .container { margin-top: 8px; padding-top: 8px; }
    .quick-actions { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 960px) {
    .login-shell { grid-template-columns: 1fr; }
}
