/* Цветовете са от логото: тъмносиньо и ярко синьо върху бяло. */
@font-face { font-family: 'IZ Brand'; src: url("brand.618df5753e32.ttf") format('truetype'); font-weight: 700; font-display: swap; }

:root {
    --iz-blue: #0069ff;
    --iz-blue-dark: #0052cc;
    --iz-navy: #0a2253;
    --iz-line: #dfe9fb;
    --iz-soft: #f4f8ff;
    --iz-shadow: 0 2px 4px rgba(10, 34, 83, .05), 0 6px 18px rgba(0, 105, 255, .13);
    --iz-shadow-up: 0 4px 8px rgba(10, 34, 83, .08), 0 10px 26px rgba(0, 105, 255, .26);
    --bs-primary: #0069ff;
    --bs-primary-rgb: 0, 105, 255;
    --bs-link-color: #0059d9;
    --bs-link-color-rgb: 0, 89, 217;
    --bs-link-hover-color: #0a2253;
    --bs-link-hover-color-rgb: 10, 34, 83;
    --bs-body-color: #1b2b48;
    --bs-body-color-rgb: 27, 43, 72;
    --bs-border-color: #dfe6f2;
    --bs-border-radius: .6rem;
    --bs-border-radius-sm: .5rem;
    --bs-border-radius-lg: .8rem;
}
body { background: #fff linear-gradient(#f4f8ff, #fff 420px) no-repeat; min-height: 100vh; }
h1, h2, h3, h4, h5, h6 { color: var(--iz-navy); }
h3 { font-weight: 700; letter-spacing: -.01em; }

/* --- горна лента --- */
.iz-nav { background: #fff; border-bottom: 1px solid var(--iz-line); box-shadow: 0 4px 20px rgba(0, 105, 255, .08); padding: .5rem 0 .7rem; flex-wrap: wrap; }
.iz-nav.navbar-expand-lg { flex-wrap: wrap; }
.iz-nav > .container-fluid { flex-wrap: wrap; }
.iz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.iz-top .navbar-brand { padding: .15rem 0; margin: 0; }
.iz-top .navbar-brand { display: flex; flex-direction: column; min-width: 0; }
.iz-top .navbar-brand img { height: 40px; width: auto; display: block; align-self: flex-start; }
.iz-client { font: 700 1.05rem/1.2 'IZ Brand', system-ui, sans-serif; color: var(--iz-navy); margin-top: 4px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iz-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.iz-tool { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid transparent; color: var(--iz-navy); }
.iz-tool:hover { background: var(--iz-soft); border-color: var(--iz-line); color: var(--iz-blue); }
.iz-user { color: #5a6b8c; padding: 0 6px; white-space: nowrap; }
.iz-nav .navbar-toggler { border: 1px solid var(--iz-line); border-radius: 12px; padding: .3rem .6rem; font-size: 1.4rem; line-height: 1; color: var(--iz-navy); box-shadow: var(--iz-shadow); }
.iz-sections { display: flex; flex-wrap: wrap; gap: 8px; padding-top: .55rem; }
.iz-sections .nav-link {
    display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--iz-line); border-radius: 13px;
    padding: .46rem .85rem !important; color: var(--iz-navy); font-weight: 500; box-shadow: var(--iz-shadow);
    transition: transform .14s, box-shadow .14s, color .14s, border-color .14s;
}
.iz-sections .nav-link > .bi { color: var(--iz-blue); font-size: 1.05rem; line-height: 1; }
.iz-sections .nav-link:hover, .iz-sections .nav-link:focus-visible, .iz-sections .nav-link.show { color: var(--iz-blue); border-color: #a9cbff; box-shadow: var(--iz-shadow-up); transform: translateY(-2px); }
.iz-sections .nav-link.active { color: #fff; background: linear-gradient(135deg, #1a7bff, #0052cc); border-color: transparent; box-shadow: 0 6px 18px rgba(0, 105, 255, .38); }
.iz-sections .nav-link.active > .bi { color: #fff; }
.dropdown-menu { border: 1px solid var(--iz-line); border-radius: 14px; box-shadow: 0 12px 34px rgba(10, 34, 83, .16); padding: .45rem; }
.iz-sections .dropdown-menu { margin-top: .45rem !important; }
.dropdown-item { border-radius: 9px; padding: .42rem .75rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--iz-soft); color: var(--iz-blue); }
.dropdown-item.active, .dropdown-item:active { background: var(--iz-blue); color: #fff; }
@media (min-width: 992px) and (max-width: 1499.98px) {
    .iz-sections { gap: 6px; }
    .iz-sections .nav-link { padding: .4rem .58rem !important; gap: 5px; font-size: .93rem; }
}
@media (max-width: 991.98px) {
    .iz-sections { display: grid; grid-template-columns: 1fr 1fr; padding-top: .8rem; }
    .iz-sections .nav-item { min-width: 0; }
    .iz-sections .nav-item.dropdown:has(.dropdown-menu.show) { grid-column: 1 / -1; }
    .iz-account { border-top: 1px solid var(--iz-line); margin-top: .8rem; }
    .iz-account .nav-item:last-child { grid-column: 1 / -1; }
}
@media (max-width: 420px) { .iz-top .navbar-brand img { height: 32px; } .iz-client { font-size: .92rem; } }

/* --- карти и плочки --- */
.card { border: 1px solid var(--iz-line); border-radius: 16px; box-shadow: var(--iz-shadow); background: #fff; }
.card > .table-responsive:first-child { border-top-left-radius: 15px; border-top-right-radius: 15px; }
.card > .table-responsive:last-child { border-bottom-left-radius: 15px; border-bottom-right-radius: 15px; }
.card.border-4 { border-width: 1px 1px 1px 4px !important; }
.tile { display: flex; align-items: center; gap: 14px; height: 100%; padding: 16px 18px; background: #fff; border: 1px solid var(--iz-line); border-radius: 16px; box-shadow: var(--iz-shadow); color: inherit; text-decoration: none; transition: transform .14s, box-shadow .14s, border-color .14s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--iz-shadow-up); border-color: #a9cbff; color: inherit; }
.tile > .bi { flex: 0 0 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 14px; font-size: 1.45rem; color: #fff; background: linear-gradient(135deg, #1a7bff, #0a2253); box-shadow: 0 6px 14px rgba(0, 105, 255, .3); }
.tile .value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: var(--iz-navy); }

/* --- бутони и полета --- */
.btn { border-radius: 11px; font-weight: 500; }
.btn-sm { border-radius: 9px; }
.btn-lg { border-radius: 13px; }
.btn-primary { --bs-btn-bg: #0069ff; --bs-btn-border-color: #0069ff; --bs-btn-hover-bg: #0059d9; --bs-btn-hover-border-color: #0059d9; --bs-btn-active-bg: #0052cc; --bs-btn-active-border-color: #0052cc; --bs-btn-disabled-bg: #7fb3ff; --bs-btn-disabled-border-color: #7fb3ff; --bs-btn-focus-shadow-rgb: 0, 105, 255; box-shadow: 0 4px 12px rgba(0, 105, 255, .28); }
.btn-outline-primary { --bs-btn-color: #0059d9; --bs-btn-border-color: #bcd6ff; --bs-btn-hover-bg: #0069ff; --bs-btn-hover-border-color: #0069ff; --bs-btn-active-bg: #0052cc; --bs-btn-active-border-color: #0052cc; --bs-btn-focus-shadow-rgb: 0, 105, 255; background-color: #fff; box-shadow: 0 2px 8px rgba(0, 105, 255, .1); }
.btn-outline-primary:hover, .btn-outline-primary.active { background-color: var(--bs-btn-hover-bg); }
.btn-outline-secondary { --bs-btn-color: #4b5b7a; --bs-btn-border-color: #d5deec; --bs-btn-hover-bg: #0a2253; --bs-btn-hover-border-color: #0a2253; background-color: #fff; }
.btn-outline-secondary:hover { background-color: var(--bs-btn-hover-bg); }
.input-group > .btn { box-shadow: none; }
.form-control, .form-select { border-color: #d5deec; border-radius: 11px; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #7fb3ff; box-shadow: 0 0 0 .2rem rgba(0, 105, 255, .16); }
.form-check-input:checked { background-color: var(--iz-blue); border-color: var(--iz-blue); }
.form-label { font-weight: 500; color: #3a4b6b; }
.form-label:not(:has(+ .form-check-input)) { display: block; }
.form-label + .form-check-input { margin-left: .5rem; }
.select2-container--default .select2-selection--single { height: 38px; border-color: #d5deec; border-radius: 11px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; padding-left: 12px; color: inherit; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; right: 6px; }
.select2-container--default.select2-container--focus .select2-selection--single, .select2-container--default.select2-container--open .select2-selection--single { border-color: #7fb3ff; }
.select2-dropdown { border-color: var(--iz-line); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 34px rgba(10, 34, 83, .16); }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--iz-blue); }
.select2-container--default .select2-search--dropdown .select2-search__field { border-color: #d5deec; border-radius: 9px; padding: 6px 10px; }

/* --- таблици, табове, съобщения --- */
.table { --bs-table-hover-bg: #f4f8ff; --bs-table-border-color: #e6edf8; }
.table > thead th { background: #f4f8ff; color: #3a4b6b; font-weight: 600; border-bottom: 1px solid var(--iz-line); }
.table > :not(caption) > * > * { padding: .6rem .7rem; }
.nav-tabs { border-bottom: 0; gap: 8px; flex-wrap: wrap; }
.nav-tabs .nav-link { background: #fff; border: 1px solid var(--iz-line); border-radius: 12px; color: var(--iz-navy); box-shadow: var(--iz-shadow); }
.nav-tabs .nav-link:hover { color: var(--iz-blue); border-color: #a9cbff; }
.nav-tabs .nav-link.active { background: linear-gradient(135deg, #1a7bff, #0052cc); border-color: transparent; color: #fff; }
.badge { border-radius: 8px; font-weight: 600; }
.alert { border-radius: 14px; }
.page-link { border-color: var(--iz-line); }
.page-item:first-child .page-link, .page-item:last-child .page-link { border-radius: 10px; }
.active > .page-link { background: var(--iz-blue); border-color: var(--iz-blue); }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(10, 34, 83, .28); }

/* --- редове на документ --- */
.formset-row .form-control, .formset-row .form-select { padding-left: .5rem; padding-right: .35rem; }
.formset-row .form-select { padding-right: 1.5rem; background-position: right .4rem center; min-width: 78px; }
.formset-row input.form-control { min-width: 62px; }
.formset-row input[type=number]::-webkit-inner-spin-button { margin-left: 0; }

/* --- + до поле --- */
.quick-holder { display: flex; align-items: flex-start; gap: 6px; }
.quick-inner { flex: 1 1 auto; min-width: 0; }
.quick-plus { flex: 0 0 38px; height: 38px; padding: 0; font-size: 1.25rem; line-height: 1; }

/* --- дърво с категории --- */
.cat-tree { font-size: .95rem; }
.cat-tree .cat-search { margin-bottom: .6rem; }
.cat-tree a { display: flex; justify-content: space-between; gap: 8px; padding: .32rem .6rem; border-radius: 9px; color: var(--iz-navy); text-decoration: none; overflow-wrap: anywhere; }
.cat-tree a:hover { background: var(--iz-soft); color: var(--iz-blue); }
.cat-tree a.active { background: linear-gradient(135deg, #1a7bff, #0052cc); color: #fff; }
.cat-tree a .count { color: #7c8aa5; font-size: .85em; flex: none; white-space: nowrap; }
.cat-tree a.active .count { color: #dce9ff; }
.cat-tree summary { display: flex; align-items: center; list-style: none; cursor: pointer; }
.cat-tree summary::-webkit-details-marker { display: none; }
.cat-tree summary::before { content: "\203A"; flex: 0 0 20px; text-align: center; font-size: 1.25rem; line-height: 1; color: var(--iz-blue); transition: transform .12s; }
.cat-tree details[open] > summary::before { transform: rotate(90deg); }
.cat-tree summary > a { flex: 1; }
.cat-tree div.cat-node { padding-left: 20px; display: flex; align-items: center; }
.cat-tree div.cat-node > a { flex: 1; min-width: 0; }
.cat-tree summary > a { min-width: 0; }
.cat-edit { flex: 0 0 auto; border: 0; background: none; color: #9db0d0; padding: .3rem .45rem; border-radius: 9px; line-height: 1; }
.cat-edit:hover, .cat-edit:focus-visible { color: var(--iz-blue); background: var(--iz-soft); }
.cat-tree .cat-children { margin-left: 10px; border-left: 1px solid var(--iz-line); }
.cat-tree [hidden] { display: none !important; }
.cat-panel { position: sticky; top: 12px; }
@media (min-width: 1200px) { .cat-panel .cat-scroll { max-height: calc(100vh - 170px); overflow: auto; } }
.bulk-bar { position: sticky; bottom: 12px; z-index: 20; margin-top: 12px; border-color: #a9cbff; box-shadow: var(--iz-shadow-up); }

/* --- инфо --- */
.info-page { max-width: 1180px; }
.info-page h5 { display: flex; align-items: center; gap: 10px; margin-bottom: .8rem; }
.info-page h5 .bi { color: var(--iz-blue); font-size: 1.3rem; }
.info-page li { margin-bottom: .3rem; }

/* --- вход --- */
.login-box { max-width: 420px; margin: 4vh auto 0; text-align: center; }
.login-box form { text-align: left; }
.login-logo { width: 220px; max-width: 60%; margin-bottom: 2rem; }
.login-logo:has(+ .login-client) { margin-bottom: 1.1rem; }
.login-client { display: inline-block; margin-bottom: 1.8rem; padding: .45rem 1.5rem; border-radius: 14px; color: #fff; background: linear-gradient(180deg, #1a7bff, #0052cc); box-shadow: 0 6px 18px rgba(0, 105, 255, .3); font: 700 1.35rem/1.25 'IZ Brand', system-ui, sans-serif; max-width: 100%; overflow-wrap: anywhere; }

/* --- долна лента --- */
.iz-footer { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: center; padding: 14px 16px max(18px, env(safe-area-inset-bottom)); margin-top: 1rem; border-top: 1px solid var(--iz-line); color: #5a6b8c; font-size: .85rem; text-align: center; }
.iz-footer span { white-space: nowrap; }
.iz-footer strong { color: var(--iz-navy); }
.iz-footer img { margin-right: 4px; }
@media (max-width: 480px) { .iz-footer img { flex-basis: 100%; height: 24px; object-fit: contain; margin: 0; } }
@media print { .iz-footer { display: none; } }

/* Камера за баркодове върху целия екран */
body.clima-scan-open { overflow: hidden; }
.clima-scan { position: fixed; inset: 0; z-index: 3000; background: #000; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.clima-scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clima-scan .frame { position: absolute; left: 8%; right: 8%; top: 50%; height: 34vh; max-height: 260px; transform: translateY(-60%); border: 3px solid rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); pointer-events: none; }
.clima-scan .top, .clima-scan .bottom { position: relative; padding: 12px 16px; background: rgba(0, 0, 0, .55); }
.clima-scan .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: max(12px, env(safe-area-inset-top)); }
.clima-scan .bottom { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.clima-scan .title { font-weight: 600; }
.clima-scan .message { min-height: 1.6em; font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
.clima-scan .message.good { color: #7dffa8; }
.clima-scan .message.bad { color: #ffb0a8; }
.clima-scan .tools { display: flex; gap: 8px; margin-top: 8px; }
.clima-scan .question:not(:empty) { margin-top: 8px; }
.clima-scan-sheet { position: fixed; inset: 0; z-index: 3100; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.clima-scan-sheet .card { width: 100%; max-width: 520px; max-height: 85vh; overflow: auto; color: #212529; }
.iz-label-list .btn { white-space: normal; }
.iz-label-list .btn:hover .badge { background: #fff !important; color: #198754; }
.clima-scan-bar { max-width: 460px; }

/* Бързо сканиране */
.scan-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #e9ecef; }
.scan-line .name { flex: 1 1 200px; }
.scan-line .amount { display: flex; align-items: center; gap: 4px; }
.scan-line .amount input { width: 84px; text-align: center; }
.scan-line .amount button { width: 42px; height: 42px; font-size: 1.3rem; line-height: 1; padding: 0; }
