:root {
    --sidebar: #2c3035;
    --sidebar-hover: #3a4046;
    --sidebar-active: #00a4e4;
    --sidebar-text: #e8eaed;
    --sidebar-muted: #9aa0a6;
    --header: #ffffff;
    --page: #f3f5f7;
    --card: #ffffff;
    --line: #e4e7eb;
    --accent: #1e90ff;
    --green: #1f9d4a;
    --green-hover: #18853e;
    --ink: #1f2328;
    --muted: #6b7280;
    --alert: #f7d6dc;
    --alert-text: #6b2430;
    --demo: #fff4c2;
    --demo-bar: #ffe566;
    --danger: #d64545;
    --radius: 4px;
    --sidebar-w: 248px;
    --header-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.panel-body {
    font-family: "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--page);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-weight: 700;
    letter-spacing: .04em;
}
.sidebar-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #fff;
    color: var(--sidebar);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
}
.sidebar-nav { padding: 10px 0; flex: 1; overflow: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: var(--sidebar-text);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.is-active {
    background: var(--sidebar-active);
    border-left-color: #fff;
    font-weight: 600;
}
.sidebar-foot {
    padding: 12px 16px 16px;
    font-size: 11px;
    color: var(--sidebar-muted);
    border-top: 1px solid rgba(255,255,255,.06);
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.topbar {
    height: var(--header-h);
    background: var(--header);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.icon-btn {
    border: 0;
    background: transparent;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    color: #555;
    display: none;
}
.icon-btn:hover { background: #f0f2f4; }
.search-form { flex: 1; max-width: 360px; position: relative; }
.search-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 8px 36px 8px 14px;
    background: #fafbfc;
}
.search-form button {
    position: absolute;
    right: 4px;
    top: 4px;
    border: 0;
    background: transparent;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: #777;
}
.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #d9dde3; display: grid; place-items: center; font-size: 13px; color: #555;
}
.logout {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
}
.logout:hover { background: #f6f7f8; }

.banners { display: flex; flex-direction: column; }
.banner {
    padding: 10px 20px;
    font-size: 13.5px;
    line-height: 1.45;
}
.banner-alert { background: var(--alert); color: var(--alert-text); }
.banner-demo { background: var(--demo); color: #6a5410; }
.banner-demo-bar {
    background: var(--demo-bar);
    color: #5a4a00;
    text-align: center;
    font-weight: 600;
    letter-spacing: .02em;
}

.content { padding: 20px 22px 40px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: 2px;
    margin-bottom: 18px;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 0;
    font-size: 16px;
    font-weight: 600;
}
.badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    background: #ff3b30;
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
}
.card-body { padding: 16px; }

.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    text-align: center;
}
.kpi { padding: 8px 6px 16px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-label { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.kpi-eur { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.kpi-bgn { color: var(--muted); font-size: 14px; margin-top: 4px; }
.kpi-count { color: var(--muted); font-size: 13px; margin-top: 2px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 4px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-hover); }
.btn-dark { background: #2c3035; color: #fff; }
.btn-dark:hover { background: #1f2328; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.center-actions { display: flex; justify-content: center; padding: 4px 0 8px; }

.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.data th {
    text-align: left;
    color: #8a9098;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}
table.data td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f2f4;
    vertical-align: middle;
}
table.data tr:hover td { background: #fafbfc; }
.muted { color: var(--muted); font-size: 12px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 13px;
}

.page-title { font-size: 22px; font-weight: 700; margin: 0 0 16px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: end;
}
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid #d5d9de;
    border-radius: 6px;
    padding: 9px 12px;
    background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; }
.input-icon { position: relative; }
.input-icon svg {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: #8a9098;
}
.input-icon input { padding-left: 34px; }
.checks { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.flash {
    background: #e8f7ee;
    color: #146c36;
    border: 1px solid #b7e4c7;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.flash-error {
    background: #fdecec;
    color: #8a1f1f;
    border-color: #f3c0c0;
}
.empty { color: var(--muted); padding: 24px; text-align: center; }

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #2c3035 0 42%, #f3f5f7 42%);
    padding: 24px;
}
.login-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    padding: 28px 28px 24px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-brand .sidebar-logo { background: var(--sidebar); color: #fff; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.login-card .field { margin-bottom: 12px; }
.login-card .btn { width: 100%; margin-top: 8px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #555; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.todo-box {
    background: #fff8e6;
    border: 1px dashed #e0c36a;
    padding: 12px 14px;
    border-radius: 6px;
    color: #6a5410;
    font-size: 13px;
    margin-bottom: 14px;
}
.pagination { margin-top: 14px; }
.pagination nav { display: flex; gap: 6px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; font-size: 14px; }
.dl dt { color: var(--muted); }

@media (max-width: 980px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .kpi + .kpi { border-left: 0; }
    .form-grid, .form-grid-2 { grid-template-columns: 1fr; }
    .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.is-open { transform: translateX(0); }
    .backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        z-index: 15;
    }
    .backdrop.is-open { display: block; }
}
@media (max-width: 640px) {
    .kpis { grid-template-columns: 1fr; }
    .search-form { display: none; }
    .content { padding: 14px; }
    .kpi-eur { font-size: 24px; }
}
