/*
 * Dark navy theme for the Django admin.
 * Overrides the admin's CSS variables for every theme value (auto/light/dark),
 * so the app always renders dark regardless of the OS setting.
 */

html:root,
html[data-theme] {
    /* Arculat: antracit felületek + arany kiemelőszín (#c7b000), mindig sötét téma. */
    --brand: #c7b000;
    --brand-bright: #e6d65a;
    --brand-soft: rgba(199, 176, 0, 0.14);
    --brand-line: rgba(199, 176, 0, 0.35);

    --primary: #c7b000;
    --secondary: #9c8a00;
    --accent: #e6d65a;
    --primary-fg: #12141a;

    --body-fg: #ecebe6;
    --body-bg: #101319;
    --body-quiet-color: #9499a4;
    --body-medium-color: #c9ccd3;
    --body-loud-color: #ffffff;

    --header-color: #ecebe6;
    --header-branding-color: #ffffff;
    --header-bg: #0b0d13;
    --header-link-color: #c9ccd3;

    --breadcrumbs-fg: #9499a4;
    --breadcrumbs-link-fg: #c9ccd3;
    --breadcrumbs-bg: #13161e;

    --link-fg: #e6d65a;
    --link-hover-color: #f3e88f;
    --link-selected-fg: #e6d65a;

    --hairline-color: #232833;
    --border-color: #343a47;

    --error-fg: #f87171;
    --message-success-bg: #0f3d2e;
    --message-warning-bg: #3d3510;
    --message-error-bg: #4c1620;

    --darkened-bg: #161922;
    --selected-bg: #1f232d;
    --selected-row: #2a2714;

    --button-fg: #12141a;
    --button-bg: #c7b000;
    --button-hover-bg: #d8c21a;
    --default-button-bg: #c7b000;
    --default-button-hover-bg: #d8c21a;
    --close-button-bg: #2c313c;
    --close-button-hover-bg: #3a404d;
    --delete-button-bg: #dc2626;
    --delete-button-hover-bg: #b91c1c;

    --object-tools-fg: #12141a;
    --object-tools-bg: #c7b000;
    --object-tools-hover-bg: #d8c21a;

    --card-bg: #161922;
    --radius: 12px;

    --table-head-bg: #2b2810;
    --table-head-fg: #e8dc8a;
    --sidebar-bg: #0b0d13;
    --sidebar-accent: #1b1f28;

    --font-family-primary: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

    color-scheme: dark;
}

body {
    background: radial-gradient(1100px 520px at 100% -12%, rgba(199, 176, 0, 0.07) 0%, transparent 60%), var(--body-bg);
    background-attachment: fixed;
    font-size: 0.9rem;
}

.theme-toggle { display: none; }

/* Header */
#header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--hairline-color);
    padding: 14px 32px;
}

#site-name a:link,
#site-name a:visited {
    color: var(--header-branding-color);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
}

#user-tools a { border-bottom: none; }
#user-tools a:hover { color: #fff; text-decoration: none; }

div.breadcrumbs {
    background: transparent;
    border-bottom: 1px solid var(--hairline-color);
    padding: 12px 32px;
}

/* Cards */
.module,
#changelist .changelist-form-container,
fieldset.module,
.inline-group {
    background: var(--card-bg);
    border: 1px solid var(--hairline-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.module h2,
.module caption,
.inline-group h2 {
    background: transparent;
    color: var(--body-quiet-color);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hairline-color);
}

.module caption a.section,
.module h2 a.section { color: var(--body-medium-color); }

#content { padding: 24px 32px; }

#content h1 {
    font-weight: 600;
    color: var(--body-loud-color);
}

/* Sidebar */
#nav-sidebar {
    background: var(--header-bg);
    border-right: 1px solid var(--hairline-color);
}

#nav-sidebar .module { border: none; border-radius: 0; background: transparent; }
#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited { color: var(--accent); }
#nav-sidebar .current-model { background: var(--selected-row); }

.toggle-nav-sidebar {
    background: var(--header-bg);
    border-color: var(--hairline-color);
    color: var(--body-quiet-color);
}

/* Tables */
thead th,
tfoot td {
    background: var(--darkened-bg);
    color: var(--body-quiet-color);
    border-bottom: 1px solid var(--hairline-color);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

td, th { border-bottom-color: var(--hairline-color); }
#result_list tbody tr:hover { background: var(--selected-bg); }

/* Forms */
input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], input[type=tel], input[type=search], textarea, select,
.vTextField {
    background: #101319;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 7px 10px;
    color: var(--body-fg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(199, 176, 0, 0.25);
    outline: none;
}

/*
 * One field height (34px) for text inputs, selects and autocomplete selects.
 * Django's admin pins <select> to 30px; with our 7px padding that left no room
 * for the text and clipped the bottom of the selected value.
 */
input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], input[type=tel], input[type=search], .vTextField {
    line-height: 1.4;
    min-height: 34px;
    box-sizing: border-box;
}

select {
    height: auto;
    min-height: 34px;
    line-height: 1.4;
    padding: 6px 8px;
    box-sizing: border-box;
}

select[multiple] { min-height: 150px; }

/* "html body" because the admin's autocomplete.css loads after this file. */
html body .select2-container--admin-autocomplete .select2-selection--single {
    height: 34px;
    background: #101319;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

html body .select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered {
    line-height: 32px;
    color: var(--body-fg);
    padding-left: 10px;
}

html body .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow { height: 32px; }

html body .select2-container--admin-autocomplete.select2-container--focus .select2-selection,
html body .select2-container--admin-autocomplete.select2-container--open .select2-selection {
    border-color: var(--primary);
}

/* Date inputs: "Ma | calendar" sit inside the field on its right (static/js/date_fields.js wraps them). */
.date-field { position: relative; display: inline-block; width: 13em; max-width: 100%; vertical-align: middle; }
.date-field input.vDateField { width: 100%; min-width: 0; padding-right: 76px; box-sizing: border-box; }
.date-field .datetimeshortcuts {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--body-quiet-color);
}
.date-field .datetimeshortcuts a { color: var(--link-fg); }

/* Buttons */
.button, input[type=submit], input[type=button], .submit-row input, a.button {
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 600;
    transition: background 0.15s;
}

.submit-row {
    background: var(--card-bg);
    border: 1px solid var(--hairline-color);
    border-radius: var(--radius);
}

.object-tools a:link, .object-tools a:visited { border-radius: 999px; padding: 6px 14px; }

/* Changelist filter + search */
#changelist-filter {
    background: var(--card-bg);
    border: 1px solid var(--hairline-color);
    border-radius: var(--radius);
}

#changelist #toolbar {
    background: transparent;
    border-bottom: 1px solid var(--hairline-color);
}

/* "Új … hozzáadása" next to the search button (templates/admin/search_form.html), styled like the object-tools pills. */
#changelist-search a.toolbar-addlink:link,
#changelist-search a.toolbar-addlink:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--object-tools-bg);
    color: var(--object-tools-fg);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    text-decoration: none;
}
#changelist-search a.toolbar-addlink::before { content: '+'; font-size: 1rem; line-height: 1; }
#changelist-search a.toolbar-addlink:hover { background: var(--object-tools-hover-bg); }

#changelist .actions { background: var(--darkened-bg); border-bottom-color: var(--hairline-color); }

/* Customer shipping addresses: fixed column widths so the inline fits a Full HD screen. */
#shipping_addresses-group table {
    width: 100%;
    table-layout: fixed;
}

#shipping_addresses-group th,
#shipping_addresses-group td {
    padding: 8px 6px;
    vertical-align: middle;
    white-space: normal;
}

#shipping_addresses-group td input[type=text] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#shipping_addresses-group .original { width: 0; padding: 0; }
#shipping_addresses-group .column-label { width: 16%; }
#shipping_addresses-group .column-postcode { width: 7%; }
#shipping_addresses-group .column-city { width: 12%; }
#shipping_addresses-group .column-address { width: 21%; }
#shipping_addresses-group .column-country { width: 5%; }
#shipping_addresses-group .column-contact_name { width: 13%; }
#shipping_addresses-group .column-contact_phone { width: 10%; }
#shipping_addresses-group .column-is_default { width: 10%; text-align: center; }
#shipping_addresses-group thead th:last-child { width: 6%; text-align: center; }
#shipping_addresses-group td.field-is_default,
#shipping_addresses-group td.delete { text-align: center; }

/* Saved rows already show their values in the inputs, so drop the summary line above each tabular inline row. */
.inline-group .tabular td.original p { display: none; }
.inline-group .tabular tr.has_original td { padding-top: 8px; }

/* Stock document: the "save and post" row under the normal save buttons. */
.submit-row.post-row {
    margin-top: 10px;
    align-items: center;
    border-color: rgba(199, 176, 0, 0.45);
}

.submit-row.post-row p.help { margin: 0 0 0 12px; color: var(--body-quiet-color); }
.submit-row.issue-row label { color: var(--body-medium-color); font-weight: 600; margin-right: 4px; }
.submit-row.issue-row select { margin-right: 8px; }

/* Reversal (sztornó): red link on posted documents and the confirmation page. */
.object-tools a.reverse-link:link,
.object-tools a.reverse-link:visited { background: var(--delete-button-bg); }
.object-tools a.reverse-link:hover { background: var(--delete-button-hover-bg); }

