:root {
    color-scheme: light;
    --primary: #407fa3;
    --secondary: #2e6688;
    --accent: #f1c94b;
    --primary-fg: #fff;
    --body-fg: #243541;
    --body-bg: #f4f6f9;
    --body-quiet-color: #6b7882;
    --body-medium-color: #475762;
    --body-loud-color: #14242e;
    --header-color: #243541;
    --header-bg: #fff;
    --header-link-color: #2e6688;
    --breadcrumbs-fg: #687680;
    --breadcrumbs-link-fg: #397b9f;
    --breadcrumbs-bg: transparent;
    --link-fg: #28779f;
    --link-hover-color: #155d82;
    --link-selected-fg: #174f6d;
    --hairline-color: #e1e6ea;
    --border-color: #d5dde2;
    --error-fg: #b42318;
    --message-success-bg: #e7f6ed;
    --message-warning-bg: #fff5d6;
    --message-error-bg: #fde8e7;
    --darkened-bg: #f3f6f8;
    --selected-bg: #e8f1f6;
    --selected-row: #f0f7fa;
    --button-fg: #fff;
    --button-bg: #3f84aa;
    --button-hover-bg: #2f7196;
    --default-button-bg: #347c9f;
    --default-button-hover-bg: #286984;
    --close-button-bg: #7b858c;
    --close-button-hover-bg: #626c73;
    --delete-button-bg: #ba4a45;
    --delete-button-hover-bg: #9e3935;
    --object-tools-fg: #fff;
    --object-tools-bg: #3f84aa;
    --object-tools-hover-bg: #2f7196;
    --sidebar-bg: #0d2232;
    --sidebar-text: #c4d0d8;
    --sidebar-muted: #7e91a0;
    --sidebar-active: #244f69;
    --sidebar-wide: 258px;
    --sidebar-narrow: 76px;
}