.reverse-summary { margin-bottom: 16px; }
.reverse-summary h2 { text-transform: none; font-size: 0.9rem; color: var(--body-loud-color); letter-spacing: 0; }
.reverse-reason { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.reverse-reason textarea { max-width: 640px; }
.submit-row input.reverse-confirm { background: var(--delete-button-bg); }
.submit-row input.reverse-confirm:hover { background: var(--delete-button-hover-bg); }
.submit-row a.cancel-link { background: var(--close-button-bg); color: #fff; padding: 9px 16px; }

/* Scrap lines: product, quantity, serial / batch, reason */
#lines-group th.column-notes { width: 30%; }
#lines-group td.field-notes input { width: 100%; box-sizing: border-box; }
#lines-group td.field-tracking_code select { min-width: 220px; }

/*
 * Wide master-data forms (product, partner): body.wide-form is set by their change_form.html.
 * Fieldsets sit three in a row, inline tables two in a row (product) or full width, so the form
 * fills a Full HD screen instead of one long narrow column.
 */
body.wide-form #content-main form > div {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
body.wide-form #content-main form > div > * { grid-column: 1 / -1; margin: 0; }
body.wide-form #content-main form > div > fieldset.module { grid-column: span 2; align-self: stretch; }
body.wide-form.model-product #content-main form > div > .inline-group { grid-column: span 3; }
/* Alone (no batch table), the partner codes table takes the full width. */
body.wide-form.model-product #content-main form > div:not(:has(#batches-group)) > #partner_codes-group { grid-column: 1 / -1; }
body.wide-form fieldset.module .form-row { padding: 8px 12px; }
body.wide-form .aligned label { width: 140px; min-width: 140px; }
body.wide-form .aligned .vTextField,
body.wide-form .aligned input[type=text],
body.wide-form .aligned input[type=email],
body.wide-form .aligned input[type=number] { width: 100%; max-width: 260px; }
body.wide-form .aligned .help, body.wide-form .aligned p.help { margin-left: 0; padding-left: 0; }
body.wide-form .aligned .flex-container > .help,
body.wide-form fieldset .help { font-size: 0.72rem; }
body.wide-form fieldset textarea.compact-notes { max-width: none; }

/* Project page: two sections per row (Projekt | Ütemezés és keret, Leírás | Áttekintés); the task list,
   a lone section (.full, e.g. Leírás on a new project) and the tables below take the full width. */
body.wide-form.model-project #content-main form > div > fieldset.module { grid-column: span 3; }
body.wide-form.model-project #content-main form > div > fieldset.module.full,
body.wide-form.model-project #content-main form > div > fieldset.project-tasks { grid-column: 1 / -1; }
body.wide-form.model-project .aligned .vTextField,
body.wide-form.model-project .aligned input[type=text] { max-width: 420px; }
body.wide-form.model-project fieldset textarea { width: 100%; box-sizing: border-box; }
@media (max-width: 1024px) {
    body.wide-form.model-project #content-main form > div > fieldset.module { grid-column: 1 / -1; }
}

/*
 * Employee page ("Dolgozók"): full-width sections one below the other
 * (Felhasználói adatok, Személyes adatok, Munkaügyi adatok, Címek), each a grid of fields with the label above
 * the input so many fit on a row. The small tables (children, languages…) sit two per row, documents full width.
 */
body.wide-form.model-employee #content-main form > div > fieldset.module,
body.wide-form.model-employee #content-main form > div > #profile-group,
body.wide-form.model-employee #content-main form > div > #documents-group { grid-column: 1 / -1; }
body.wide-form.model-employee #content-main form > div > .inline-group { grid-column: span 3; }
body.wide-form.model-employee #profile-group { background: transparent; border: none; }
body.wide-form.model-employee #profile-group > fieldset > h2,
body.wide-form.model-employee #profile-group .inline-related > h3 { display: none; }  /* the sections have their own titles */
body.wide-form.model-employee #profile-group .inline-related { border: none; }
body.wide-form.model-employee #profile-group .inline-related > fieldset.module { margin: 0 0 16px; }

body.wide-form.model-employee fieldset.user-data,
body.wide-form.model-employee fieldset.personal-data,
body.wide-form.model-employee fieldset.employment-data,
body.wide-form.model-employee fieldset.addresses {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 0;
    padding-bottom: 8px;
}
body.wide-form.model-employee fieldset.addresses { grid-template-columns: repeat(7, minmax(0, 1fr)); }
body.wide-form.model-employee fieldset.module > h2,
body.wide-form.model-employee fieldset.module > h4.fieldset-heading { grid-column: 1 / -1; }
/* Inline (profile) sections title themselves with h4; style them like the other section headers. */
body.wide-form.model-employee fieldset.module > h4.fieldset-heading {
    margin: 0 0 4px;
    padding: 12px 16px;
    background: transparent;
    border-bottom: 1px solid var(--hairline-color);
    color: var(--body-quiet-color);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
body.wide-form.model-employee fieldset.module > .description { grid-column: 1 / -1; }

/* Each field: label above its input, filling its cell. */
body.wide-form.model-employee fieldset.module .form-row { border-bottom: none; padding: 8px 4px; }
body.wide-form.model-employee fieldset.module .form-row > div > .flex-container { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
body.wide-form.model-employee fieldset.module .form-row label { width: auto; min-width: 0; padding: 0; float: none; font-size: 0.75rem; color: var(--body-quiet-color); }
body.wide-form.model-employee fieldset.module .form-row input[type=text],
body.wide-form.model-employee fieldset.module .form-row input[type=email],
body.wide-form.model-employee fieldset.module .form-row input[type=number],
body.wide-form.model-employee fieldset.module .form-row input[type=tel],
body.wide-form.model-employee fieldset.module .form-row select { width: 100%; max-width: none; box-sizing: border-box; }
body.wide-form.model-employee fieldset.module .form-row .date-field { width: 100%; }
body.wide-form.model-employee fieldset.module .form-row .help { margin: 2px 0 0; padding: 0; font-size: 0.68rem; }
body.wide-form.model-employee fieldset.module .form-row .related-widget-wrapper { display: flex; align-items: center; gap: 4px; }
body.wide-form.model-employee fieldset.module .form-row .related-widget-wrapper select { flex: 1; }
/* Checkboxes: label and box on one line. */
body.wide-form.model-employee fieldset.module .form-row .checkbox-row,
body.wide-form.model-employee fieldset.module .form-row.field-is_active .flex-container { flex-direction: row; align-items: center; }
body.wide-form.model-employee fieldset.module .form-row.field-is_active .help { display: none; }
body.wide-form.model-employee fieldset.module .form-row.field-username .help { display: none; }

/* Wider cell: the groups picker takes two columns. */
/* Felhasználói adatok on one row: five text fields, a wider groups picker, then the \"Aktív\" checkbox. */
body.wide-form.model-employee fieldset.user-data { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.6fr) auto; }
body.wide-form.model-employee fieldset.user-data .form-row.field-groups .help { display: none; }
body.wide-form.model-employee fieldset.user-data .form-row.field-is_active { align-self: end; padding-bottom: 14px; }
body.wide-form.model-employee fieldset.user-data .form-row.field-groups .related-widget-wrapper .select2-container { flex: 1; width: auto !important; }

/* Címek: lakcím on the first row, ideiglenes lakcím on the second, each with a sub-heading. */
body.wide-form.model-employee fieldset.addresses .form-row.field-temp_postcode { grid-column-start: 1; }
body.wide-form.model-employee fieldset.addresses .form-row.field-postcode::before,
body.wide-form.model-employee fieldset.addresses .form-row.field-temp_postcode::before {
    display: block;
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}
body.wide-form.model-employee fieldset.addresses .form-row.field-postcode::before { content: 'Lakcím'; }
body.wide-form.model-employee fieldset.addresses .form-row.field-temp_postcode::before { content: 'Ideiglenes lakcím'; }
body.wide-form.model-employee fieldset.addresses .form-row:not(.field-postcode):not(.field-temp_postcode) { padding-top: 26px; }

body.wide-form.model-employee .inline-group .tabular table { width: 100%; }
body.wide-form.model-employee .inline-group .tabular td input[type=text] { width: 100%; box-sizing: border-box; }

@media (max-width: 1400px) {
    body.wide-form.model-employee fieldset.user-data,
    body.wide-form.model-employee fieldset.personal-data,
    body.wide-form.model-employee fieldset.employment-data { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    body.wide-form.model-employee fieldset.addresses { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    body.wide-form.model-employee #content-main form > div > .inline-group { grid-column: 1 / -1; }
}
/* Half-width inline tables on the product page: fixed columns so every column fits. */
body.wide-form.model-product .inline-group table { width: 100%; table-layout: fixed; }
body.wide-form.model-product .inline-group td,
body.wide-form.model-product .inline-group th { padding: 8px 6px; white-space: normal; }
body.wide-form.model-product .inline-group td input[type=text],
body.wide-form.model-product .inline-group td .select2-container { width: 100% !important; max-width: 100%; box-sizing: border-box; }
body.wide-form.model-product .inline-group td.original { width: 0; padding: 0; }
body.wide-form.model-product .inline-group th:last-child { width: 48px; text-align: center; }
body.wide-form.model-product .inline-group td.delete { text-align: center; }
body.wide-form.model-product .inline-group td .date-field { width: 100%; }
body.wide-form.model-product #batches-group .column-number { width: 22%; }
body.wide-form.model-product #batches-group .column-production_date,
body.wide-form.model-product #batches-group .column-expiry_date { width: 24%; }
body.wide-form.model-product #batches-group .column-created_at { width: 14%; }
body.wide-form.model-product #partner_codes-group .column-customer { width: 40%; }
body.wide-form.model-product #partner_codes-group td.field-customer .related-widget-wrapper { display: flex; align-items: center; gap: 4px; }

@media (max-width: 1400px) {
    body.wide-form #content-main form > div > fieldset.module { grid-column: span 3; }
    body.wide-form.model-product #content-main form > div > .inline-group { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
    body.wide-form #content-main form > div > fieldset.module { grid-column: 1 / -1; }
}

/* Two-unit quantity inputs on document lines (static/js/line_quantities.js) */
.qty-unit { display: block; margin-top: 3px; font-size: 0.72rem; color: var(--body-quiet-color); white-space: nowrap; }
input[data-line-qty] { width: 110px; }
input[data-line-qty]:disabled { opacity: 0.45; }

/* Stocktaking: counted vs expected difference */
.diff-plus { color: #6ee7b7; font-weight: 600; }
.diff-minus { color: #fca5a5; font-weight: 600; }
.diff-zero { color: var(--body-quiet-color); }
#lines-group td.field-expected_quantity p,
#lines-group td.field-difference_display p { margin: 0; }

/* Stock list page */
.stock-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.stock-filter label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--body-quiet-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-filter input[type=search] { width: 340px; }

.stock-table { width: 100%; }
.stock-table th.num, .stock-table td.num { text-align: right; white-space: nowrap; }

/* Stock list: one summary row per product, breakdown rows open underneath. */
.stock-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--hairline-color);
    color: var(--body-quiet-color);
}
.stock-toolbar span { margin-right: auto; }
.stock-toolbar .button { padding: 6px 12px; font-size: 0.78rem; background: var(--close-button-bg); }
.stock-toolbar .button:hover { background: var(--close-button-hover-bg); }

.stock-table .toggle-col { width: 36px; padding-right: 0; }
.stock-table tbody.stock-group { border-bottom: 1px solid var(--hairline-color); }
.stock-table tbody.stock-group.expandable .stock-summary { cursor: default; }
.stock-table tbody:not(.open) tr.stock-detail { display: none; }

.stock-toggle {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--darkened-bg);
    color: var(--accent);
    cursor: pointer;
    padding: 0;
}
.stock-toggle:hover { border-color: var(--primary); }
.stock-toggle .chevron { transition: transform 0.15s; font-size: 0.8rem; line-height: 1; }
.stock-group.open .stock-toggle .chevron { transform: rotate(90deg); }
.stock-group.open tr.stock-summary td { background: var(--selected-row); }

.stock-table tr.stock-detail td {
    background: var(--darkened-bg);
    color: var(--body-medium-color);
    font-size: 0.85em;
    padding-top: 6px;
    padding-bottom: 6px;
}
.stock-table td.detail-indent { color: var(--body-quiet-color); padding-left: 24px; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
}
.tag-serial { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.tag-batch { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.tag-out { background: rgba(248, 113, 113, 0.16); color: #fca5a5; }
/* Task status / priority tags (tasks/admin.py). */
.tag-open { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
.tag-progress { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.tag-review { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
.overdue { color: #fca5a5; font-weight: 600; }

/* Task page: comments read like a timeline (time, author, text), the newest at the bottom. */
#comments-group td.field-created_at, #comments-group td.field-author { white-space: nowrap; color: var(--body-quiet-color); width: 1%; }
#comments-group td.field-text p { white-space: pre-wrap; margin: 0; }
#comments-group td.field-text textarea { width: 100%; box-sizing: border-box; }
.delegate-page select, .delegate-page textarea { min-width: 320px; }

/* Project progress bar (projects/admin.py) and the task list on the project page. */
.progress { display: inline-block; width: 90px; height: 8px; border-radius: 999px; background: var(--hairline-color); vertical-align: middle; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: #34d399; }
.project-tasks .stock-table { margin: 8px 12px; width: calc(100% - 24px); }
.project-tasks p { margin: 8px 12px; }

/* "Ütemezés" Gantt chart (templates/admin/projects/schedule.html). Label column + a timeline positioned in percent. */
.gantt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.gantt-legend { display: inline-flex; gap: 16px; margin-left: auto; color: var(--body-quiet-color); font-size: 0.8rem; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend .ms { position: static; transform: rotate(45deg); }
.today-key { display: inline-block; width: 2px; height: 14px; background: #f472b6; }
.gantt-empty { color: var(--body-quiet-color); }
.gantt { border: 1px solid var(--hairline-color); border-radius: var(--radius); background: var(--card-bg); overflow: hidden; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 380px 1fr; }
.gantt-head { position: sticky; top: 0; z-index: 3; background: var(--darkened-bg); border-bottom: 1px solid var(--hairline-color); }
.gantt-head .gantt-label { padding: 8px 12px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--body-quiet-color); }
.gantt-label { padding: 6px 12px; border-right: 1px solid var(--hairline-color); min-width: 0; }
.gantt-label a, .gantt-label .ms-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-sub { display: block; font-size: 0.72rem; color: var(--body-quiet-color); margin-top: 2px; }
.gantt-timeline { position: relative; min-height: 38px; }
.gantt-head .gantt-timeline { min-height: 32px; }
.gantt-month { position: absolute; top: 0; bottom: 0; padding: 8px 6px; font-size: 0.72rem; color: var(--body-quiet-color);
               border-left: 1px solid var(--hairline-color); white-space: nowrap; overflow: hidden; box-sizing: border-box; }
.gantt-grid { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--hairline-color); opacity: 0.5; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f472b6; z-index: 1; }
.gantt-row { border-top: 1px solid var(--hairline-color); }
.gantt-project { background: rgba(255, 255, 255, 0.02); }
.gantt-project .gantt-timeline { min-height: 46px; }
.gantt-milestone .gantt-label { padding-left: 28px; font-size: 0.85rem; }
.gantt-bar { position: absolute; top: 14px; height: 18px; border-radius: 6px; background: #3b82f6; opacity: 0.85; z-index: 1; }
.gantt-bar.status-planning { background: #64748b; }
.gantt-bar.status-on_hold { background: #0ea5e9; }
.gantt-bar.status-closed { background: #10b981; }
.gantt-bar.status-cancelled { background: #7f1d1d; }
.gantt-bar.overdue-bar { box-shadow: inset -4px 0 0 #f87171; }
.gantt-bar.open-ended { background-image: repeating-linear-gradient(90deg, transparent 0 8px, rgba(0, 0, 0, 0.25) 8px 12px); }
/* Milestone diamonds: green = done, blue = planned, red = late. */
.ms { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; transform: rotate(45deg); border-radius: 2px;
      z-index: 2; display: inline-block; border: 2px solid var(--card-bg); }
.ms-on-bar { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.ms-done { background: #34d399; }
.ms-planned { background: #60a5fa; }
.ms-late { background: #f87171; }
.ms-date { position: absolute; top: 50%; margin: -8px 0 0 12px; font-size: 0.7rem; color: var(--body-quiet-color); white-space: nowrap; z-index: 2; }
.ms-undated { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 0.72rem; color: var(--body-quiet-color); font-style: italic; }
.ms-state { font-weight: 600; }

/* Pénzügy: account cards above the movements list, account statement, invoice sections side by side. */
.account-balances { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 12px; }
.balance-card { display: flex; flex-direction: column; gap: 2px; min-width: 200px; padding: 10px 14px; border-radius: var(--radius);
                background: var(--card-bg); border: 1px solid var(--hairline-color); }
.balance-card:hover { border-color: var(--object-tools-bg); }
.balance-kind { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--body-quiet-color); }
.balance-name { font-size: 0.85rem; }
.balance-card strong { font-size: 1.15rem; }
.movement-totals { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 0.85rem; color: var(--body-quiet-color); }
body.wide-form.app-finance #content-main form > div > fieldset.module { grid-column: span 2; }
body.wide-form.app-finance #content-main form > div > fieldset.account-statement { grid-column: 1 / -1; }
.account-statement .stock-table { margin: 8px 12px; width: calc(100% - 24px); }
.account-statement p { margin: 8px 12px; }
.statement-opening td { color: var(--body-quiet-color); font-style: italic; }
@media (max-width: 1400px) { body.wide-form.app-finance #content-main form > div > fieldset.module { grid-column: span 3; } }
@media (max-width: 1024px) { body.wide-form.app-finance #content-main form > div > fieldset.module { grid-column: 1 / -1; } }

/* Start page dashboard (templates/admin/index.html, dashboard/). */
body.start-dashboard #content { width: auto; max-width: none; margin-right: 0; }  /* Django's dashboard.css pins 600px */
body.start-dashboard #content-main { width: 100%; float: none; }
.dash-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.dash-head h1 { margin: 0; }
.dash-date { color: var(--body-quiet-color); font-size: 0.85rem; }
.dash-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--hairline-color); margin-bottom: 16px; }
.dash-tabs button { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--body-quiet-color);
                    padding: 10px 16px; font-size: 0.9rem; font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.dash-tabs button:hover { color: var(--body-fg); }
.dash-tabs button.active { color: #12141a; background: var(--brand); }
.dash-panel { display: none; }
.dash-panel.active { display: block; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius); background: var(--card-bg);
       border: 1px solid var(--hairline-color); border-left: 4px solid var(--brand); color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--object-tools-bg); }
.kpi.good { border-left-color: #34d399; }
.kpi.bad { border-left-color: #f87171; }
.kpi.warn { border-left-color: #fbbf24; }
.kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--body-quiet-color); }
.kpi-value { font-size: 1.45rem; font-weight: 700; color: var(--body-fg); white-space: nowrap; }
.kpi.bad .kpi-value { color: #fca5a5; }
.kpi.good .kpi-value { color: #6ee7b7; }
.kpi-hint { font-size: 0.75rem; color: var(--body-quiet-color); }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-card { background: var(--card-bg); border: 1px solid var(--hairline-color); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.dash-card.wide { grid-column: span 2; }
.dash-card h2 { margin: 0 0 10px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--body-quiet-color);
                background: none; padding: 0; }
.dash-empty { color: var(--body-quiet-color); font-style: italic; }
.dash-more { margin: 14px 2px 0; font-size: 0.85rem; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--hairline-color); font-size: 0.85rem; }
.dash-list li:last-child { border-bottom: none; }
.dash-list li > :first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list li span { color: var(--body-quiet-color); font-size: 0.75rem; white-space: nowrap; }
.dash-list li b { white-space: nowrap; }
.dash .bad { color: #fca5a5; }
.dash .warn { color: #fcd34d; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dash-table th { text-align: left; font-size: 0.72rem; color: var(--body-quiet-color); text-transform: uppercase; padding: 6px; }
.dash-table td { padding: 6px; border-top: 1px solid var(--hairline-color); }
.dash-table .num { text-align: right; white-space: nowrap; }
.dash-progress { display: inline-block; width: 80px; height: 8px; border-radius: 999px; background: var(--hairline-color); overflow: hidden; vertical-align: middle; }
.dash-progress span { display: block; height: 100%; background: #34d399; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--hairline-color); stroke-width: 1; }
.chart-axis { fill: var(--body-quiet-color); font-size: 10px; }
.chart-svg rect:hover { opacity: 0.8; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.75rem; color: var(--body-quiet-color); margin-top: 6px; }
.chart-legend i, .donut-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; gap: 8px; align-items: center; font-size: 0.8rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; border-radius: 999px; background: var(--hairline-color); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; }
.hbar-value { white-space: nowrap; font-weight: 600; }
.donut { display: flex; align-items: center; gap: 16px; }
.donut-svg { width: 140px; height: 140px; flex: none; }
.donut-track { stroke: var(--hairline-color); }
.donut-total { fill: var(--body-fg); font-size: 16px; font-weight: 700; }
.donut-caption { fill: var(--body-quiet-color); font-size: 9px; }
.donut-legend { list-style: none; margin: 0; padding: 0; font-size: 0.78rem; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.donut-legend b { margin-left: 4px; }
@media (max-width: 1400px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-card.wide { grid-column: auto; } }

/* Tax number lookup (static/js/taxpayer_lookup.js): button and status after the tax number field. */
.taxpayer-button { margin-left: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--object-tools-bg);
                   background: transparent; color: var(--link-fg); cursor: pointer; font-size: 0.75rem; }
.taxpayer-button:hover { background: var(--object-tools-bg); color: #fff; }
.taxpayer-status { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--body-quiet-color); }
.taxpayer-status[data-kind="ok"] { color: #6ee7b7; }
.taxpayer-status[data-kind="warning"] { color: #fcd34d; }
.taxpayer-status[data-kind="error"] { color: #fca5a5; }

/* Törzsadatok → Saját cégek: logo thumbnail in the list, preview on the page. */
.company-logo-thumb { max-height: 28px; max-width: 90px; vertical-align: middle; background: #fff; border-radius: 4px; padding: 2px; }
.company-logo-preview { max-height: 120px; max-width: 320px; background: #fff; border-radius: 6px; padding: 8px; }
body.wide-form.app-masterdata #content-main form > div > fieldset.module .description { margin: 6px 12px; font-size: 0.75rem; }

/* Bejövő számlák: transfer file page and the "mark as paid" row. */
.transfer-page .form-row { padding: 8px 12px; }
.transfer-page .form-row > label:first-child, .transfer-page .form-row .label { display: inline-block; min-width: 230px; font-weight: 600; }
.transfer-page .stock-table { margin: 8px 12px; width: calc(100% - 24px); }
.transfer-page .skipped ul { margin: 8px 12px 12px; }
.transfer-page > #content-main > form > p.help { margin-top: 12px; }
.pay-row label { margin-right: 6px; }
.pay-row select, .pay-row input[type=date] { margin-right: 12px; }

/* "Ügyfél történetisége" page (templates/admin/customers/history.html): timeline on the left, new event form on the right. */
.history-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.history-head p { margin: 8px 12px 12px; color: var(--body-quiet-color); }
.history-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.history-filter a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--hairline-color); font-size: 0.8rem; }
.history-filter a.selected { background: var(--object-tools-bg); border-color: var(--object-tools-bg); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--hairline-color); margin-left: 70px; }
.timeline-item { position: relative; display: block; padding: 8px 0 8px 18px; }
.timeline-item::before { content: ''; position: absolute; left: -7px; top: 16px; width: 12px; height: 12px; border-radius: 50%;
                         background: var(--card-bg); border: 2px solid #60a5fa; }
.timeline-item.kind-event::before { border-color: #7dd3fc; background: #7dd3fc; }
.timeline-date { position: absolute; left: -84px; top: 10px; width: 70px; text-align: right; font-size: 0.75rem; color: var(--body-quiet-color); line-height: 1.3; }
.timeline-body { background: var(--card-bg); border: 1px solid var(--hairline-color); border-radius: var(--radius); padding: 8px 12px; }
.timeline-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline-status { font-size: 0.75rem; color: var(--body-quiet-color); }
.timeline-amount { margin-left: auto; font-weight: 600; }
.timeline-text { margin: 6px 0 0; }
.timeline-details { margin: 4px 0 0; font-size: 0.75rem; color: var(--body-quiet-color); }
.history-empty { color: var(--body-quiet-color); }
.history-side .module { margin-bottom: 16px; }
.event-form .form-row { padding: 6px 12px; display: flex; flex-direction: column; gap: 4px; }
.event-form .form-row label { font-size: 0.75rem; color: var(--body-quiet-color); }
.event-form input[type=text], .event-form input[type=date], .event-form input[type=datetime-local],
.event-form select, .event-form textarea { width: 100%; box-sizing: border-box; }
.event-form .submit-row { margin: 8px 12px 12px; }
.follow-ups ul { margin: 8px 12px 12px; padding-left: 16px; }
@media (max-width: 1200px) { .history-layout { grid-template-columns: 1fr; } }

/* Sidebar: main menu groups open / close by clicking their title (static/js/nav_collapse.js). */
#nav-sidebar caption.nav-toggle { cursor: pointer; user-select: none; position: relative; padding-right: 28px; }
#nav-sidebar caption.nav-toggle a { pointer-events: none; }  /* the click toggles the group, it does not open the app page */
#nav-sidebar caption.nav-toggle::after {
    content: ''; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
    opacity: 0.7; transition: transform 0.15s;
}
#nav-sidebar .module.collapsed caption.nav-toggle::after { transform: rotate(-45deg); margin-top: -3px; }
#nav-sidebar .module.collapsed table tr { display: none; }
#nav-sidebar.nav-filtering .module.collapsed table tr { display: table-row; }
#nav-sidebar .module.collapsed { margin-bottom: 4px; }

/* Manufacturing pages (Gyártás): sections two per row; the material needs table full width. */
body.wide-form.app-manufacturing #content-main form > div > fieldset.module { grid-column: span 3; }
body.wide-form.app-manufacturing #content-main form > div > fieldset.material-needs { grid-column: 1 / -1; }
.material-needs .stock-table { margin: 8px 12px; width: calc(100% - 24px); }
.material-needs p { margin: 8px 12px; }
.finish-row label { margin-right: 6px; }
.finish-row input[type=text], .finish-row input[type=date] { margin-right: 12px; }
@media (max-width: 1024px) {
    body.wide-form.app-manufacturing #content-main form > div > fieldset.module { grid-column: 1 / -1; }
}

/* Milestones: "Számla kiállítása" button in the table; the invoice preview placeholder page. */
#milestones-group a.invoice-button { padding: 4px 10px; font-size: 0.72rem; white-space: nowrap; }
#milestones-group td.field-amount input { width: 120px; }
.invoice-preview-page .invoice-draft .stock-table { margin: 8px 12px; width: calc(100% - 24px); }
.invoice-preview-page .invoice-draft th { width: 160px; text-align: left; }
.invoice-preview-page .invoice-draft p, .invoice-preview-page .invoice-missing ul { margin: 8px 12px; }
.ms-state-done { color: #6ee7b7; }
.ms-state-planned { color: #93c5fd; }
.ms-state-late { color: #fca5a5; }
.ms-state-undated { color: var(--body-quiet-color); }

/* Barcode scanning above product-line tables (static/js/barcode_scan.js) and the product form's barcode field. */
.barcode-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 12px; background: var(--darkened-bg);
               border-bottom: 1px solid var(--hairline-color); }
.barcode-bar label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.8rem; color: var(--body-medium-color); }
.barcode-icon { width: 22px; height: 14px; background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 3px,
                currentColor 3px 4px, transparent 4px 6px, currentColor 6px 9px, transparent 9px 10px); opacity: 0.85; }
.barcode-bar input.barcode-input { width: 320px; max-width: 100%; }
.barcode-msg { font-size: 0.78rem; color: var(--body-quiet-color); }
.barcode-msg.good { color: #6ee7b7; }
.barcode-msg.bad { color: #fca5a5; }
@keyframes scan-hit { from { background: rgba(52, 211, 153, 0.35); } to { background: transparent; } }
tr.scan-hit td, .scan-hit { animation: scan-hit 1.2s ease-out; }
.barcode-new-button { margin-left: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--object-tools-bg);
                      background: transparent; color: var(--link-fg); cursor: pointer; font-size: 0.75rem; }
.barcode-new-button:hover { background: var(--object-tools-bg); color: #fff; }

/* Szerviz munkalap: three sections on the first row, repair texts + overview on the second; the log, comments,
   hours and files two per row, the parts table full width. */
body.wide-form.model-serviceorder #content-main form > div > fieldset.service-text { grid-column: span 4; }
body.wide-form.model-serviceorder #content-main form > div > #work_entries-group,
body.wide-form.model-serviceorder #content-main form > div > #comments-group { grid-column: span 3; }
#work_entries-group td.field-technician .select2-container { width: 180px !important; }
#work_entries-group td.field-description input { min-width: 200px; }
#comments-group td.field-text textarea { min-width: 320px; }
#events-group td.field-kind select { width: 230px; }
body.wide-form.model-serviceorder fieldset.service-text textarea { width: 100%; box-sizing: border-box; }
body.wide-form.model-serviceorder fieldset.service-text .aligned label,
body.wide-form.model-serviceorder fieldset.service-text label { width: 190px; min-width: 190px; }
body.wide-form.model-serviceorder .inline-group table { width: 100%; }
body.wide-form.model-serviceorder .inline-group td input[type=text],
body.wide-form.model-serviceorder .inline-group td textarea { width: 100%; box-sizing: border-box; }
#parts-group td.field-quantity input, #parts-group td.field-net_unit_price input { width: 100px; }
#parts-group td.field-unit input { width: 60px; }
#work_entries-group td.field-hours input { width: 70px; }
#events-group td.field-text input { min-width: 260px; }
.service-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.service-flow li { padding: 3px 8px; border-radius: 999px; font-size: 0.7rem; border: 1px solid var(--hairline-color); color: var(--body-quiet-color); }
.service-flow li.done { border-color: #065f46; color: #6ee7b7; }
.service-flow li.current { background: var(--object-tools-bg); border-color: var(--object-tools-bg); color: #fff; font-weight: 600; }
table.service-dates { border: none; margin: 0; }
table.service-dates th, table.service-dates td { padding: 2px 10px 2px 0; border: none; background: transparent; font-size: 0.8rem; }
table.service-dates th { color: var(--body-quiet-color); font-weight: 500; white-space: nowrap; }
.service-actions input[type=submit] { margin-right: 8px; }
@media (max-width: 1400px) {
    body.wide-form.model-serviceorder #content-main form > div > fieldset.service-text,
    body.wide-form.model-serviceorder #content-main form > div > .inline-group { grid-column: 1 / -1; }
}

/* Értesítések: the bell in the header (templates/admin/base_site.html, static/js/notifications.js) and the list page. */
#user-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.notif { position: relative; margin-right: 10px; }
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
              border-radius: 50%; border: 1px solid var(--hairline-color); background: var(--darkened-bg); color: var(--body-fg);
              cursor: pointer; padding: 0; }
.notif-bell:hover, .notif-bell[aria-expanded="true"] { background: var(--selected-bg); color: #fff; }
.notif-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
               background: #ef4444; color: #fff; font-size: 0.68rem; font-weight: 700; line-height: 18px; text-align: center;
               box-shadow: 0 0 0 2px var(--header-bg); box-sizing: border-box; }
.notif-panel { position: absolute; right: 0; top: 46px; z-index: 1000; width: 380px; max-width: calc(100vw - 24px); text-align: left;
               background: var(--card-bg, #161922); border: 1px solid var(--border-color); border-radius: 12px;
               box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--hairline-color);
              color: var(--body-fg); font-size: 0.9rem; text-transform: none; letter-spacing: 0; }
.notif-read-all { background: none; border: none; color: var(--link-fg); cursor: pointer; font-size: 0.78rem; padding: 0; }
.notif-items { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.notif-item a, .notif-page-list .notif-item a { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 10px 26px; position: relative;
               color: var(--body-fg) !important; text-decoration: none; border-bottom: 1px solid var(--hairline-color);
               text-transform: none; letter-spacing: 0; font-weight: 400; white-space: normal; }
.notif-item a:hover { background: var(--selected-row); }
.notif-item.unread a { background: rgba(199, 176, 0, 0.08); }
.notif-item.unread a::before { content: ''; position: absolute; left: 10px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.notif-title { font-size: 0.85rem; font-weight: 600; }
.notif-item:not(.unread) .notif-title { font-weight: 500; color: var(--body-medium-color); }
.notif-text { font-size: 0.78rem; color: var(--body-medium-color); }
.notif-meta { font-size: 0.7rem; color: var(--body-quiet-color); }
.notif-item.kind-task .notif-meta { color: #fbbf24; }
.notif-item.kind-leave .notif-meta { color: #34d399; }
.notif-item.kind-project .notif-meta { color: #a78bfa; }
.notif-item.kind-service .notif-meta { color: #22d3ee; }
.notif-empty { padding: 16px 14px; color: var(--body-quiet-color); font-size: 0.82rem; list-style: none; }
.notif-all { display: block; padding: 10px 14px; text-align: center; font-size: 0.8rem; text-transform: none; letter-spacing: 0; }
.notif-page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.notif-page-list { list-style: none; margin: 0 0 16px; padding: 0; max-width: 880px; border: 1px solid var(--hairline-color);
                   border-radius: 12px; overflow: hidden; background: var(--card-bg); }

/* Eszközök és járművek: expiry warnings; the vehicle's trip / cost tables full width. */
.alert-bad { color: #fca5a5; font-weight: 600; }
.alert-warn { color: #fcd34d; }
body.wide-form.app-assets #content-main form > div > .inline-group { grid-column: 1 / -1; }

/* Reklamáció page: three sections on the first row, the two text sections side by side. */
body.wide-form.model-complaint #content-main form > div > fieldset.complaint-text { grid-column: span 3; }
body.wide-form.model-complaint fieldset.complaint-text textarea { width: 100%; max-width: none; box-sizing: border-box; }
body.wide-form.model-complaint #content-main form > div > .inline-group { grid-column: span 3; }
@media (max-width: 1400px) { body.wide-form.model-complaint #content-main form > div > .inline-group { grid-column: 1 / -1; } }

/* Értékesítési tölcsér: a kanban board of opportunity cards. */
.funnel-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 8px; }
.funnel-new { margin-left: auto; }
.funnel { display: grid; grid-template-columns: repeat(7, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.funnel-col { background: var(--darkened-bg); border: 1px solid var(--hairline-color); border-radius: 12px; display: flex; flex-direction: column;
              min-height: 300px; border-top: 3px solid #60a5fa; }
.funnel-col.stage-lead { border-top-color: #94a3b8; }
.funnel-col.stage-contact { border-top-color: #22d3ee; }
.funnel-col.stage-needs { border-top-color: #a78bfa; }
.funnel-col.stage-proposal { border-top-color: #fbbf24; }
.funnel-col.stage-negotiation { border-top-color: #fb923c; }
.funnel-col.stage-won { border-top-color: #34d399; }
.funnel-col.stage-lost { border-top-color: #f87171; }
.funnel-col.closed { opacity: 0.85; }
.funnel-col.drop-target { background: var(--selected-bg); }
.funnel-col header { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--hairline-color); }
.funnel-col header b { font-size: 0.85rem; }
.funnel-col header span { font-size: 0.72rem; color: var(--body-quiet-color); }
.funnel-cards { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.funnel-card { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 10px; background: var(--card-bg);
               border: 1px solid var(--hairline-color); color: var(--body-fg) !important; text-decoration: none !important; cursor: grab; }
.funnel-card:hover { border-color: var(--accent); }
.funnel-card.dragging { opacity: 0.4; }
.funnel-card.late { border-left: 3px solid #f87171; }
.fc-title { font-weight: 600; font-size: 0.82rem; }
.fc-party { font-size: 0.75rem; color: var(--body-medium-color); }
.fc-row { display: flex; justify-content: space-between; font-size: 0.8rem; }
.fc-row span { color: var(--body-quiet-color); }
.fc-next { font-size: 0.72rem; color: #fbbf24; }
.funnel-card.late .fc-next { color: #fca5a5; }
.fc-meta { font-size: 0.68rem; color: var(--body-quiet-color); }
.funnel-empty { color: var(--body-quiet-color); font-size: 0.75rem; margin: 4px; }
.object-tools form.inline-tool { display: inline; margin: 0; }
.object-tools .object-tool-button { background: var(--object-tools-bg); color: var(--object-tools-fg); border: none; border-radius: 15px;
                                    padding: 3px 12px; font-size: 0.6875rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.5px;
                                    cursor: pointer; line-height: 20px; }
.object-tools .object-tool-button:hover { background: var(--object-tools-hover-bg); }

/* Bankkivonat page: lines with their state and the actions of the open ones. */
.kpi-value.kpi-small { font-size: 1rem; white-space: normal; }
table.bank-lines { width: 100%; }
table.bank-lines td { vertical-align: top; font-size: 0.8rem; }
table.bank-lines td.ref { max-width: 320px; word-break: break-word; }
table.bank-lines tr.open td { background: rgba(251, 191, 36, 0.04); }
table.bank-lines td.actions form { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; flex-wrap: wrap; }
table.bank-lines td.actions select { max-width: 330px; }
.link-button { background: none; border: none; padding: 0; color: var(--link-fg); cursor: pointer; font-size: 0.78rem; }
.diff-minus { color: #fca5a5; font-weight: 600; }

/* Változásnapló: changed fields in the list and on every record's "Történet" page. */
ul.audit-changes { margin: 0; padding: 0; list-style: none; font-size: 0.78rem; }
ul.audit-changes li { padding: 1px 0; }
.audit-old { color: #fca5a5; text-decoration: line-through; text-decoration-color: rgba(252, 165, 165, 0.5); }
.audit-new { color: #6ee7b7; }
.audit-history { margin-bottom: 20px; }
.audit-history .stock-table { margin: 8px 12px; width: calc(100% - 24px); }
td.nowrap { white-space: nowrap; }

/* Promóciók: four sections two per row, the preview full width; the promotion hint under a line's price. */
body.wide-form.model-promotion #content-main form > div > fieldset.module { grid-column: span 3; }
body.wide-form.model-promotion #content-main form > div > fieldset.promotion-preview { grid-column: 1 / -1; }
body.wide-form.model-promotion .promotion-preview .stock-table { max-width: 760px; }
body.wide-form.model-promotion .related-widget-wrapper { display: flex; align-items: center; gap: 4px; }
html body.wide-form.model-promotion .related-widget-wrapper .select2-container { flex: 1; width: auto !important; min-width: 260px; }
.promo-hint { display: block; margin-top: 3px; font-size: 0.7rem; color: #34d399; white-space: normal; max-width: 180px; }
td.field-promotion_info p { font-size: 0.72rem; color: #34d399; max-width: 220px; white-space: normal; }
@media (max-width: 1400px) { body.wide-form.model-promotion #content-main form > div > fieldset.module { grid-column: 1 / -1; } }

/* Feladat page (body.wide-form.model-task): the task fields in a grid of four with the label above each input,
   Leírás and Adatok side by side, subtasks + time, then the tables, all full width. */
body.wide-form.model-task #content-main form > div > fieldset.task-main,
body.wide-form.model-task #content-main form > div > .task-extras,
body.wide-form.model-task #content-main form > div > .inline-group { grid-column: 1 / -1; }
body.wide-form.model-task #content-main form > div > fieldset.task-desc { grid-column: span 4; }
body.wide-form.model-task #content-main form > div > fieldset.task-meta { grid-column: span 2; }
body.wide-form.model-task fieldset.task-main {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 16px; row-gap: 0; padding-bottom: 8px;
}
body.wide-form.model-task fieldset.task-main > h2,
body.wide-form.model-task fieldset.task-main > .description { grid-column: 1 / -1; }
body.wide-form.model-task fieldset.task-main .form-row { border-bottom: none; padding: 8px 6px; }
body.wide-form.model-task fieldset.task-main .form-row.field-title { grid-column: span 2; }
body.wide-form.model-task fieldset.task-main .form-row.field-assignees { grid-column: span 2; }
body.wide-form.model-task fieldset.task-main .form-row > div > .flex-container { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
body.wide-form.model-task fieldset.task-main .form-row label { width: auto; min-width: 0; padding: 0; float: none; font-size: 0.75rem;
                                                             color: var(--body-quiet-color); }
body.wide-form.model-task fieldset.task-main .form-row input[type=text],
body.wide-form.model-task fieldset.task-main .form-row select { width: 100%; max-width: none; box-sizing: border-box; }
body.wide-form.model-task fieldset.task-main .form-row .date-field { width: 100%; }
body.wide-form.model-task fieldset.task-main .form-row .related-widget-wrapper { display: flex; align-items: center; gap: 4px; }
body.wide-form.model-task fieldset.task-main .form-row .related-widget-wrapper select { flex: 1; }
html body.wide-form.model-task fieldset.task-main .form-row .related-widget-wrapper .select2-container { flex: 1; width: auto !important; min-width: 0; }
body.wide-form.model-task fieldset.task-main .form-row .help { margin: 2px 0 0; padding: 0; font-size: 0.68rem; }
body.wide-form.model-task fieldset.task-main .form-row.field-assignees .help { display: none; }
body.wide-form.model-task fieldset.task-main .form-row .readonly { margin: 0; padding: 6px 0; }
body.wide-form.model-task fieldset.task-desc textarea { width: 100%; max-width: none; box-sizing: border-box; }
body.wide-form.model-task fieldset.task-desc .form-row > div > .flex-container { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
body.wide-form.model-task fieldset.task-desc .form-row label { width: auto; padding: 0; float: none; font-size: 0.75rem; color: var(--body-quiet-color); }
body.wide-form.model-task fieldset.task-meta .form-row { padding: 6px 12px; }
@media (max-width: 1400px) {
    body.wide-form.model-task fieldset.task-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.wide-form.model-task #content-main form > div > fieldset.task-desc,
    body.wide-form.model-task #content-main form > div > fieldset.task-meta { grid-column: 1 / -1; }
}

/* Feladatok: subtasks and logged time on the task page; totals on the time log (Időnapló). */
.task-extras { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.task-extras fieldset.module { margin: 0 0 16px; }
.task-extras .stock-table { margin: 8px 12px; width: calc(100% - 24px); }
.task-extras p { margin: 8px 12px; }
.task-extras table.service-dates { margin: 10px 12px; }
.task-progress { display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; }
.task-progress .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--darkened-bg); overflow: hidden; }
.task-progress .bar span { display: block; height: 100%; background: #34d399; }
#time_entries-group td.field-hours input { width: 80px; }
#time_entries-group td.field-description input { width: 100%; box-sizing: border-box; min-width: 300px; }
.time-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 6px; }
.time-summary > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; border-radius: 10px; background: var(--card-bg);
                      border: 1px solid var(--hairline-color); min-width: 150px; }
.time-summary span { font-size: 0.72rem; color: var(--body-quiet-color); }
.time-summary b { font-size: 1.05rem; }
.time-summary .time-total { border-color: var(--object-tools-bg); }
@media (max-width: 1200px) { .task-extras { grid-template-columns: 1fr; } }

/* Szabadságok: type colour swatches, list toolbars, the request's decision row and the month calendar. */
.leave-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.leave-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 14px; }
.leave-toolbar form { margin: 0; }
.leave-toolbar .help { flex-basis: 100%; margin: 0; }
.leave-help { margin: 8px 0; }
.leave-decision { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.leave-decision label { font-weight: 600; }
.leave-decision input[type=text] { width: 380px; max-width: 100%; }
.submit-row input.leave-reject { background: var(--delete-button-bg); }
.submit-row input.leave-reject:hover { background: var(--delete-button-hover-bg); }
ul.leave-others { margin: 0; padding-left: 16px; }
.leave-cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.leave-cal-toolbar h2 { margin: 0 6px; font-size: 1.15rem; min-width: 160px; text-align: center; }
.leave-cal-info { color: var(--body-quiet-color); font-size: 0.8rem; }
.leave-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.75rem; color: var(--body-medium-color); }
.leave-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.leave-legend i.pending-key { background: repeating-linear-gradient(45deg, #60a5fa 0 3px, transparent 3px 6px); border: 1px solid #60a5fa; }
.leave-legend i.off-key { background: var(--darkened-bg); border: 1px solid var(--hairline-color); }
.leave-new { margin-left: auto; }
.leave-cal-wrap { overflow-x: auto; border: 1px solid var(--hairline-color); border-radius: var(--radius, 10px); background: var(--card-bg); }
table.leave-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.leave-cal th, table.leave-cal td { padding: 0; border: 1px solid var(--hairline-color); text-align: center; height: 30px; }
table.leave-cal thead th { background: var(--darkened-bg); font-size: 0.68rem; font-weight: 500; color: var(--body-quiet-color); padding: 4px 0; }
table.leave-cal thead th .dn { display: block; font-size: 0.8rem; font-weight: 600; color: var(--body-fg); }
table.leave-cal th.name { width: 190px; text-align: left; padding: 0 10px; font-size: 0.8rem; font-weight: 500; color: var(--body-fg);
                          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.leave-cal th.sum, table.leave-cal td.sum { width: 44px; font-size: 0.78rem; }
table.leave-cal .off { background: rgba(255, 255, 255, 0.035); }
table.leave-cal thead th.off .dn { color: var(--body-quiet-color); }
table.leave-cal .today { box-shadow: inset 0 0 0 2px #f472b6; }
table.leave-cal tr.me th.name { color: var(--accent); font-weight: 700; }
.leave-block { display: block; margin: 4px 2px; height: 20px; border-radius: 4px; background: var(--leave-color); }
.leave-block.pending { background: repeating-linear-gradient(45deg, var(--leave-color) 0 4px, transparent 4px 8px);
                       box-shadow: inset 0 0 0 1px var(--leave-color); }
.leave-block.half { width: 50%; }

/* Notes on documents: a compact box instead of the admin's large textarea (rows set in the admin). */
textarea.compact-notes { width: 100%; max-width: 640px; min-height: 0; box-sizing: border-box; }
.stock-table .quiet { color: var(--body-quiet-color); }

/* Messages */
ul.messagelist li { border-radius: 8px; margin-bottom: 8px; color: var(--body-fg); }

/* Login page */
.login #container {
    background: var(--card-bg);
    border: 1px solid var(--hairline-color);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.login #header { padding: 20px 24px; }
.login #content { padding: 24px; }
.login .submit-row { background: transparent; border: none; padding: 1em 0 0; }
.login .submit-row input { width: 100%; }
/* "Bejelentkezés céges Microsoft-fiókkal" (templates/admin/login.html) */
.ms-login { margin-bottom: 18px; }
.ms-login-button { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 14px; border-radius: 8px;
                   background: #ffffff; color: #1f2937 !important; font-weight: 600; text-decoration: none !important;
                   border: 1px solid #d1d5db; }
.ms-login-button:hover { background: #f3f4f6; }
.ms-login-or { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--body-quiet-color); font-size: 0.75rem; }
.ms-login-or::before, .ms-login-or::after { content: ''; flex: 1; border-top: 1px solid var(--hairline-color); }

@media (max-width: 767px) {
    #header, div.breadcrumbs { padding-left: 16px; padding-right: 16px; }
    #content { padding: 16px; }
}

/* Rendszerbeállítások → Modulok: switch cards */
.system-modules .modules-intro { max-width: 1100px; color: var(--body-medium-color); line-height: 1.55; margin: 0 0 18px; }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.module-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border-color);
  border-radius: 10px; background: var(--darkened-bg); cursor: pointer; transition: opacity .15s, border-color .15s; }
.module-card:hover { border-color: var(--accent); }
.module-card.off { opacity: .55; }
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.module-name { font-size: 15px; font-weight: 600; color: var(--body-loud-color); }
.module-desc { color: var(--body-medium-color); }
.module-note { font-size: 12px; color: var(--body-quiet-color); }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; border-radius: 12px; background: #3a4a6b; transition: background .15s; }
.switch .slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .15s; }
.switch input:checked + .slider { background: #16a34a; }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.modules-core { margin: 18px 0 6px; color: var(--body-quiet-color); }
.system-modules .submit-row { margin-top: 14px; }
.module-off-page { max-width: 760px; }
.module-off-page h2 { color: var(--body-loud-color); }

/* Munkaidő-nyilvántartás (timesheet): month summary and the attendance sheet */
.timesheet-page .ts-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.timesheet-page .ts-toolbar h2 { margin: 0 6px; font-size: 1.15rem; color: var(--body-loud-color); }
.timesheet-page .ts-spacer { flex: 1; }
.timesheet-page .quiet { color: var(--body-quiet-color); }
.ts-table { width: 100%; border-collapse: collapse; background: var(--darkened-bg); border-radius: 10px; overflow: hidden; }
.ts-table th, .ts-table td { padding: 7px 10px; border-bottom: 1px solid var(--hairline-color); vertical-align: middle; text-align: left; }
.ts-table thead th { background: var(--selected-bg); color: var(--body-medium-color); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .3px; }
.ts-table tfoot th { background: var(--selected-bg); color: var(--body-loud-color); }
.ts-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ts-table .bad { color: #f87171; }
.ts-table .warn { color: #fbbf24; }
.ts-table small { color: var(--body-quiet-color); }
.ts-days tr.restday td, .ts-days tr.holiday td { background: rgba(148, 163, 184, 0.07); }
.ts-days tr.holiday .ts-kind { color: #f9a8d4; }
.ts-days tr.today td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.ts-days tr.future td { opacity: .55; }
.ts-days tr.on-leave td { background: rgba(16, 185, 129, 0.06); }
.ts-days .ts-date { white-space: nowrap; }
.ts-days .ts-date span { color: var(--body-quiet-color); margin-left: 4px; }
.ts-days .ts-kind { color: var(--body-quiet-color); margin-right: 6px; }
.ts-days .ts-entries { line-height: 1.7; }
.ts-days .ts-entries .tag { margin-left: 4px; }
.ts-clock { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; margin-bottom: 14px;
            border-radius: 12px; background: var(--darkened-bg); border: 1px solid var(--border-color); }
.ts-clock form { display: flex; gap: 8px; align-items: center; margin: 0; }
.ts-clock select { height: auto; }
.ts-clock .ts-stop { background: #dc2626; color: #fff; }
.ts-extra { display: flex; flex-wrap: wrap; gap: 18px; color: var(--body-medium-color); margin: -6px 0 14px; }
.ts-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.ts-actions form { margin: 0; }
.ts-decision { margin-top: 16px; display: grid; gap: 12px; }
.ts-form { padding: 12px 16px; border-radius: 12px; background: var(--darkened-bg); border: 1px solid var(--border-color);
           display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ts-form h3 { width: 100%; margin: 0; font-size: 0.95rem; color: var(--body-loud-color); }
.ts-form label { display: flex; flex-direction: column; gap: 4px; color: var(--body-quiet-color); font-size: 0.8rem; }
.ts-form .help { width: 100%; margin: 0; }

/* Rendszerbeállítások → Készletértékelés */
.valuation-table { max-width: 1200px; }
.valuation-table tr.selected td { background: var(--selected-row); }
.valuation-table td .help { margin-top: 4px; }
.valuation-table input[type=radio] { width: 18px; height: 18px; }
.warn-text { color: #fbbf24; }
.valuation-missing { margin-top: 20px; max-width: 1200px; padding: 0 12px 12px; }
.valuation-missing ul { columns: 3; }

/* E-mail küldése (config/admin_pdf.py) */
.email-compose { max-width: 1000px; }
.email-compose .form-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; }
.email-compose .form-row > label:first-child { width: 110px; flex: none; padding-top: 8px; }
.email-compose input.vTextField, .email-compose textarea { flex: 1; min-width: 0; width: auto; max-width: 820px; }
.email-compose textarea { min-height: 220px; font-family: inherit; }
.email-compose .email-contacts { flex-basis: 100%; margin-left: 122px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.email-compose .email-add { padding: 4px 10px; font-size: 12px; }
.email-compose h2 { margin-top: 28px; }
.email-compose .form-row > label.email-attach { width: auto; margin-left: 122px; padding-top: 0; }

/* Kapacitásnaptár (templates/admin/manufacturing/capacity.html) */
.cap-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 10px; }
.cap-toolbar h2 { margin: 0; font-size: 16px; }
.cap-range a { padding: 4px 8px; border-radius: 6px; }
.cap-range a.on { background: var(--selected-bg); font-weight: 600; }
.cap-legend { display: flex; align-items: center; gap: 6px; color: var(--body-quiet-color); font-size: 12px; margin-left: auto; }
.cap-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-left: 8px; }
.l-low, .cap-grid td.low { background: rgba(52, 211, 153, 0.25); }
.l-mid, .cap-grid td.mid { background: rgba(251, 191, 36, 0.35); }
.l-high, .cap-grid td.high { background: rgba(248, 113, 113, 0.5); }
.l-off { background: #1a2440; }
.cap-title { margin: 18px 0 8px; font-size: 14px; color: var(--body-loud-color); }
.cap-title small { color: var(--body-quiet-color); font-weight: 400; }
.cap-wrap { overflow-x: auto; }
.cap-grid { border-collapse: collapse; width: 100%; table-layout: fixed; }
.cap-grid th, .cap-grid td { border: 1px solid var(--hairline-color); text-align: center; padding: 4px 0; font-size: 12px; }
.cap-grid thead th small { display: block; color: var(--body-quiet-color); font-weight: 400; }
.cap-grid .cap-name { width: 210px; text-align: left; padding: 4px 8px; font-weight: 600; }
.cap-grid .cap-name small { display: block; font-weight: 400; color: var(--body-quiet-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-grid .cap-sum { width: 150px; }
.cap-grid .off { background: #1a2440; }
.cap-grid .today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cap-grid td[data-details] { cursor: pointer; }
.cap-details { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--darkened-bg); max-width: 700px; }
.cap-details ul { margin: 4px 0 0 18px; }
.cap-gantt { min-width: 900px; }
.cap-gantt-head, .cap-gantt-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--hairline-color); }
.cap-gantt .cap-name { width: 210px; flex: none; padding: 4px 8px; font-size: 12px; }
.cap-gantt .cap-name small { display: block; color: var(--body-quiet-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-gantt .cap-days { position: relative; flex: 1; display: grid; grid-template-columns: repeat(var(--days), 1fr); min-height: 34px; }
.cap-gantt .cap-days > span { border-left: 1px solid var(--hairline-color); font-size: 11px; text-align: center; color: var(--body-quiet-color); }
.cap-gantt .cap-days > span.off { background: #1a2440; }
.cap-gantt .cap-days > span.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cap-bar { position: absolute; top: 6px; height: 22px; border-radius: 6px; background: #2563eb; color: #fff; font-size: 11px; line-height: 22px;
           padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: grab; touch-action: none; }
.cap-bar.status-in_progress { background: #d97706; }
.cap-bar.status-paused { background: #ea580c; }
.cap-bar.status-planned { background: #475569; }
.cap-bar.late { box-shadow: 0 0 0 2px #f87171; }
.cap-bar.dragging { cursor: grabbing; opacity: 0.8; z-index: 2; }
.cap-grid td.hand { background: rgba(148, 163, 184, 0.18); }

/* Adatcsere */
.dataio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-bottom: 12px; }
.dataio-card { padding: 0 14px 12px; margin: 0; }
.dataio-cols { margin: 6px 0 0 16px; font-size: 12px; }
.dataio-preview { padding: 0 14px 12px; margin-bottom: 18px; }
.reminders-due { padding: 0 14px 12px; margin-bottom: 18px; }

/* Gépkihasználtság */
.util-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.util-charts .module { padding: 0 12px 12px; margin: 0; }
.util-table { margin-top: 8px; }
@media (max-width: 1100px) { .util-charts { grid-template-columns: 1fr; } }

/* Foglalási naptár */
.booking-filter { display: flex; gap: 10px; align-items: center; }
.booking-filter select { height: auto; }
.booking-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.booking-grid th, .booking-grid td { border: 1px solid var(--hairline-color); vertical-align: top; padding: 4px; }
.booking-grid thead th { text-align: center; font-size: 12px; }
.booking-grid thead th small { display: block; color: var(--body-quiet-color); font-weight: 400; }
.booking-grid th.res { width: 220px; text-align: left; font-size: 13px; }
.booking-grid th.res small { display: block; color: var(--body-quiet-color); font-weight: 400; font-size: 11px; }
.booking-grid .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.booking-grid .off { background: #1a2440; }
.booking-grid .today { outline: 2px solid var(--accent); outline-offset: -2px; }
.booking-grid td { height: 64px; position: relative; }
.booking-grid td.past { opacity: 0.6; }
.booking-grid .slot { display: block; margin-bottom: 4px; padding: 3px 6px; border-radius: 6px; font-size: 11px; line-height: 1.3; color: #fff;
                      background: color-mix(in srgb, var(--c) 55%, #101319); border-left: 3px solid var(--c); text-decoration: none; }
.booking-grid .slot small { display: block; opacity: 0.8; }
.booking-grid .slot.own { box-shadow: 0 0 0 1px #fff inset; }
.booking-grid .slot.pending { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--c) 45%, #101319) 0 6px, #101319 6px 12px); }
.booking-grid .slot-add { position: absolute; right: 4px; bottom: 2px; font-size: 16px; color: var(--body-quiet-color); text-decoration: none; }
.booking-grid td:hover .slot-add { color: var(--accent); }

/* Adatok törlése */
.reset-page { max-width: 1000px; }
.reset-warning { border: 1px solid #f87171; background: rgba(248, 113, 113, 0.12); border-radius: 10px; padding: 4px 18px 10px; margin-bottom: 18px; }
.reset-warning h2 { color: #fca5a5; }
.reset-form { padding: 0 16px 12px; }
.reset-table { max-width: 520px; }
.reset-button { background: #dc2626 !important; color: #fff !important; font-weight: 700; }

/* Raktártérkép és bérraktározás (templates/admin/rental/, static/js/warehouse_map.js) */
.warehouse-map-page #content { max-width: none; }
.wmap-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.wmap-plans { display: flex; gap: 4px; flex-wrap: wrap; }
.wmap-plans a { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-color); text-decoration: none; color: var(--body-medium-color); }
.wmap-plans a.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.wmap-plans a.add { border-style: dashed; color: var(--body-quiet-color); }
.wmap-kpis { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: var(--body-quiet-color); }
.wmap-kpis b { color: var(--body-loud-color); }
.wmap-kpis .good b { color: #34d399; }
.wmap-kpis .share { position: relative; padding: 3px 10px; border-radius: 999px; background: #13213d; overflow: hidden; }
.wmap-kpis .share i { position: absolute; inset: 0 auto 0 0; background: rgba(52, 211, 153, 0.25); }
.wmap-kpis .share b { position: relative; }
#wmap-search { flex: 1 1 260px; max-width: 420px; }
.wmap-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.wmap-canvas-wrap { position: relative; background: #13161e; border: 1px solid var(--hairline-color); border-radius: 12px; padding: 10px; }
#wmap-svg { display: block; width: 100%; max-height: calc(100vh - 230px); user-select: none; touch-action: none; }
.wmap-hint { position: absolute; left: 18px; bottom: 12px; font-size: 12px; color: var(--body-quiet-color); pointer-events: none; }
#wmap-svg .floor { fill: #101d36; stroke: #4b6290; stroke-width: 0.12; }
#wmap-svg .grid line { stroke: #1a2a4a; stroke-width: 0.025; }
#wmap-svg .grid line.major { stroke: #263a63; stroke-width: 0.05; }
#wmap-svg .ruler { fill: var(--body-quiet-color); font-size: 0.45px; text-anchor: middle; }
#wmap-svg .ruler.v { text-anchor: end; dominant-baseline: middle; }
#wmap-svg .blk { cursor: pointer; }
#wmap-svg .blk rect { stroke-width: 0.06; }
#wmap-svg .blk text { pointer-events: none; text-anchor: middle; dominant-baseline: central; font-family: inherit; }
#wmap-svg .blk .lbl { fill: #fff; font-weight: 700; }
#wmap-svg .blk .sub { fill: rgba(255, 255, 255, 0.85); }
#wmap-svg .blk.rentable rect { fill: #1e3a5f; stroke: #5b7fb8; stroke-dasharray: 0.2 0.12; }
#wmap-svg .blk.rentable.rented rect { stroke: rgba(255, 255, 255, 0.55); stroke-dasharray: none; fill-opacity: 0.82; }
#wmap-svg .blk.rentable.rented .lbl, #wmap-svg .blk.rentable.rented .sub { fill: #101319; }
#wmap-svg .blk.kind-rack rect { rx: 0.03; }
#wmap-svg .blk.kind-aisle rect { fill: rgba(148, 163, 184, 0.08); stroke: rgba(148, 163, 184, 0.35); stroke-dasharray: 0.3 0.2; }
#wmap-svg .blk.kind-aisle .lbl { fill: var(--body-quiet-color); font-weight: 400; }
#wmap-svg .blk.kind-door rect { fill: #fbbf24; stroke: #f59e0b; }
#wmap-svg .blk.kind-door .lbl { fill: #101319; }
#wmap-svg .blk.kind-office rect { fill: #334155; stroke: #64748b; }
#wmap-svg .blk.kind-wall rect, #wmap-svg .blk.kind-column rect { fill: #94a3b8; stroke: none; }
#wmap-svg .blk.kind-other rect { fill: #3f3f5a; stroke: #6b6b8f; }
#wmap-svg .blk.kind-cold:not(.rented) rect { fill: #0e3a4a; stroke: #22d3ee; }
#wmap-svg .stock-dot { fill: #fff; stroke: #101319; stroke-width: 0.05; }
#wmap-svg .blk:hover rect { filter: brightness(1.25); }
#wmap-svg .blk.selected rect { stroke: #fff; stroke-width: 0.14; stroke-dasharray: none; }
#wmap-svg .blk.hit rect { stroke: #f472b6; stroke-width: 0.16; stroke-dasharray: none; }
#wmap-svg .blk.dim { opacity: 0.22; }
#wmap-svg .blk.editable { cursor: move; }
#wmap-svg .handle { fill: #fff; stroke: var(--primary); stroke-width: 0.06; cursor: nwse-resize; }
.wmap.editing .wmap-canvas-wrap { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.wmap-side { background: #13161e; border: 1px solid var(--hairline-color); border-radius: 12px; padding: 14px 16px; position: sticky; top: 10px;
             max-height: calc(100vh - 120px); overflow-y: auto; }
.wmap-side h3 { margin: 0 0 8px; font-size: 16px; color: var(--body-loud-color); }
.wmap-side h3 small { font-weight: 400; color: var(--body-quiet-color); font-size: 12px; margin-left: 4px; }
.wmap-side h4 { margin: 14px 0 6px; font-size: 13px; color: var(--body-medium-color); }
.wmap-side section + section, #wmap-details + section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline-color); }
.wmap-empty { color: var(--body-quiet-color); margin: 4px 0; }
.wmap-dl { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; margin: 0 0 10px; }
.wmap-dl dt { color: var(--body-quiet-color); }
.wmap-dl dd { margin: 0; }
.wmap-renter { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid; background: #13213d; }
.wmap-renter i { width: 14px; height: 14px; border-radius: 4px; flex: none; margin-top: 3px; }
.wmap-renter div { display: flex; flex-direction: column; gap: 3px; }
.wmap-renter span { color: var(--body-quiet-color); font-size: 12px; }
.wmap-renter.free { border-color: #5b7fb8; border-style: dashed; }
.wmap-goods { width: 100%; border-collapse: collapse; font-size: 12px; }
.wmap-goods th, .wmap-goods td { padding: 4px 6px; border-bottom: 1px solid var(--hairline-color); text-align: left; vertical-align: top; }
.wmap-goods td small { display: block; color: var(--body-quiet-color); }
.wmap-goods .num { text-align: right; white-space: nowrap; }
.wmap-legend { list-style: none; margin: 0; padding: 0; }
.wmap-legend li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.wmap-legend li:hover, .wmap-legend li.active { background: #1a2b4d; }
.wmap-legend li i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.wmap-legend li span { flex: 1; }
.wmap-keys { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--body-quiet-color); margin: 10px 0; }
.wmap-keys i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
.wmap-keys .free { background: #1e3a5f; border: 1px dashed #5b7fb8; }
.wmap-keys .aisle { background: rgba(148, 163, 184, 0.15); border: 1px dashed rgba(148, 163, 184, 0.5); }
.wmap-keys .door { background: #fbbf24; }
.wmap-keys .stock { background: #fff; border-radius: 50%; }
.wmap-unplaced { padding: 8px 10px; border-radius: 8px; background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.4); }
.wmap-unplaced form { margin-top: 6px; }
.wmap-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; }
.wmap-plan-size, .wmap-add, .wmap-save { display: flex; gap: 8px; align-items: flex-end; margin: 8px 0; flex-wrap: wrap; }
.wmap-plan-size label, .wmap-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--body-quiet-color); }
.wmap-plan-size input { width: 110px; }
.wmap-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 10px 0 6px; }
.wmap-fields .wide { grid-column: 1 / -1; }
.wmap-fields input, .wmap-fields select { width: 100%; box-sizing: border-box; }
#wmap-status.error { color: var(--error-fg); }
.rental-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.rental-filter input[type=search] { min-width: 340px; }
.rental-sum { margin-left: auto; color: var(--body-quiet-color); }
.rental-sum b { color: var(--body-loud-color); }
.rental-customer { background: #13161e; border: 1px solid var(--hairline-color); border-left: 5px solid; border-radius: 10px; padding: 10px 16px 6px;
                   margin-bottom: 14px; }
.rental-customer header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.rental-customer h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.rental-customer h2 i { width: 14px; height: 14px; border-radius: 4px; }
.rental-customer header span { color: var(--body-quiet-color); }
.rental-customer header span b { color: var(--body-loud-color); }
.rental-table { width: 100%; }
.rental-table td small { display: block; color: var(--body-quiet-color); }
.rental-table td:first-child { width: 120px; }
.rental-good { display: flex; gap: 10px; align-items: baseline; }
.rental-good span { flex: 1; }
.rental-good small { color: var(--body-quiet-color); }
.rental-bill { width: 100%; }
.rental-bill tr.done { opacity: 0.6; }
.rental-line { display: flex; gap: 16px; justify-content: space-between; padding: 2px 0; }
.rental-submit { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.rental-billing-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.help.warn { color: #fbbf24; }
@media (max-width: 1400px) { .wmap-body { grid-template-columns: 1fr; } .wmap-side { position: static; max-height: none; } }
.wmap-elsewhere { margin: 6px 0; padding-left: 18px; } .wmap-elsewhere li { margin: 4px 0; }

/* Kezdőlap – Bérraktározás fül (dashboard/data.py rental, charts.gauge / area_chart, rental/maps.mini_svg) */
.dash-card.full { grid-column: 1 / -1; }
.dash .good { color: #6ee7b7; }
.dash-sub { margin: 14px 0 8px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--body-quiet-color); }
.gauge { text-align: center; }
.gauge-svg { width: 100%; max-width: 280px; height: auto; display: block; margin: 0 auto; }
.gauge-track { fill: none; stroke: var(--hairline-color); stroke-width: 18; stroke-linecap: round; }
.gauge-fill { fill: none; stroke-width: 18; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.35)); }
.gauge-knob { stroke: #101319; stroke-width: 3; }
.gauge-value { fill: var(--body-loud-color); font-size: 34px; font-weight: 800; }
.gauge-caption { fill: var(--body-quiet-color); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.gauge-detail { margin: 2px 0 0; color: var(--body-quiet-color); font-size: 0.8rem; }
.chart-dot:hover { fill: rgba(255, 255, 255, 0.35); }
.chart-last { fill: var(--body-loud-color); font-size: 12px; font-weight: 700; }
.mini-maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 14px; }
.mini-map-card { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #13161e;
                 border: 1px solid var(--hairline-color); color: var(--body-fg); text-decoration: none; transition: border-color 0.15s; }
.mini-map-card:hover { border-color: var(--accent); }
.mini-map-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.85rem; }
.mini-map-head span { color: var(--body-quiet-color); }
.mini-map { width: 100%; height: auto; max-height: 300px; display: block; }
.mini-map .mm-floor { fill: #101d36; stroke: #4b6290; stroke-width: 0.15; }
.mini-map rect { stroke-width: 0.08; }
.mini-map .mm-rented { stroke: rgba(255, 255, 255, 0.5); fill-opacity: 0.85; }
.mini-map .mm-free { fill: #1e3a5f; stroke: #5b7fb8; stroke-dasharray: 0.3 0.2; }
.mini-map .mm-aisle { fill: rgba(148, 163, 184, 0.07); stroke: none; }
.mini-map .mm-door { fill: #fbbf24; }
.mini-map .mm-office, .mini-map .mm-other { fill: #334155; }
.mini-map .mm-wall, .mini-map .mm-column { fill: #94a3b8; }
.mini-map .mm-label { fill: #101319; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.mini-map .mm-free + .mm-label { fill: #c9ccd3; }
.mini-map-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.75rem; color: var(--body-quiet-color); }
.mini-map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.mini-map-legend b { color: var(--body-fg); }

/* Be- / kitárolás (body.wide-form.model-storagemovement): three sections in a row, labels above the inputs so pairs fit,
   the lines table at full width with fixed column widths. */
body.wide-form.model-storagemovement #content-main form > div > fieldset.module { grid-column: span 2; }
body.wide-form.model-storagemovement fieldset.module .form-row { padding: 6px 12px; }
body.wide-form.model-storagemovement fieldset.module .form-row > div:not(.form-multiline),
body.wide-form.model-storagemovement fieldset.module .fieldBox { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
body.wide-form.model-storagemovement fieldset.module .form-multiline { display: flex; flex-direction: row; gap: 14px; }
body.wide-form.model-storagemovement fieldset.module .form-multiline > div { flex: 1; min-width: 0; }
body.wide-form.model-storagemovement .aligned label { width: auto; min-width: 0; padding: 0; }
body.wide-form.model-storagemovement .form-row .fieldBox { min-width: 0; margin-right: 0; }
body.wide-form.model-storagemovement fieldset .vTextField, body.wide-form.model-storagemovement fieldset select,
body.wide-form.model-storagemovement fieldset textarea { width: 100%; max-width: none; box-sizing: border-box; }
body.wide-form.model-storagemovement fieldset .select2-container { width: 100% !important; }
body.wide-form.model-storagemovement #lines-group .column-block,
body.wide-form.model-storagemovement #lines-group .column-location { width: 13%; }
body.wide-form.model-storagemovement #lines-group .column-product { width: 26%; }
body.wide-form.model-storagemovement #lines-group .column-pallets { width: 6%; }
body.wide-form.model-storagemovement #lines-group .column-quantity { width: 9%; }
body.wide-form.model-storagemovement #lines-group .column-tracking_code { width: 11%; }
body.wide-form.model-storagemovement #lines-group .column-expiry_date { width: 10%; }
body.wide-form.model-storagemovement #lines-group td .select2-container { width: 100% !important; }
body.wide-form.model-storagemovement #lines-group td input[type=text], body.wide-form.model-storagemovement #lines-group td input[type=number] { width: 100%; box-sizing: border-box; }

/* Generálkivitelezés (construction): job, certificate, subcontract, order and diary forms. Sections three in a row with the
   labels above the inputs; on the job page the money overview and the related lists below at full width. */
body.wide-form.model-job fieldset.module .form-row, body.wide-form.model-certificate fieldset.module .form-row { padding: 6px 12px; }
body.wide-form.model-job fieldset.module .form-row > div:not(.form-multiline),
body.wide-form.model-job fieldset.module .fieldBox,
body.wide-form.model-certificate fieldset.module .form-row > div:not(.form-multiline),
body.wide-form.model-certificate fieldset.module .fieldBox { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
body.wide-form.model-job fieldset.module .form-multiline,
body.wide-form.model-certificate fieldset.module .form-multiline { display: flex; flex-direction: row; gap: 14px; }
body.wide-form.model-job fieldset.module .form-multiline > div,
body.wide-form.model-certificate fieldset.module .form-multiline > div { flex: 1; min-width: 0; }
body.wide-form.model-job .aligned label, body.wide-form.model-certificate .aligned label { width: auto; min-width: 0; padding: 0; }
body.wide-form.model-job fieldset.module .flex-container,
body.wide-form.model-certificate fieldset.module .flex-container { flex-direction: column; align-items: stretch; gap: 3px; }
body.wide-form.model-job fieldset.module .flex-container.checkbox-row,
body.wide-form.model-certificate fieldset.module .flex-container.checkbox-row { flex-direction: row; align-items: center; gap: 8px; }
body.wide-form.model-job #variations-group .column-description { width: 38%; }
body.wide-form.model-job #variations-group .column-amount { width: 14%; }
body.wide-form.model-job #variations-group td input[type=text] { width: 100%; box-sizing: border-box; }
body.wide-form.model-job .form-row .fieldBox, body.wide-form.model-certificate .form-row .fieldBox { min-width: 0; margin-right: 0; }
body.wide-form.model-job fieldset .vTextField, body.wide-form.model-job fieldset input[type=number], body.wide-form.model-job fieldset select,
body.wide-form.model-job fieldset textarea, body.wide-form.model-certificate fieldset .vTextField,
body.wide-form.model-certificate fieldset input[type=number], body.wide-form.model-certificate fieldset select,
body.wide-form.model-certificate fieldset textarea { width: 100%; max-width: none; box-sizing: border-box; }
body.wide-form.model-job fieldset .select2-container, body.wide-form.model-certificate fieldset .select2-container { width: 100% !important; }
body.wide-form.model-job #content-main form > div > fieldset.module.full,
body.wide-form.model-job #content-main form > div > fieldset.job-overview,
body.wide-form.model-job #content-main form > div > fieldset.job-list { grid-column: 1 / -1; }
@media (min-width: 1400px) {
    body.wide-form.model-job #content-main form > div > fieldset.job-list { grid-column: span 3; }
}
.job-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 12px; }
.job-kpi { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hairline-color); border-radius: 8px; padding: 10px 12px;
           display: flex; flex-direction: column; gap: 3px; }
.job-kpi > span:first-child { font-size: 0.72rem; color: var(--body-quiet-color); text-transform: uppercase; letter-spacing: 0.03em; }
.job-kpi b { font-size: 1.15rem; }
.job-kpi small { color: var(--body-quiet-color); }
.job-kpi.main { border-color: var(--primary); }
.job-kpi.good b { color: #4ade80; }
.job-kpi.bad b { color: #f87171; }
.job-list .stock-table { width: 100%; }
.job-list p { padding: 0 12px 8px; }
.job-site-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 0 !important; }
.job-site-actions .button, .job-asset-issue .button { padding: 8px 14px; border-radius: 6px; text-decoration: none; display: inline-block; }
.job-list > .help { padding: 4px 12px 8px; margin: 0; }
.job-sub { font-size: 0.78rem; text-transform: uppercase; color: var(--body-quiet-color); margin: 10px 12px 4px; }
.job-asset-issue { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.job-asset-issue select { flex: 2 1 280px; height: auto; }
.job-asset-issue input[type=text] { flex: 1 1 200px; }
.stock-table tr.muted td { opacity: 0.55; }
.calc-table td { padding: 2px 14px 2px 0; border: 0; }
/* Készletmérleg (templates/admin/inventory/stock_balance.html) */
.sb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.sb-kpi { position: relative; overflow: hidden; background: var(--card-bg); border: 1px solid var(--hairline-color); border-radius: 12px; padding: 12px 16px;
          color: var(--body-fg); display: flex; flex-direction: column; gap: 2px; }
.sb-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); }
.sb-kpi.bad::before { background: #f87171; } .sb-kpi.warn::before { background: #fbbf24; }
.sb-kpi span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--body-quiet-color); }
.sb-kpi b { font-size: 1.6rem; color: var(--body-loud-color); }
.sb-kpi.bad b { color: #f87171; } .sb-kpi.warn b { color: #fbbf24; }
.sb-kpi small { color: var(--body-quiet-color); font-size: 0.72rem; }
.sb-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 10px;
             background: var(--darkened-bg); border: 1px solid var(--hairline-color); }
.sb-filter label { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--body-quiet-color); }
.sb-filter select { height: auto; min-width: 200px; }
.sb-filter input[type=search] { min-width: 260px; }
.sb-filter .sb-check { flex-direction: row; align-items: center; gap: 6px; font-size: 0.85rem; padding-bottom: 8px; }
.sb-filter .sb-suggest { margin-left: auto; }
.sb-table td small.quiet { display: block; font-size: 0.72rem; color: var(--body-quiet-color); }
.sb-table td.num { white-space: nowrap; }
.sb-table tbody:not(.open) tr.sb-detail { display: none; }
.sb-group.open .stock-toggle .chevron { transform: rotate(90deg); }
.sb-group.open tr.sb-row td { background: var(--selected-row); }
.sb-res { color: #c4b5fd; font-weight: 600; } .sb-quote { color: #67e8f9; } .sb-in { color: #86efac; } .sb-order { color: #fbbf24; }
.sb-neg { color: #f87171 !important; font-weight: 700; }
.sb-state { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; border: 1px solid transparent; }
.sb-state.state-short { background: rgba(248, 113, 113, 0.15); color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }
.sb-state.state-low { background: rgba(251, 191, 36, 0.14); color: #fde68a; border-color: rgba(251, 191, 36, 0.35); }
.sb-state.state-quote { background: rgba(34, 211, 238, 0.12); color: #a5f3fc; border-color: rgba(34, 211, 238, 0.3); }
.sb-state.state-ok { background: rgba(52, 211, 153, 0.12); color: #86efac; border-color: rgba(52, 211, 153, 0.3); }
.sb-row.state-short td:nth-child(2) { box-shadow: inset 3px 0 0 #f87171; }
.sb-row.state-low td:nth-child(2) { box-shadow: inset 3px 0 0 #fbbf24; }
.sb-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; padding: 6px 0 4px; }
.sb-lists h4 { margin: 0 0 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--body-quiet-color); }
.sb-lists ul { margin: 0; padding-left: 16px; font-size: 0.82rem; }
.sb-lists li { margin-bottom: 3px; list-style: disc; }
.stock-table .reserved-note { font-size: 0.72rem; font-weight: 400; margin-top: 2px; color: #c4b5fd; }

/* Mennyiség-átváltó a bizonylatsorokon (static/js/line_quantities.js): "2 [doboz] → 4,262 m²", hints and whole-box rounding. */
.qty-convert { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; max-width: 230px; }
.qty-convert .qc-amount { width: 70px !important; min-width: 0; padding: 4px 6px; }
.qty-convert .qc-unit { height: auto; padding: 4px; max-width: 150px; font-size: 0.78rem; }
.qty-convert .qc-hint { flex-basis: 100%; font-size: 0.72rem; color: var(--body-quiet-color); line-height: 1.35; }
.qty-convert .qc-fix { color: #fbbf24; font-weight: 600; }
body.wide-form.model-product #content-main form > div > #conversions-group { grid-column: 1 / -1; }
#conversions-group td.field-quantity input, #conversions-group td.field-position input { width: 90px; }
#conversions-group td.field-barcode input { width: 160px; }
.stock-table .packaging { font-size: 0.72rem; font-weight: 400; margin-top: 2px; }
.tag-remnant { background: rgba(251, 146, 60, 0.18); color: #fdba74; border: 1px solid rgba(251, 146, 60, 0.4); }

/* Készletbeállítások (templates/admin/system/valuation.html): valuation | other settings side by side. */
.stock-settings { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.stock-settings-block { margin: 0; padding: 0 16px 12px; }
.stock-settings-block h2 { margin: 0 -16px 10px; }
.stock-settings-block .valuation-table { width: 100%; }
.feature-list { list-style: none; margin: 0 0 8px; padding: 0; }
.feature-list li { padding: 10px 0; border-bottom: 1px solid var(--hairline-color); list-style: none !important; }
.feature-list label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.95rem; }
.feature-list input[type=checkbox] { width: 18px; height: 18px; accent-color: #22c55e; }
.feature-list .help { margin: 4px 0 0 28px !important; padding: 0 !important; }
@media (max-width: 1200px) { .stock-settings { grid-template-columns: 1fr; } }

/* Csoport jogosultságai (templates/admin/auth/group/permission_matrix.html): one table per main menu. */
.perm-matrix-page #content-main { max-width: none; }
.pm-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 6px; }
.pm-members .help { display: block; margin: 2px 0 0; }
.pm-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pm-tools input[type=search] { min-width: 240px; }
.pm-tools .button { padding: 8px 12px; }
.pm-help { margin: 0 0 12px !important; }
.pm-matrix { display: flex; flex-direction: column; gap: 10px; }
.pm-app { border: 1px solid var(--hairline-color); border-radius: 10px; background: rgba(255, 255, 255, 0.02); overflow: hidden; }
.pm-app > summary { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; cursor: pointer;
                    background: rgba(255, 255, 255, 0.04); font-weight: 600; list-style: none; }
.pm-app > summary::-webkit-details-marker { display: none; }
.pm-app > summary::before { content: "▸"; margin-right: 10px; color: var(--body-quiet-color); }
.pm-app[open] > summary::before { content: "▾"; }
.pm-app-name { flex: 1; }
.pm-app-all { width: 20px; height: 20px; margin: 0 12px 0 0; cursor: pointer; accent-color: #22c55e; }
.pm-app-name small { font-weight: 400; color: var(--body-quiet-color); }
.pm-app-count { font-size: 0.8rem; color: var(--body-quiet-color); font-weight: 400; }
.pm-off { opacity: 0.75; }
.pm-table { width: 100%; border-collapse: collapse; }
.pm-table th, .pm-table td { padding: 8px 12px; border-bottom: 1px solid var(--hairline-color); vertical-align: middle; }
.pm-table th { text-align: center; font-size: 0.72rem; text-transform: none; color: var(--body-quiet-color); font-weight: 600; }
.pm-table th label { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.pm-table th.pm-col-name { text-align: left; }
.pm-table .pm-col-name { width: 30%; }
.pm-table td.pm-col-name { font-weight: 500; }
.pm-table .pm-col-extra { text-align: left; width: 26%; }
.pm-table .pm-col-row { width: 60px; }
.pm-table td.pm-cell { text-align: center; width: 9%; }
.pm-table input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: #22c55e; }
.pm-table tr[data-row]:hover td { background: rgba(255, 255, 255, 0.03); }
.pm-table tr.pm-other td.pm-col-name { font-weight: 400; color: var(--body-quiet-color); padding-left: 26px; }
.pm-table tr.pm-sub td { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--body-quiet-color);
                         background: rgba(255, 255, 255, 0.02); padding: 6px 12px; }
.pm-na { color: var(--body-quiet-color); opacity: 0.5; }
.pm-extra { display: inline-flex; align-items: center; gap: 6px; margin: 2px 12px 2px 0; font-size: 0.8rem; cursor: pointer; }

.pos-totals { display: flex; flex-wrap: wrap; gap: 22px; padding: 10px 14px; margin-bottom: 10px; border-radius: 8px;
              background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hairline-color); }
.calc-table td:last-child { text-align: right; }

/* Header info strip: name day, MNB EUR rate, weather (templates/admin/base_site.html, static/js/header_info.js) */
#branding { display: flex; align-items: center; gap: 22px; min-width: 0; }
.header-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--body-quiet-color); }
.header-info > span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
                      background: #161922; border: 1px solid var(--hairline-color); white-space: nowrap; }
.header-info b { color: var(--body-loud-color); font-weight: 600; }
.header-info .hi-label { color: var(--body-quiet-color); }
.header-info .hi-cur { color: #fbbf24; font-weight: 700; }
.header-info small { font-size: 0.68rem; letter-spacing: 0.4px; color: var(--body-quiet-color); }
.header-info .hi-place { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.header-info [hidden] { display: none; }
@media (max-width: 1280px) { .header-info .hi-label, .header-info .hi-place, .header-info small { display: none; } }
@media (max-width: 900px) { .header-info { display: none; } }

/* Login page background photo: static/img/login-hatter.jpg (glowing circuit board, Unsplash, Unsplash License), a dark wash over it
   so the form stays readable, and a frosted-glass form. */
body.login {
    background: linear-gradient(120deg, rgba(8, 14, 30, 0.88) 0%, rgba(8, 14, 30, 0.55) 45%, rgba(8, 14, 30, 0.35) 100%),
                url('../img/login-hatter.jpg?v=2') center / cover no-repeat fixed, #101319;
    min-height: 100vh;
}
.login #container {
    background: rgba(13, 22, 42, 0.78);
    border-color: rgba(124, 181, 255, 0.18);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.login #header { background: rgba(10, 18, 34, 0.6); }
.login-credit { position: fixed; right: 14px; bottom: 10px; margin: 0; font-size: 0.7rem; color: rgba(195, 206, 228, 0.55); }
.login-credit a { color: inherit; }

/* =====================================================================================================
 * Arculat (az MZS rendszer mintájára, sötét változat): antracit felületek, arany (#c7b000) kiemelés,
 * Inter betűtípus, sötét oldalsáv arany jelöléssel, modulfejléc arany ikonlappal és rombusz-motívummal,
 * arany árnyalatú táblázatfejlécek, szegmentált fülek. Ez a blokk a fájl végén áll, így felülírja a fentieket.
 * ===================================================================================================== */
html body { font-family: var(--font-family-primary); font-feature-settings: 'cv11', 'ss01'; }
.tabular, td.num, .num { font-variant-numeric: tabular-nums; }

/* Fejléc */
html body #header { background: var(--sidebar-bg); border-bottom: 1px solid var(--hairline-color);
    box-shadow: inset 0 -1px 0 rgba(199, 176, 0, 0.18); }
.brand-mark { background: var(--brand); color: #12141a; border-radius: 9px; box-shadow: 0 0 0 4px rgba(199, 176, 0, 0.15); }
#site-name a:link, #site-name a:visited { letter-spacing: -0.1px; }
#user-tools a:hover { color: var(--brand-bright); }
html body div.breadcrumbs { color: var(--body-quiet-color); }
html body div.breadcrumbs a { color: var(--body-medium-color); }
html body div.breadcrumbs a:hover { color: var(--brand-bright); }

/* Oldalsáv: sötét, a csoportcím ikonnal, az aktív menüpont arany csíkkal */
html body #nav-sidebar { background: var(--sidebar-bg); border-right: 1px solid var(--hairline-color); }
html body #nav-sidebar .module caption,
html body #nav-sidebar .module caption a.section { color: rgba(201, 204, 211, 0.6); font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.7px; text-transform: uppercase; }
html body #nav-sidebar .module caption a.section { display: inline-flex; align-items: center; gap: 8px; }
html body #nav-sidebar .current-app caption a.section { color: var(--brand-bright); }
.nav-icon { width: 15px; height: 15px; flex: none; opacity: 0.85; }
html body #nav-sidebar .current-app .nav-icon { color: var(--brand); opacity: 1; }
html body #nav-sidebar th a { color: #c9ccd3; }
html body #nav-sidebar tr:hover th a { color: #fff; }
html body #nav-sidebar .current-model { background: var(--sidebar-accent); box-shadow: inset 3px 0 0 var(--brand); }
html body #nav-sidebar .current-model th a { color: #fff; font-weight: 600; }
html body #nav-sidebar a.addlink { color: var(--brand); }
#nav-filter { background: #13161e; border-color: var(--hairline-color); }

/* Modulfejléc */
.module-head { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; min-height: 52px;
    margin: 0 0 18px; padding: 18px 22px; border-radius: 16px; background: #151821; border: 1px solid var(--hairline-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.module-head::before, .module-head::after { content: ''; position: absolute; pointer-events: none; transform: rotate(45deg);
    border: 14px solid rgba(199, 176, 0, 0.18); width: 120px; height: 120px; }
.module-head::before { top: -78px; right: 120px; }
.module-head::after { right: -64px; bottom: -86px; border-color: rgba(199, 176, 0, 0.09); width: 150px; height: 150px; }
.module-head .mh-icon { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 46px; height: 46px;
    border-radius: 12px; background: var(--brand); color: #12141a; box-shadow: 0 0 0 4px rgba(199, 176, 0, 0.15); }
.module-head .app-icon { width: 24px; height: 24px; }
.module-head .mh-text { position: relative; z-index: 1; min-width: 0; padding-right: 20px; }
html body #content .module-head h1 { margin: 0; padding: 0; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.2px; color: #fff; }
.module-head .mh-text p { margin: 2px 0 0; color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }
/* Az objektumeszközök (Történet, PDF, …) a modulfejléc jobb oldalán, áttetsző gombokként */
html body #content .object-tools { position: relative; z-index: 2; margin-top: -78px; margin-right: 20px; min-height: 60px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
html body #content .object-tools li { margin: 0; }
html body .object-tools a:link, html body .object-tools a:visited, html body .object-tools .object-tool-button {
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; border-radius: 10px;
    padding: 7px 14px; font-weight: 500; }
html body .object-tools a:hover, html body .object-tools .object-tool-button:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
html body .object-tools a.addlink, html body .object-tools a.default-tool { background: var(--brand); border-color: var(--brand); color: #12141a; }
html body .object-tools a.addlink:hover { background: #d8c21a; color: #12141a; }
html body .object-tools a.reverse-link:link, html body .object-tools a.reverse-link:visited { background: rgba(220, 38, 38, 0.85);
    border-color: transparent; }

/* Gombok: elsődleges arany sötét felirattal */
html body .button, html body input[type=submit], html body input[type=button], html body .submit-row input, html body a.button {
    border-radius: 10px; font-weight: 600; color: #12141a; }
html body .button.default, html body input[type=submit].default, html body .submit-row input.default { background: var(--brand);
    color: #12141a; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
html body .submit-row input:not(.default), html body .button:not(.default):not(.default-tool), html body a.button:not(.default) {
    background: #232833; color: #ecebe6; border: 1px solid #343a47; }
html body .submit-row input:not(.default):hover, html body .button:not(.default):hover, html body a.button:not(.default):hover {
    background: #2c313c; color: #fff; }
html body .submit-row a.deletelink, html body .submit-row input.reverse-confirm { background: var(--delete-button-bg); color: #fff; border: none; }
html body .submit-row { background: #151821; border: 1px solid var(--hairline-color); border-radius: 14px; }

/* Kártyák és táblázatok */
html body .module, html body fieldset.module, html body .inline-group, html body #changelist .changelist-form-container {
    border-radius: 14px; border-color: var(--hairline-color); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
html body .module h2, html body .module caption, html body .inline-group h2, html body fieldset .fieldset-heading {
    color: var(--table-head-fg); }
html body thead th, html body tfoot td, html body table.ts-table thead th, html body .stock-table thead th {
    background: var(--table-head-bg); color: var(--table-head-fg); border-bottom: 1px solid var(--brand-line); }
html body thead th a, html body thead th a:link, html body thead th a:visited { color: var(--table-head-fg); }
html body thead th.sorted { background: #35310f; }
html body #result_list tbody tr:hover, html body table tbody tr:hover > td { background: rgba(199, 176, 0, 0.05); }
html body #result_list tbody tr.selected { background: var(--selected-row); }
html body #result_list tbody a { color: #f1ebc4; font-weight: 500; }
html body #result_list tbody a:hover { color: var(--brand-bright); }
html body #changelist-filter { border-radius: 14px; }
html body #changelist-filter h2 { background: var(--table-head-bg); color: var(--table-head-fg); }
html body #changelist-filter li.selected a, html body #changelist-filter li.selected a:link { color: var(--brand-bright); }
html body .paginator .this-page { background: var(--brand); color: #12141a; border-radius: 6px; padding: 2px 8px; }

/* Szegmentált fülek (kezdőlap): sötét sáv, arany aktív fül */
html body .dash-tabs { display: inline-flex; gap: 2px; padding: 4px; border: none; border-radius: 12px; background: var(--sidebar-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--hairline-color); margin-bottom: 18px; }
html body .dash-tabs button { border: none; border-radius: 9px; padding: 7px 14px; color: rgba(255, 255, 255, 0.72); font-weight: 500; }
html body .dash-tabs button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
html body .dash-tabs button.active { background: var(--brand); color: #12141a; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }

/* Kezdőlap: arany rombuszos nyitósáv */
html body .dash-head { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 26px 28px; margin-bottom: 18px; border-radius: 18px; background: #151821; border: 1px solid var(--hairline-color); }
html body .dash-head::before, html body .dash-head::after { content: ''; position: absolute; pointer-events: none; transform: rotate(45deg);
    border: 18px solid rgba(199, 176, 0, 0.24); width: 200px; height: 200px; top: -110px; right: -20px; }
html body .dash-head::after { top: auto; bottom: -140px; right: -90px; border-color: rgba(199, 176, 0, 0.1); }
html body .dash-head h1 { position: relative; z-index: 1; font-size: 1.8rem; color: #fff; }
html body .dash-date { position: relative; z-index: 1; order: -1; color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }

/* KPI-csempék: arany oldalcsík */
html body .kpi { border-left: 4px solid var(--brand); border-radius: 14px; background: #151821; }
html body .kpi .kpi-value { font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
html body .dash-card { border-radius: 16px; }
html body .dash-card h2 { color: var(--table-head-fg); }

/* Űrlapmezők és üzenetek */
html body input[type=text], html body input[type=password], html body input[type=email], html body input[type=number],
html body input[type=search], html body input[type=url], html body input[type=tel], html body textarea, html body select, html body .vTextField {
    background: #12151c; border-color: #2c313c; border-radius: 10px; }
html body .select2-container--admin-autocomplete .select2-selection { background: #12151c; border-color: #2c313c; border-radius: 10px; }
html body ul.messagelist li { border-radius: 12px; border-left: 4px solid var(--brand); }
html body ul.messagelist li.success { border-left-color: #34d399; }
html body ul.messagelist li.warning { border-left-color: #fbbf24; }
html body ul.messagelist li.error { border-left-color: #f87171; }
html body #header #site-name a { color: #fff; }

/* Finom beúszás oldalbetöltéskor (csökkentett mozgásnál kikapcsolva) */
@keyframes oldal-be { from { opacity: 0; transform: translateY(6px); } }
html body #content { animation: oldal-be 0.28s ease-out both; }
@media (prefers-reduced-motion: reduce) { html body #content { animation: none; } }

html body #nav-sidebar .module { border: none; border-radius: 0; box-shadow: none; background: transparent; }
html body .kpi.good { border-left-color: #34d399; }
html body .kpi.bad { border-left-color: #f87171; }
html body .kpi.warn { border-left-color: #fbbf24; }
html body #content .module-head { justify-content: flex-start; }

/* Bejelentkezés: osztott képernyő (bal: fotó + szlogen arany rombusszal, jobb: sötét űrlappanel arany szegéllyel) */
html body.login { background: #12151c; }
.login-hero { position: fixed; inset: 0 46% 0 0; z-index: 0; display: flex; flex-direction: column; justify-content: space-between;
    padding: 44px 56px; overflow: hidden; color: #fff;
    background: linear-gradient(180deg, rgba(11, 13, 19, 0.82) 0%, rgba(11, 13, 19, 0.55) 45%, rgba(11, 13, 19, 0.92) 100%),
                url('../img/login-hatter.jpg?v=2') center / cover no-repeat, #0b0d13; }
.login-hero::before { content: ''; position: absolute; top: -140px; left: 18%; width: 380px; height: 380px; transform: rotate(45deg);
    border: 26px solid rgba(199, 176, 0, 0.32); pointer-events: none; }
.login-hero > * { position: relative; }
.lh-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 700; }
.lh-body h2 { margin: 0 0 12px; max-width: 560px; font-size: 2.1rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.4px;
    color: #fff; background: none; padding: 0; text-transform: none; border: none; }
.lh-body h2 span { color: var(--brand); }
.lh-body p { margin: 0 0 26px; color: rgba(255, 255, 255, 0.75); font-size: 1rem; }
.lh-points { display: flex; gap: 34px; margin: 0; padding: 0; list-style: none; }
.lh-points li { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 2px solid var(--brand); }
.lh-points b { font-size: 0.95rem; }
.lh-points small { color: rgba(255, 255, 255, 0.6); font-size: 0.78rem; }
.lh-foot { color: rgba(255, 255, 255, 0.5); font-size: 0.75rem; }
.lh-foot a { color: inherit !important; }
html body.login #container { position: fixed; top: 0; right: 0; bottom: 0; left: 54%; width: auto; max-width: none; margin: 0;
    display: flex; flex-direction: column; justify-content: center; padding: 0 7%; border: none; border-left: 4px solid var(--brand);
    border-radius: 0; background: #12151c; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html body.login #header { background: transparent; border: none; box-shadow: none; padding: 0 0 6px; }
html body.login #header #site-name a { font-size: 1.5rem; gap: 12px; }
html body.login #header #site-name a .brand-mark { display: none; }
html body.login #header #site-name a::after { content: none; }
html body.login #content { padding: 0; animation: none; }
html body.login #content-main::before { content: 'Jelentkezz be az adataiddal a folytatáshoz.'; display: block; margin: 0 0 22px;
    color: var(--body-quiet-color); font-size: 0.9rem; }
html body.login .form-row { padding: 0 0 14px; border: none; }
html body.login .form-row label { display: block; margin-bottom: 6px; color: var(--body-medium-color); font-weight: 600; font-size: 0.85rem; }
html body.login .form-row input { width: 100%; box-sizing: border-box; height: 42px; background: #0f1218; border: 1px solid #343a47; }
html body.login .form-row input:focus { border-color: var(--brand); }
html body.login .submit-row { background: transparent; border: none; padding: 8px 0 0; }
html body.login .submit-row input { width: 100%; height: 44px; background: var(--brand); color: #12141a; border: none; font-size: 0.95rem; }
html body.login .submit-row input:hover { background: #d8c21a; }
.login-credit { display: none; }
@media (max-width: 900px) {
    .login-hero { display: none; }
    html body.login #container { left: 0; border-left: none; padding: 0 8%; }
}
html body.login #main { flex: none; }
html body.login #header { justify-content: flex-start; }

/* Kiszállítás: Túratervező (templates/admin/delivery/planner.html) and proof of delivery images. */
.rp-day { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rp-day input[type=date] { min-height: 34px; }
.rp-dayname { margin-left: 8px; font-size: 1rem; text-transform: capitalize; }
.rp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.rp-waiting, .rp-route { margin: 0; padding: 0 14px 12px; }
.rp-waiting h2 { margin: 0 -14px 10px; }
.rp-waiting td small.quiet, .rp-stop-main small.quiet { display: block; font-size: 0.74rem; color: var(--body-quiet-color); }
.rp-draft { color: #fbbf24; }
.rp-warn { color: #fbbf24 !important; }
.rp-actions { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.rp-actions label, .rp-new { font-size: 0.8rem; color: var(--body-quiet-color); }
.rp-actions select, .rp-new select { height: auto; min-width: 180px; }
.rp-new { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border: 1px solid var(--hairline-color); border-radius: 10px; padding: 10px 12px; }
.rp-new legend { padding: 0 6px; }
.rp-routes { display: flex; flex-direction: column; gap: 14px; }
.rp-route > header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 -14px 8px; padding: 10px 14px;
                     border-bottom: 1px solid var(--hairline-color); background: var(--brand-soft, rgba(255,255,255,0.03)); }
.rp-route > header small.quiet { display: block; margin-top: 2px; }
.rp-tools, .rp-tools form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rp-tools .button { padding: 6px 10px; font-size: 0.78rem; }
.rp-danger { background: #3b1010 !important; color: #fca5a5 !important; }
.rp-stops { list-style: none; margin: 0; padding: 0; }
.rp-stops li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0;
               border-bottom: 1px solid var(--hairline-color); }
.rp-stops li:last-child { border-bottom: none; }
.rp-pos { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: 0.8rem;
          background: var(--brand, #c7b000); color: #12141a; }
.rp-stops li.st-delivered .rp-pos { background: #34d399; }
.rp-stops li.st-failed .rp-pos { background: #f87171; }
.rp-stop-tools { display: flex; gap: 4px; }
.rp-stop-tools button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--hairline-color); background: var(--darkened-bg);
                        color: var(--body-fg); cursor: pointer; }
.rp-stop-tools button:hover { border-color: var(--brand, #c7b000); }
.rp-pod { font-size: 0.78rem; }
.rp-empty { padding: 18px; color: var(--body-quiet-color); }
.pod-thumb { height: 34px; background: #fff; border-radius: 4px; }
.pod-image { max-width: 420px; max-height: 220px; background: #fff; border-radius: 8px; padding: 4px; }
@media (max-width: 1200px) { .rp-grid { grid-template-columns: 1fr; } }

/* Pénzügy → NAV-ból érkezett számlák */
.nav-box { padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; background: var(--darkened-bg); border: 1px solid var(--hairline-color); }
.nav-sync { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.nav-sync label { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--body-quiet-color); }
.nav-warn { color: #fde68a; margin: 0 0 6px; }

/* Pénzügy → Könyvelői export */
.ax-form { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 14px 16px; }
.ax-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--body-quiet-color); }
.ax-form select { height: auto; }
.ax-form .ax-check { flex-direction: row; align-items: center; gap: 6px; font-size: 0.85rem; padding-bottom: 8px; }
.ax-buttons { display: flex; gap: 8px; }
.ax-to { flex-basis: 100%; margin: 0 !important; }
.ax-h2 { margin: 22px 0 10px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--body-quiet-color); }

/* ===== AI asszisztens (assistant app; templates/admin/assistant/, static/js/assistant.js) ===== */
.ai-chat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.ai-side { background: var(--card-bg); border: 1px solid var(--hairline-color); border-radius: 12px; padding: 14px; position: sticky; top: 12px; }
.ai-side .ai-new { display: block; text-align: center; margin-bottom: 12px; }
.ai-side h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--body-quiet-color); margin: 14px 0 6px; }
.ai-links { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline-color); }
.ai-history { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.ai-history li { padding: 6px 8px; border-radius: 8px; margin: 0; list-style: none; }
.ai-history li.current { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.ai-history li a { display: block; color: var(--body-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-history small, .ai-muted { color: var(--body-quiet-color); }
.ai-delete { background: none; border: 0; color: #f87171; cursor: pointer; padding: 8px 0 0; font-size: 0.8rem; }
.ai-main { display: flex; flex-direction: column; min-height: 70vh; background: var(--card-bg); border: 1px solid var(--hairline-color); border-radius: 12px; padding: 16px; }
.ai-messages { flex: 1; overflow-y: auto; max-height: 64vh; display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 12px; }
.ai-msg { max-width: 88%; padding: 10px 14px; border-radius: 12px; line-height: 1.5; }
.ai-msg.ai-user { align-self: flex-end; background: var(--brand-soft); border: 1px solid var(--brand-line); }
.ai-msg.ai-assistant { align-self: flex-start; background: var(--body-bg); border: 1px solid var(--hairline-color); }
.ai-msg.ai-error, .ai-doc-answer.ai-error { border-color: #f87171; color: #fca5a5; }
.ai-body p { margin: 0 0 8px; padding: 0; } .ai-body p:last-child { margin-bottom: 0; }
.ai-body ul, .ai-body ol { margin: 4px 0 8px 18px; padding: 0; } .ai-body li { list-style: disc; margin: 2px 0; } .ai-body ol li { list-style: decimal; }
.ai-body h3, .ai-body h4 { margin: 10px 0 6px; color: var(--body-loud-color); font-size: 1rem; text-transform: none; letter-spacing: 0; background: none; padding: 0; }
.ai-body code { background: rgba(255,255,255,0.06); padding: 1px 4px; border-radius: 4px; }
.ai-table { border-collapse: collapse; margin: 6px 0; font-size: 0.85rem; }
.ai-table th, .ai-table td { border: 1px solid var(--hairline-color); padding: 4px 8px; text-align: left; }
.ai-tools { margin-top: 6px; font-size: 0.75rem; color: var(--body-quiet-color); }
.ai-typing { color: var(--body-quiet-color); font-style: italic; animation: ai-pulse 1.4s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: 0.4; } }
.ai-welcome { margin: auto; max-width: 720px; text-align: center; padding: 30px 10px; }
.ai-welcome h2 { background: none; color: var(--body-loud-color); font-size: 1.4rem; text-transform: none; letter-spacing: 0; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.ai-chip { background: var(--body-bg); border: 1px solid var(--brand-line); color: var(--body-fg); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.ai-chip:hover { border-color: var(--brand); color: var(--brand-bright); }
.ai-ask { display: flex; gap: 10px; align-items: stretch; border-top: 1px solid var(--hairline-color); padding-top: 12px; }
.ai-ask textarea { flex: 1; resize: vertical; min-height: 48px; }
.ai-note { font-size: 0.75rem; color: var(--body-quiet-color); margin: 8px 0 0; }
.ai-card { background: var(--card-bg); border: 1px solid var(--hairline-color); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.ai-card h2 { background: none; color: var(--body-loud-color); padding: 0; margin: 14px 0 8px; font-size: 1.05rem; text-transform: none; letter-spacing: 0; }
.ai-card h2:first-child { margin-top: 0; }
.ai-field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-weight: 600; }
.ai-field textarea, .ai-field input[type=text] { width: 100%; box-sizing: border-box; font-weight: 400; }
.ai-kinds { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ai-kinds legend { font-weight: 600; margin-bottom: 6px; }
.ai-radio { display: inline-flex; gap: 6px; align-items: center; background: var(--body-bg); border: 1px solid var(--hairline-color); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.ai-grid, .ai-partner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; align-items: end; }
.ai-partner { grid-template-columns: 1.2fr 1fr 1fr; }
.ai-grid label, .ai-partner label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.ai-grid select, .ai-partner select, .ai-lines select, .ai-draft-bar select { height: auto; }
.ai-read { color: var(--body-medium-color); }
.ai-totals { grid-column: 1 / -1; color: var(--body-medium-color); }
.ai-lines { width: 100%; border-collapse: collapse; }
.ai-lines th { background: var(--table-head-bg); color: var(--table-head-fg); padding: 6px 8px; text-align: left; }
.ai-lines td { padding: 6px 8px; border-bottom: 1px solid var(--hairline-color); vertical-align: top; }
.ai-lines td small { display: block; color: var(--body-quiet-color); }
.ai-lines input[type=text] { width: 100%; box-sizing: border-box; }
.ai-lines .ai-num { width: 90px; text-align: right; } .ai-lines .ai-short { width: 64px; }
.ai-lines select { max-width: 320px; }
.ai-history-cell { font-size: 0.8rem; color: var(--body-medium-color); min-width: 200px; }
.ai-up { color: #f87171; } .ai-down { color: #4ade80; }
.ai-actions { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.ai-status { padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); }
.ai-status-failed { background: rgba(248,113,113,0.15); color: #fca5a5; }
.ai-done { color: #4ade80; }
.ai-draft-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ai-draft-bar label { display: inline-flex; gap: 6px; align-items: center; }
.ai-wait { color: var(--body-quiet-color); font-style: italic; }
.ai-warning { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hairline-color);
              border-left: 3px solid #fbbf24; margin: 8px 0; background: var(--body-bg); }
.ai-warning.ai-bad { border-left-color: #f87171; }
.ai-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--brand-soft); color: var(--brand-bright);
          border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.ai-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ai-head-row h2 { margin: 0; }
.ai-doc-inner { padding: 10px 14px; }
.ai-doc-row { display: flex; gap: 10px; } .ai-doc-row input { flex: 1; }
.ai-doc-answer { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--hairline-color); border-radius: 10px; background: var(--body-bg); }
.ai-quotes { margin-top: 10px; }
.ai-quotes blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid var(--brand); color: var(--body-medium-color); }
.ai-link::before { content: "✦ "; color: var(--brand); }
#user-tools a.ai-header-link { color: var(--brand-bright); }
@media (max-width: 1024px) {
  .ai-chat-layout { grid-template-columns: 1fr; } .ai-side { position: static; }
  .ai-grid, .ai-partner { grid-template-columns: 1fr 1fr; }
}
.ai-page [hidden], .ai-doc-box [hidden] { display: none !important; }

/* ===== Hibabejelentő (bugreport app) ===== */
.bug-sev, .bug-status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.78rem; white-space: nowrap; background: rgba(255,255,255,0.06); }
.bug-sev-high { background: rgba(251,191,36,0.15); color: #fbbf24; }
.bug-sev-blocker { background: rgba(248,113,113,0.18); color: #fca5a5; font-weight: 600; }
.bug-status-new { background: var(--brand-soft); color: var(--brand-bright); }
.bug-status-in_progress, .bug-status-waiting { background: rgba(96,165,250,0.15); color: #93c5fd; }
.bug-status-resolved { background: rgba(74,222,128,0.15); color: #4ade80; }
.bug-status-rejected { color: var(--body-quiet-color); }
.model-bugreport #id_title, .model-bugreport textarea { width: min(900px, 100%); box-sizing: border-box; }
#user-tools a.bug-report-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--brand-bright); font-weight: 600; text-transform: none;
  letter-spacing: 0; font-size: 0.82rem; margin-right: 4px; white-space: nowrap; }
#user-tools a.bug-report-btn:hover { border-color: var(--brand); background: var(--brand); color: #111; }
@media (max-width: 1100px) { #user-tools a.bug-report-btn span { display: none; } #user-tools a.bug-report-btn { padding: 0 9px; } }