* { box-sizing: border-box; }
html[data-theme="dark"] { color-scheme: light; }
body { background: var(--body-bg); min-width: 0; }
a:focus, button:focus, input:focus, select:focus, textarea:focus { outline: 2px solid #5aa6cf; outline-offset: 2px; }
.satvos-svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.satvos-shell { min-height: 100vh; }

#satvos-sidebar {
    background: var(--sidebar-bg); bottom: 0; color: var(--sidebar-text); display: flex;
    flex-direction: column; left: 0; position: fixed; top: 0; width: var(--sidebar-wide);
    z-index: 100; transition: width .22s ease, transform .22s ease;
}
.satvos-brand { align-items: center; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; height: 82px; justify-content: space-between; margin: 0 18px; padding: 0 8px; position: relative; }
.satvos-brand a { align-items: center; color: #fff; display: flex; min-width: 0; text-decoration: none; }
.satvos-brand img { max-height: 48px; max-width: 155px; object-fit: contain; }
.brand-full { color: #fff; font-size: 25px; font-weight: 700; letter-spacing: 2px; }
.brand-short { color: var(--accent); display: none; font-size: 25px; font-weight: 800; }
.sidebar-collapse, .mobile-menu, .icon-button, .account-button { background: transparent; border: 0; cursor: pointer; margin: 0; padding: 0; }
.sidebar-collapse { align-items: center; background: #fff; border: 1px solid #dbe3e8; border-radius: 50%; color: #315f79; display: flex; height: 30px; justify-content: center; position: absolute; right: -33px; width: 30px; }
.sidebar-collapse svg { fill: none; height: 22px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 22px; transform: rotate(180deg); }

.satvos-nav { display: flex; flex: 1; flex-direction: column; gap: 6px; overflow-y: auto; padding: 24px 14px; }
.satvos-nav a { align-items: center; border-radius: 9px; color: var(--sidebar-text); display: flex; font-size: 15px; font-weight: 600; gap: 15px; min-height: 48px; padding: 0 15px; text-decoration: none; white-space: nowrap; }
.satvos-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.satvos-nav svg, .sidebar-user > svg { fill: none; flex: 0 0 23px; height: 23px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 23px; }
.dashboard .nav-dashboard, .model-project .nav-project, .model-customer .nav-customer,
.model-workitem .nav-workitem, .model-timeentry .nav-timeentry, .model-employee .nav-employee,
.model-systemsettings .nav-systemsettings, .model-user .nav-user, .model-group .nav-group { background: var(--sidebar-active); color: #fff; }
.sidebar-user { align-items: center; border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: 12px; margin: 0 14px; min-height: 76px; padding: 12px 14px; }
.sidebar-user div { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user strong { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { color: var(--sidebar-muted); font-size: 12px; margin-top: 3px; }

.satvos-page { margin-left: var(--sidebar-wide); min-height: 100vh; transition: margin-left .22s ease; }
#header { align-items: center; background: #fff; box-shadow: 0 1px 0 #e2e7eb; color: var(--body-fg); display: flex; height: 72px; justify-content: flex-end; padding: 0 32px; position: relative; z-index: 70; }
.header-spacer { flex: 1; }
.header-actions { align-items: center; display: flex; gap: 10px; }
.mobile-menu { color: #37576a; display: none; }
.mobile-menu svg { fill: none; height: 25px; stroke: currentColor; stroke-width: 2; width: 25px; }
.dropdown { position: relative; }
.icon-button { align-items: center; border-radius: 50%; color: #3e83a9; display: flex; height: 42px; justify-content: center; position: relative; width: 42px; }
.icon-button:hover, .account-button:hover { background: #eef5f8; }
.icon-button svg { fill: none; height: 24px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 24px; }
.notification-badge { align-items: center; background: #d84d43; border: 2px solid #fff; border-radius: 12px; color: #fff; display: flex; font-size: 10px; font-weight: 700; height: 20px; justify-content: center; min-width: 20px; padding: 0 4px; position: absolute; right: -1px; top: -1px; }
.account-button { align-items: center; border-radius: 24px; color: var(--body-fg); display: flex; gap: 9px; min-height: 44px; padding: 4px 10px 4px 5px; }
.account-avatar { align-items: center; background: #3f84aa; border-radius: 50%; color: #fff; display: flex; font-weight: 700; height: 34px; justify-content: center; width: 34px; }
.account-name { font-weight: 600; }
.account-arrow { color: #6d7b84; font-size: 16px; }
.dropdown-panel { background: #fff; border: 1px solid #dde4e8; border-radius: 10px; box-shadow: 0 14px 40px rgba(31,48,60,.18); display: none; position: absolute; right: 0; top: calc(100% + 10px); z-index: 140; }
.dropdown.open .dropdown-panel { display: block; }
.account-panel { min-width: 220px; padding: 8px; }
.account-panel a, .account-panel button { align-items: center; background: none; border: 0; border-radius: 7px; color: #253742; cursor: pointer; display: flex; font: inherit; gap: 10px; padding: 11px 12px; text-align: left; text-decoration: none; width: 100%; }
.account-panel a:hover, .account-panel button:hover { background: #eef5f8; }
.account-panel svg { fill: none; height: 19px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 19px; }
.notification-panel { max-height: 520px; min-width: 380px; overflow-y: auto; }
.panel-heading { align-items: center; border-bottom: 1px solid #e5eaed; display: flex; font-size: 16px; justify-content: space-between; padding: 16px 18px; }
.panel-heading span { background: #eaf3f7; border-radius: 12px; color: #347c9f; font-size: 12px; padding: 3px 8px; }
.notification-item { border-bottom: 1px solid #edf0f2; display: flex; flex-direction: column; padding: 13px 18px; text-decoration: none; }
.notification-item:hover { background: #f6f9fa; }
.notification-item strong { color: #243541; font-size: 13px; }
.notification-item span { color: #667680; font-size: 12px; margin-top: 3px; }
.notification-item time { color: #3b7f9f; font-size: 11px; margin-top: 5px; }
.notification-item.overdue time { color: #b42318; font-weight: 700; }
.notification-item.read { opacity: .72; }
.empty-notifications { color: #71808a; margin: 0; padding: 26px 18px; text-align: center; }
.notification-actions { background: #f6f8fa; border-top: 1px solid #e5eaed; padding: 10px 18px; position: sticky; bottom: 0; }
.notification-actions button { background: transparent; border: 0; color: #28779f; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 0; width: 100%; }
.notification-actions button:hover { color: #155d82; }

body.sidebar-collapsed #satvos-sidebar { width: var(--sidebar-narrow); }
body.sidebar-collapsed .satvos-page { margin-left: var(--sidebar-narrow); }
body.sidebar-collapsed .satvos-brand { justify-content: center; margin: 0 8px; padding: 0; }
body.sidebar-collapsed .brand-full, body.sidebar-collapsed .satvos-brand img, body.sidebar-collapsed .satvos-nav span, body.sidebar-collapsed .sidebar-user div { display: none; }
body.sidebar-collapsed .brand-short { display: inline; }
body.sidebar-collapsed .sidebar-collapse { right: -25px; }
body.sidebar-collapsed .sidebar-collapse svg { transform: rotate(0); }
body.sidebar-collapsed .satvos-nav { padding-left: 10px; padding-right: 10px; }
body.sidebar-collapsed .satvos-nav a { justify-content: center; padding: 0; }
body.sidebar-collapsed .sidebar-user { justify-content: center; margin: 0 10px; padding: 0; }

nav[aria-label="Kelias"] { background: transparent; }
div.breadcrumbs { background: transparent; border: 0; color: #7a8790; font-size: 13px; padding: 20px 34px 0; }
div.breadcrumbs a { color: #3c7d9f; }
div.breadcrumbs span { margin: 0 8px; }
.content { padding: 0; }
#content { background: transparent; border: 0; box-shadow: none; margin: 0; padding: 28px 34px 46px; }
#content > h1 { color: #172a35; font-size: 27px; font-weight: 600; margin: 0 0 24px; }
#content-main { min-width: 0; }
.module, .inline-group { background: #fff; border: 1px solid #e0e6ea; border-radius: 8px; box-shadow: 0 2px 7px rgba(29,48,60,.05); overflow: hidden; }
.module h2, .module caption, .inline-group h2 { background: #edf4f7; color: #244b60; }
.object-tools { margin-top: -55px; }
.object-tools a { border-radius: 7px; padding: 9px 14px; }

#changelist { background: #fff; border: 1px solid #e0e6ea; border-radius: 9px; box-shadow: 0 2px 8px rgba(29,48,60,.06); overflow: visible; }
#changelist .changelist-form-container { float: none; width: 100% !important; }
#changelist.filtered .results, #changelist.filtered .paginator, #changelist.filtered #toolbar, #changelist.filtered div.xfull { margin-right: 0 !important; width: auto !important; }
#toolbar { align-items: center; background: #f2f5f7; border-bottom: 1px solid #e0e6ea; display: flex; min-height: 72px; padding: 14px 18px; }
#toolbar form { align-items: center; display: flex; flex: 1; }
.search-controls { align-items: center; display: flex; flex: 1; gap: 10px; position: relative; }
.search-controls label { align-items: center; display: flex; height: 40px; justify-content: center; left: 12px; margin: 0; position: absolute; width: 20px; z-index: 1; }
.search-controls label img { height: 17px; opacity: .65; width: 17px; }
#toolbar #searchbar { background: #fff; border: 1px solid #ccd6dc; border-radius: 7px; height: 40px; margin: 0; max-width: 410px; padding: 0 14px 0 39px; width: 100%; }
#toolbar input.search-submit { border-radius: 6px; flex: 0 0 auto; height: 36px; margin: 0; padding: 0 15px; width: auto; }
.filter-toggle { align-items: center; background: #fff; border: 1px solid #ccd6dc; border-radius: 50%; color: #347c9f; cursor: pointer; display: flex; height: 42px; justify-content: center; margin-left: 12px; width: 42px; }
.filter-toggle:hover, .filter-toggle.active { background: #347c9f; color: #fff; }
.filter-toggle svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 20px; }
#changelist-filter { background: #fff; border: 0; border-left: 1px solid #dbe2e6; border-radius: 0; bottom: 0; box-shadow: -12px 0 35px rgba(26,44,55,.16); display: block !important; margin: 0; max-width: 88vw; overflow-y: auto; padding-bottom: 35px; position: fixed; right: 0; top: 0; transform: translateX(105%); transition: transform .22s ease; width: 360px; z-index: 210; }
body.filter-open #changelist-filter { transform: translateX(0); }
#changelist-filter h2 { align-items: center; background: #347c9f; color: #fff; display: flex; font-size: 17px; height: 64px; justify-content: space-between; padding: 0 22px; }
#changelist-filter h3 { color: #334953; font-size: 13px; padding: 14px 22px 6px; }
#changelist-filter ul { padding: 0 22px 10px; }
#changelist-filter li { margin: 4px 0; }
.filter-close { background: none; border: 0; color: #fff; cursor: pointer; font-size: 25px; line-height: 1; }
.filter-backdrop { background: rgba(11,26,36,.32); display: none; inset: 0; position: fixed; z-index: 200; }
body.filter-open .filter-backdrop { display: block; }
.results { overflow-x: auto; }
#result_list { min-width: 780px; }
#result_list thead th { background: #fff; color: #51616b; padding: 15px 10px; }
#result_list tbody tr:nth-child(odd) { background: #f8fafb; }
#result_list tbody tr:hover { background: #edf5f8; }
#result_list td, #result_list th { padding: 13px 10px; }
.model-project #result_list .field-number { min-width: 132px; white-space: nowrap; }
.project-progress { background: #dfe8ec; border-radius: 8px; display: inline-block; height: 8px; overflow: hidden; vertical-align: middle; width: 72px; }
.project-progress > span { background: #4b9a70; display: block; height: 100%; }
.project-progress-value { display: inline-block; margin-left: 7px; min-width: 34px; }

.dashboard #content { max-width: none; width: auto; }
.dashboard #content-main { max-width: none; width: 100%; }
.dashboard-grid { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(190px, 1fr)); margin-bottom: 22px; width: 100%; }
.stat-card { background: #fff; border: 1px solid #e0e6ea; border-left: 4px solid #3f84aa; border-radius: 9px; box-shadow: 0 2px 7px rgba(29,48,60,.05); display: flex; flex-direction: column; padding: 21px 22px; text-decoration: none; }
.stat-card:hover { box-shadow: 0 6px 18px rgba(29,48,60,.10); transform: translateY(-1px); }
.stat-card span { color: #6b7882; font-size: 13px; }
.stat-card strong { color: #1d3441; font-size: 27px; margin-top: 8px; }
.stat-card.money strong { white-space: nowrap; }
.stat-card.danger { border-left-color: #d65a50; }
.stat-card.danger strong { color: #b42318; }
.stat-card.money { border-left-color: #4b9a70; }
.dashboard-columns { display: grid; gap: 22px; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.dashboard-card { background: #fff; border: 1px solid #e0e6ea; border-radius: 9px; box-shadow: 0 2px 7px rgba(29,48,60,.05); overflow: hidden; }
.card-heading { align-items: center; border-bottom: 1px solid #e6ebee; display: flex; justify-content: space-between; padding: 17px 20px; }
.card-heading h2 { color: #223944; font-size: 16px; margin: 0; }
.card-heading span { background: #eaf3f7; border-radius: 14px; color: #347c9f; font-size: 12px; padding: 3px 9px; }
.dashboard-notification { align-items: center; border-bottom: 1px solid #edf0f2; display: flex; justify-content: space-between; padding: 13px 20px; text-decoration: none; }
.dashboard-notification:hover { background: #f7fafb; }
.dashboard-notification div { display: flex; flex-direction: column; }
.dashboard-notification strong { color: #2a3e49; font-size: 13px; }
.dashboard-notification span { color: #74818a; font-size: 12px; margin-top: 4px; }
.dashboard-notification time { color: #397d9f; font-size: 12px; margin-left: 15px; }
.dashboard-notification.overdue time { color: #b42318; font-weight: 700; }
.dashboard-empty { color: #74818a; margin: 0; padding: 35px 20px; text-align: center; }
.quick-actions { display: grid; gap: 10px; padding: 18px; }
.quick-actions a { background: #edf5f8; border-radius: 7px; color: #286e91; font-weight: 600; padding: 12px 14px; text-decoration: none; }
.quick-actions a:hover { background: #dfedf3; }

.aligned label { color: #3e4f59; }
input, textarea, select, .vTextField { background: #fff; color: #1e2b34; border-color: #bcc8cf; }
.submit-row { background: #f3f6f8; border: 1px solid #dce3e7; border-radius: 7px; }
.submit-row a.deletelink { height: auto; line-height: normal; margin: 0; padding: 10px 15px; }
.delete-confirmation form input[type="submit"] { min-height: 42px; padding: 10px 18px; }
.delete-confirmation form .cancel-link { align-items: center; display: inline-flex; height: auto; justify-content: center; line-height: 1.2; min-height: 42px; padding: 10px 18px; }
.password-change-card { max-width: 900px; }
.form-intro { color: #60707a; margin-bottom: 22px; }
.errorlist li { color: #b42318; }
.theme-toggle { display: none; }
.satvos-overlay { display: none; }
.settings-access { align-items: center; background: #fff; border: 1px solid #e0e6ea; border-radius: 9px; display: flex; justify-content: space-between; margin-bottom: 22px; padding: 20px 22px; }
.settings-access h2, .settings-section-title h2 { color: #233a46; font-size: 17px; margin: 0 0 6px; }
.settings-access p, .settings-section-title p { color: #71808a; margin: 0; }
.settings-access-links { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 20px; }
.settings-access-links a { background: #edf5f8; border-radius: 7px; color: #286e91; font-weight: 600; padding: 10px 13px; text-decoration: none; }
.settings-section-title { margin: 6px 0 15px; }

@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
    #satvos-sidebar { transform: translateX(-105%); width: min(290px, 88vw); }
    body.mobile-nav-open #satvos-sidebar { transform: translateX(0); }
    .satvos-page, body.sidebar-collapsed .satvos-page { margin-left: 0; }
    .sidebar-collapse { display: none; }
    #header { flex-direction: row; height: 72px; justify-content: space-between; padding: 0 20px; }
    .mobile-menu { align-items: center; background: #eef1f3; border-radius: 50%; color: #253742; display: flex; flex: 0 0 48px; height: 48px; justify-content: center; width: 48px; }
    .mobile-menu:hover { background: #e2e7ea; }
    .mobile-menu svg { height: 29px; width: 29px; }
    .header-spacer { display: none; }
    .header-actions { margin-left: auto; }
    .account-dropdown { display: none; }
    .icon-button { height: 48px; width: 48px; }
    .icon-button svg { height: 28px; width: 28px; }
    .notification-panel { min-width: min(360px, calc(100vw - 24px)); right: -8px; }
    div.breadcrumbs { padding: 15px 17px 0; }
    #content { padding: 22px 16px 35px; }
    #content > h1 { font-size: 23px; }
    .dashboard-grid, .dashboard-columns { grid-template-columns: 1fr; }
    #toolbar { align-items: stretch; }
    #toolbar form { flex-wrap: wrap; }
    #toolbar #searchbar { max-width: none; }
    .object-tools { margin-top: 0; }
    .settings-access { align-items: stretch; flex-direction: column; }
    .settings-access-links { margin: 16px 0 0; }
    body.mobile-nav-open .satvos-overlay { background: rgba(9,24,34,.42); display: block; inset: 0; position: fixed; z-index: 90; }
}
