:root {
/* Ïåðåìåííûå äëÿ ñâåòëîé òåìû (ïî óìîë÷àíèþ) */
--primary-color: #007bff;
--font-color: #333333;
--bg-color:  #F9F9F9;
--heading-color: #222222;
--secondary-bg: #f8f9fa;
--border-color: #dee2e6;
--otchetobotgr:#A8CABF;
--btn-primary:#2f7df6;
--doljen:#ebcac0;
--nedoljenzel:#bbddc0;
--jeltnovyi:#ded4b6;
--btn-danger2:#b56f52;
}

/* Ïåðåìåííûå äëÿ òåìíîé òåìû */
[data-theme="dark"] {
--primary-color: #0d6efd;
--font-color: #e1e1e1;
--bg-color:  #252526;
--heading-color: #f8f8f8;
--secondary-bg: #1f1f1f;
--border-color: #444444;
--otchetobotgr:#2A3D33;
--btn-primary:#7A8B7A;
--doljen:#5c3a32;
--nedoljenzel:#385c48;
--jeltnovyi:#5c5438;
--btn-danger2:#8B8275;
}

body {
background-color: var(--bg-color) !important;
color: var(--font-color) !important;
font-family: 'Arial', sans-serif;
transition: all 0.3s ease;
margin: 0;
padding: 0;
}

.main-panel,
.content,
.page-inner {
background-color: var(--bg-color) !important;
}

.main-header .navbar.border-bottom {
border-bottom-color: transparent !important;
}
.otchetobotgr{background-color: var(--otchetobotgr) !important;}
.card-title, .contr{color: var(--font-color) !important;}
.btn-primary2{background-color: var(--btn-primary) !important; border-color: var(--btn-primary) !important; color:#ffffff}
.btn-danger2{background-color: var(--btn-danger2) !important; color:#ffffff}
.doljen{background-color: var(--doljen) !important; color:var(--font-color) !important;}
.nedoljenzel{background-color: var(--nedoljenzel) !important; color:var(--font-color) !important;}
.jeltnovyi{background-color: var(--jeltnovyi) !important; color:var(--font-color) !important;}
header {
background-color: var(--secondary-bg);
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--border-color);
}

h1 {
color: var(--heading-color);
margin: 0;
}

main {
padding: 20px;
max-width: 1200px;
margin: 0 auto;
}

/* Ñòèëè äëÿ ïåðåêëþ÷àòåëÿ */
.theme-switch-wrapper {
display: flex;
align-items: center;
}

.theme-switch {
display: inline-block;
position: relative;
width: 60px;
height: 34px;
margin: 0 10px;
}

.theme-switch input {
opacity: 0;
width: 0;
height: 0;
}

.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
}

.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
}

input:checked + .slider {
background-color: var(--primary-color);
}

input:checked + .slider:before {
transform: translateX(26px);
}

.slider.round {
border-radius: 34px;
}

.slider.round:before {
border-radius: 50%;
}


/* Full dark theme coverage */
[data-theme="dark"] .main-panel,
[data-theme="dark"] .content,
[data-theme="dark"] .page-inner,
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu {
background-color: #1e2127 !important;
color: var(--font-color) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .table,
[data-theme="dark"] .table td,
[data-theme="dark"] .table th,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-group-default {
border-color: #3b3f48 !important;
}

[data-theme="dark"] .navbar-header,
[data-theme="dark"] .main-header,
[data-theme="dark"] .logo-header,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .sidebar-logo {
background-color: #171a1f !important;
}

[data-theme="dark"] .nav-item a,
[data-theme="dark"] .navbar-nav a,
[data-theme="dark"] .dropdown-item,
[data-theme="dark"] .table,
[data-theme="dark"] .table td,
[data-theme="dark"] .table th,
[data-theme="dark"] label,
[data-theme="dark"] p,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
color: #e6eaf0 !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea,
[data-theme="dark"] input {
background-color: #13161b !important;
color: #e6eaf0 !important;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] textarea::placeholder {
color: #9aa3b2 !important;
}

[data-theme="dark"] .form-group-default {
background-color: #1a1e25 !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
background-color: #20242c !important;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
background-color: #2a303a !important;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary2 {
background-color: #2f7df6 !important;
border-color: #2f7df6 !important;
}

[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-danger2 {
background-color: #9b6a57 !important;
border-color: #9b6a57 !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
background-color: #13161b !important;
color: #e6eaf0 !important;
border: 1px solid #3b3f48 !important;
}

[data-theme="dark"] a {
color: #7db2ff;
}

/* Fix: contractor check table in dark theme */
[data-theme="dark"] #multi-filter-select thead th,
[data-theme="dark"] table.dataTable thead th,
[data-theme="dark"] table.dataTable thead td {
background-color: #151920 !important;
color: #e6eaf0 !important;
border-color: #3b3f48 !important;
}

/* Keep saldo colors from PHP classes even in dark mode */
[data-theme="dark"] #multi-filter-select td.doljen,
[data-theme="dark"] #multi-filter-select td.nedoljenzel,
[data-theme="dark"] #multi-filter-select td.jeltnovyi {
color: #e6eaf0 !important;
}

[data-theme="dark"] #multi-filter-select td.doljen {
background-color: var(--doljen) !important;
}

[data-theme="dark"] #multi-filter-select td.nedoljenzel {
background-color: var(--nedoljenzel) !important;
}

[data-theme="dark"] #multi-filter-select td.jeltnovyi {
background-color: var(--jeltnovyi) !important;
}

/* Disable zebra overlay for status-colored rows */
[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.doljen,
[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.nedoljenzel,
[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.jeltnovyi {
background-color: inherit !important;
}

[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.doljen,
[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.doljen {
background-color: var(--doljen) !important;
}

[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.nedoljenzel,
[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.nedoljenzel {
background-color: var(--nedoljenzel) !important;
}

[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.jeltnovyi,
[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.jeltnovyi {
background-color: var(--jeltnovyi) !important;
}

/* Higher-contrast status palette for dark theme */
[data-theme="dark"] {
--doljen: #7a2f2f;
--nedoljenzel: #1f5e3b;
--jeltnovyi: #6a5a1f;
}

[data-theme="dark"] #multi-filter-select td.doljen,
[data-theme="dark"] #multi-filter-select td.nedoljenzel,
[data-theme="dark"] #multi-filter-select td.jeltnovyi {
color: #f5f7fb !important;
font-weight: 600;
}

/* Higher-contrast status palette for light theme */
:root {
--doljen: #e6b8ad;
--nedoljenzel: #a9dcb6;
--jeltnovyi: #e7dbad;
}

#multi-filter-select td.doljen,
#multi-filter-select td.nedoljenzel,
#multi-filter-select td.jeltnovyi {
color: #1d232f !important;
font-weight: 600;
}

/* Dark mode: explicit status colors for contractor table */
[data-theme="dark"] #multi-filter-select td.doljen {
background-color: #6f2d2d !important;
color: #f4f7fb !important;
}
[data-theme="dark"] #multi-filter-select td.nedoljenzel {
background-color: #1f5a3a !important;
color: #f4f7fb !important;
}
[data-theme="dark"] #multi-filter-select td.jeltnovyi {
background-color: #66571f !important;
color: #f4f7fb !important;
}

/* Dark mode: edit contractor modal content */
[data-theme="dark"] #editContractorModal .modal-content {
background-color: #161a21 !important;
color: #e6eaf0 !important;
border: 1px solid #3b3f48 !important;
}
[data-theme="dark"] #editContractorModal .modal-header,
[data-theme="dark"] #editContractorModal .modal-footer {
border-color: #3b3f48 !important;
}
[data-theme="dark"] #editContractorModal .btn-close {
filter: invert(1) grayscale(1);
}
[data-theme="dark"] #editContractorModal table,
[data-theme="dark"] #editContractorModal td,
[data-theme="dark"] #editContractorModal th {
color: #e6eaf0 !important;
border-color: #3b3f48 !important;
}
[data-theme="dark"] #editContractorModal tr[bgcolor="#FFFFFF"],
[data-theme="dark"] #editContractorModal td[bgcolor="#FFFFFF"],
[data-theme="dark"] #editContractorModal th[bgcolor="#FFFFFF"] {
background-color: #1e232c !important;
}
[data-theme="dark"] #editContractorModal .Text-osnform,
[data-theme="dark"] #editContractorModal input[type="text"],
[data-theme="dark"] #editContractorModal textarea,
[data-theme="dark"] #editContractorModal select {
background-color: #11151b !important;
color: #e6eaf0 !important;
border: 1px solid #3b3f48 !important;
}
[data-theme="dark"] #editContractorModal h2,
[data-theme="dark"] #editContractorModal h4,
[data-theme="dark"] #editContractorModal strong,
[data-theme="dark"] #editContractorModal b {
color: #e6eaf0 !important;
}
[data-theme="dark"] #editContractorModal .table-striped > tbody > tr:nth-of-type(odd) > * {
background-color: #1c212a !important;
}
[data-theme="dark"] #editContractorModal .table-hover > tbody > tr:hover > * {
background-color: #252b35 !important;
}

/* Strong override: any table inside contractor edit modal */
[data-theme="dark"] #editContractorModal table tr,
[data-theme="dark"] #editContractorModal table td,
[data-theme="dark"] #editContractorModal table th,
[data-theme="dark"] #editContractorModal table tbody tr,
[data-theme="dark"] #editContractorModal table tbody td,
[data-theme="dark"] #editContractorModal table thead th {
background: #1b2028 !important;
color: #edf1f7 !important;
}

[data-theme="dark"] #editContractorModal table tr:nth-child(even) td,
[data-theme="dark"] #editContractorModal table tr:nth-child(even) th {
background: #202631 !important;
}

[data-theme="dark"] #editContractorModal table tr:hover td,
[data-theme="dark"] #editContractorModal table tr:hover th {
background: #28303d !important;
}

[data-theme="dark"] #editContractorModal .card-title,
[data-theme="dark"] #editContractorModal .Text-osn,
[data-theme="dark"] #editContractorModal .Text-osnform {
color: #edf1f7 !important;
}

/* Final status palette split for contractor check table */
html[data-theme="light"] #multi-filter-select td.doljen {
background-color: #e6b8ad !important;
color: #1d232f !important;
}
html[data-theme="light"] #multi-filter-select td.nedoljenzel {
background-color: #a9dcb6 !important;
color: #1d232f !important;
}
html[data-theme="light"] #multi-filter-select td.jeltnovyi {
background-color: #e7dbad !important;
color: #1d232f !important;
}

html[data-theme="dark"] #multi-filter-select td.doljen {
background-color: #6f2d2d !important;
color: #f4f7fb !important;
}
html[data-theme="dark"] #multi-filter-select td.nedoljenzel {
background-color: #1f5a3a !important;
color: #f4f7fb !important;
}
html[data-theme="dark"] #multi-filter-select td.jeltnovyi {
background-color: #66571f !important;
color: #f4f7fb !important;
}

html[data-theme="light"] #multi-filter-select td.doljen,
html[data-theme="light"] #multi-filter-select td.nedoljenzel,
html[data-theme="light"] #multi-filter-select td.jeltnovyi,
html[data-theme="dark"] #multi-filter-select td.doljen,
html[data-theme="dark"] #multi-filter-select td.nedoljenzel,
html[data-theme="dark"] #multi-filter-select td.jeltnovyi {
font-weight: 600 !important;
}

/* ===== Contractor table hard reset by theme (final override) ===== */
html[data-theme="light"] #multi-filter-select tbody td {
color: #1d232f !important;
}
html[data-theme="dark"] #multi-filter-select tbody td {
color: #f4f7fb !important;
}

/* neutralize generic zebra/hover for status cells */
html[data-theme="light"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.doljen,
html[data-theme="light"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.doljen,
html[data-theme="light"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.nedoljenzel,
html[data-theme="light"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.nedoljenzel,
html[data-theme="light"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.jeltnovyi,
html[data-theme="light"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.jeltnovyi,
html[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.doljen,
html[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.doljen,
html[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.nedoljenzel,
html[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.nedoljenzel,
html[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(odd) > td.jeltnovyi,
html[data-theme="dark"] #multi-filter-select.table-striped > tbody > tr:nth-of-type(even) > td.jeltnovyi {
background-image: none !important;
}

/* light theme status palette */
html[data-theme="light"] #multi-filter-select td.doljen { background-color: #efc7be !important; color: #2b1a18 !important; }
html[data-theme="light"] #multi-filter-select td.nedoljenzel { background-color: #b9e7c3 !important; color: #13271a !important; }
html[data-theme="light"] #multi-filter-select td.jeltnovyi { background-color: #efe1ad !important; color: #2b2613 !important; }

/* dark theme status palette */
html[data-theme="dark"] #multi-filter-select td.doljen { background-color: #6f2d2d !important; color: #f6f7fb !important; }
html[data-theme="dark"] #multi-filter-select td.nedoljenzel { background-color: #1f5a3a !important; color: #f6f7fb !important; }
html[data-theme="dark"] #multi-filter-select td.jeltnovyi { background-color: #66571f !important; color: #f6f7fb !important; }

html[data-theme="light"] #multi-filter-select td.doljen,
html[data-theme="light"] #multi-filter-select td.nedoljenzel,
html[data-theme="light"] #multi-filter-select td.jeltnovyi,
html[data-theme="dark"] #multi-filter-select td.doljen,
html[data-theme="dark"] #multi-filter-select td.nedoljenzel,
html[data-theme="dark"] #multi-filter-select td.jeltnovyi {
font-weight: 600 !important;
}

/* Shipment reports block polish */
.otchetobotgr .main td,
.otchetobotgr .main2 td {
vertical-align: top;
padding-top: 6px;
padding-bottom: 6px;
}

.otchetobotgr .contr {
display: block;
text-align: left;
padding-left: 0 !important;
margin-left: 0 !important;
font-weight: 600;
}

.otchetobotgr .form-control,
.otchetobotgr .form-select {
height: 42px !important;
min-height: 42px !important;
line-height: 1.25;
}

.otchetobotgr .Knopciform {
width: 42px !important;
height: 42px !important;
min-width: 42px !important;
min-height: 42px !important;
padding: 0 !important;
line-height: 42px !important;
text-align: center;
border-radius: 8px;
border: 1px solid var(--border-color);
background: #fff;
color: #1d232f;
font-weight: 700;
}

.otchetobotgr .btn-primary2,
.otchetobotgr .btn-danger2 {
min-height: 42px !important;
line-height: 28px !important;
padding: 6px 16px !important;
font-weight: 700;
text-shadow: none;
}

.otchetobotgr .btn-primary2 {
background-color: #2f7df6 !important;
border: none !important;
color: #ffffff !important;
}

.otchetobotgr .btn-danger2 {
background-color: var(--btn-danger2) !important;
border: 1px solid var(--btn-danger2) !important;
color: #ffffff !important;
}

[data-theme="dark"] .otchetobotgr .Knopciform {
background: #141821;
color: #eaf0fa;
border-color: #3b3f48;
}

/* Fix labels row layout in shipment reports */
.otchetobotgr .main tr.dispb,
.otchetobotgr .main2 tr.dispb {
display: table-row !important;
}

.otchetobotgr .main tr.dispb td.contr,
.otchetobotgr .main2 tr.dispb td.contr {
display: table-cell !important;
text-align: left !important;
vertical-align: bottom !important;
padding-left: 0 !important;
margin: 0 !important;
font-weight: 600;
}

/* Labels row: left padding only for first row cells */
.otchetobotgr .main tr.dispb td.contr,
.otchetobotgr .main2 tr.dispb td.contr {
padding-left: 8px !important;
}

/* Move action buttons 8px left in shipment reports block */
.otchetobotgr .btn-primary2,
.otchetobotgr .btn-danger2 {
position: relative;
left: -8px;
}

/* Force move submit/cancel buttons right by 8px */
.otchetobotgr input.btn.btn-primary2,
.otchetobotgr a.btn.btn-danger2 {
position: relative !important;
left: 8px !important;
}

/* Fiz requests table theme adaptation */
.fiz-requests td.request-new,
.fiz-requests td.request-planned {
font-weight: 600;
}

html[data-theme="light"] .fiz-requests td.request-new {
background-color: #ebb07a !important;
color: #2b1a10 !important;
}

html[data-theme="light"] .fiz-requests td.request-planned {
background-color: #f9ecb8 !important;
color: #2b2613 !important;
}

html[data-theme="dark"] .fiz-requests td.request-new {
background-color: #6f3f22 !important;
color: #f6f7fb !important;
}

html[data-theme="dark"] .fiz-requests td.request-planned {
background-color: #6a5a1f !important;
color: #f6f7fb !important;
}

/* Flatpickr dark theme adaptation */
html[data-theme="dark"] .flatpickr-calendar {
background: #171c24 !important;
border: 1px solid #3b3f48 !important;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .flatpickr-months .flatpickr-month,
html[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
html[data-theme="dark"] .flatpickr-current-month input.cur-year,
html[data-theme="dark"] .flatpickr-weekday,
html[data-theme="dark"] .flatpickr-weekdays,
html[data-theme="dark"] .flatpickr-time,
html[data-theme="dark"] .flatpickr-time input,
html[data-theme="dark"] .flatpickr-time .flatpickr-am-pm {
background: #171c24 !important;
color: #eaf0fa !important;
fill: #eaf0fa !important;
}

html[data-theme="dark"] .flatpickr-day {
color: #eaf0fa !important;
}

html[data-theme="dark"] .flatpickr-day.prevMonthDay,
html[data-theme="dark"] .flatpickr-day.nextMonthDay,
html[data-theme="dark"] .flatpickr-day.flatpickr-disabled,
html[data-theme="dark"] .flatpickr-day.flatpickr-disabled:hover {
color: #7f8794 !important;
}

html[data-theme="dark"] .flatpickr-day:hover {
background: #2a313d !important;
border-color: #2a313d !important;
}

html[data-theme="dark"] .flatpickr-day.today {
border-color: #7db2ff !important;
}

html[data-theme="dark"] .flatpickr-day.selected,
html[data-theme="dark"] .flatpickr-day.startRange,
html[data-theme="dark"] .flatpickr-day.endRange {
background: #2f7df6 !important;
border-color: #2f7df6 !important;
color: #ffffff !important;
}

html[data-theme="dark"] .flatpickr-months .flatpickr-prev-month svg,
html[data-theme="dark"] .flatpickr-months .flatpickr-next-month svg {
fill: #eaf0fa !important;
}

/* Theme switch position near user (left side, same row) */
.topbar-user {
display: flex !important;
align-items: center !important;
gap: 10px;
}

.topbar-user > .theme-switch-wrapper {
margin: 0 !important;
flex: 0 0 auto;
}

.topbar-user .profile-pic {
display: inline-flex !important;
align-items: center !important;
}

/* Daily reports table dark readability */
html[data-theme="dark"] #daily-reports-table {
color: #eaf0fa !important;
}

html[data-theme="dark"] #daily-reports-table thead th,
html[data-theme="dark"] #daily-reports-table tfoot th {
background-color: #151920 !important;
color: #eaf0fa !important;
border-color: #3b3f48 !important;
}

html[data-theme="dark"] #daily-reports-table tbody td {
background-color: #1b2028 !important;
color: #eaf0fa !important;
border-color: #323741 !important;
}

html[data-theme="dark"] #daily-reports-table.table-striped > tbody > tr:nth-of-type(odd) > td {
background-color: #202631 !important;
}

html[data-theme="dark"] #daily-reports-table.table-hover > tbody > tr:hover > td {
background-color: #2b3340 !important;
color: #ffffff !important;
}

#daily-reports-table tbody tr.daily-report-row {
cursor: pointer;
}

#daily-reports-table tbody tr.daily-report-row:hover td {
box-shadow: inset 0 0 0 9999px rgba(47, 125, 246, .08);
}

.contractor-info-modal {
border: none;
border-radius: 16px;
overflow: hidden;
}

.contractor-info-modal .modal-header {
align-items: flex-start;
border-bottom: 1px solid var(--border-color);
}

.contractor-info-modal__type {
font-size: 13px;
font-weight: 700;
letter-spacing: .02em;
color: #2f7df6;
margin-top: 4px;
}

.contractor-info-summary {
display: grid;
grid-template-columns: minmax(0, 1.5fr) minmax(220px, .8fr);
gap: 12px;
margin-bottom: 18px;
}

.contractor-info-summary > div {
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 12px;
background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%);
}

.contractor-info-summary span {
display: block;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: .04em;
opacity: .72;
margin-bottom: 6px;
}

.contractor-info-summary strong {
display: block;
font-size: 16px;
line-height: 1.35;
color: var(--font-color);
}

.contractor-info-history-title {
font-size: 15px;
font-weight: 800;
margin: 0 0 10px;
}

.contractor-date-filter {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin: 0 0 16px;
padding: 10px;
border: 1px solid var(--border-color);
border-radius: 12px;
background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%);
}

.contractor-date-filter__presets {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}

.contractor-date-filter__btn {
border: 1px solid var(--border-color);
border-radius: 999px;
background: #ffffff;
color: #253044;
font-weight: 700;
padding: 7px 13px;
line-height: 1.1;
cursor: pointer;
}

.contractor-date-filter__btn.active,
.contractor-date-filter__btn:hover {
background: #2f7df6;
border-color: #2f7df6;
color: #ffffff;
}

.contractor-date-filter__custom {
display: none;
align-items: center;
gap: 8px;
}

.contractor-date-filter.is-custom .contractor-date-filter__custom {
display: flex;
}

.contractor-date-filter__custom label {
display: inline-flex;
align-items: center;
gap: 6px;
margin: 0;
font-weight: 700;
color: var(--font-color);
}

.contractor-date-filter__custom input {
height: 34px;
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 5px 8px;
background: #ffffff;
color: #253044;
}

.contractor-info-history-wrap {
max-height: min(54vh, 460px);
overflow: auto;
border: 1px solid var(--border-color);
border-radius: 12px;
}

.contractor-info-history {
margin-bottom: 0 !important;
}

.contractor-info-history th {
position: sticky;
top: 0;
z-index: 1;
background: #f5f7fb;
}

.contractor-info-history th,
.contractor-info-history td {
vertical-align: top;
font-size: 13px;
}

.contractor-info-total {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
margin-top: 14px;
}

.contractor-info-total > div {
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 12px;
background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%);
}

.contractor-info-total span {
display: block;
font-size: 12px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: .04em;
opacity: .72;
margin-bottom: 6px;
}

.contractor-info-total strong {
display: block;
font-size: 20px;
line-height: 1.2;
color: #2f7df6;
}

html[data-theme="dark"] .contractor-info-modal {
background: #171c24;
color: #eaf0fa;
}

html[data-theme="dark"] .contractor-info-modal .modal-header {
border-color: #3b3f48;
}

html[data-theme="dark"] .contractor-info-summary > div {
background: #202631;
border-color: #3b3f48;
}

html[data-theme="dark"] .contractor-date-filter,
html[data-theme="dark"] .contractor-info-total > div {
background: #202631;
border-color: #3b3f48;
}

html[data-theme="dark"] .contractor-date-filter__btn,
html[data-theme="dark"] .contractor-date-filter__custom input {
background: #171c24;
border-color: #3b3f48;
color: #eaf0fa;
}

html[data-theme="dark"] .contractor-date-filter__btn.active,
html[data-theme="dark"] .contractor-date-filter__btn:hover {
background: #2f7df6;
border-color: #2f7df6;
color: #ffffff;
}

html[data-theme="dark"] #contractor-date-from::-webkit-calendar-picker-indicator,
html[data-theme="dark"] #contractor-date-to::-webkit-calendar-picker-indicator {
filter: invert(1) brightness(1.35) contrast(1.1);
opacity: 1;
cursor: pointer;
}

html[data-theme="dark"] .contractor-info-history-wrap {
border-color: #3b3f48;
}

html[data-theme="dark"] .contractor-info-history th {
background: #151920;
color: #eaf0fa;
}

html[data-theme="dark"] .contractor-info-history td {
background: #1b2028;
color: #eaf0fa;
border-color: #323741;
}

.edit-org-modal .modal-body {
padding: 18px;
}

.edit-fiz-modal .modal-body {
padding: 18px;
}

.report-modal .modal-body {
padding: 18px;
}

.report-modal-body {
border: 1px solid var(--border-color);
border-radius: 14px;
padding: 14px;
background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%) !important;
}

.report-modal .main,
.report-modal .main2 {
margin: 0;
}

.report-modal .form-control,
.report-modal .form-select {
height: 40px;
min-height: 40px;
border-radius: 10px;
}

.report-modal .Knopciform {
border-radius: 10px;
}

.report-modal-actions {
display: flex;
align-items: center;
gap: 12px;
margin-top: 14px;
}

.report-modal-actions .btn,
.report-modal-actions .btn-primary2,
.report-modal-actions .btn-danger2,
.report-modal-actions input.btn {
min-width: 126px;
min-height: 42px;
font-weight: 700;
position: static !important;
left: auto !important;
max-width: none !important;
}

html[data-theme="dark"] .report-modal-body {
background: #202631 !important;
border-color: #3b3f48 !important;
}

.edit-org-summary {
grid-template-columns: minmax(0, 1.4fr) minmax(190px, .8fr) minmax(190px, .8fr);
}

.edit-fiz-summary {
grid-template-columns: minmax(0, 1.4fr) minmax(190px, .8fr) minmax(160px, .7fr);
}

.edit-org-summary.is-new > div:first-child {
border-color: #f4c76b;
background: #fff4d8;
}

.edit-org-section {
margin-top: 16px;
}

.edit-org-section form {
margin: 0;
}

.edit-fiz-fields {
display: grid;
grid-template-columns: repeat(2, minmax(180px, 1fr));
gap: 12px;
margin-bottom: 12px;
}

.edit-fiz-fields label,
.edit-fiz-comment-label {
display: block;
margin: 0;
}

.edit-fiz-fields span,
.edit-fiz-comment-label > span {
display: block;
font-size: 12px;
font-weight: 800;
letter-spacing: .04em;
text-transform: uppercase;
opacity: .72;
margin-bottom: 6px;
}

.edit-fiz-fields .form-control {
height: 40px;
min-height: 40px;
border-radius: 10px;
}

.edit-org-comment {
min-height: 112px;
resize: vertical;
margin-bottom: 12px;
}

.edit-org-cars-wrap,
.edit-org-history-wrap {
max-height: none;
}

.edit-org-cars th:last-child,
.edit-org-cars td:last-child {
width: 96px;
text-align: right;
white-space: nowrap;
}

.edit-org-cars .form-control {
height: 38px;
min-height: 38px;
border-radius: 9px;
}

.edit-org-cars__actions {
vertical-align: middle !important;
}

.edit-org-icon-btn,
.edit-org-small-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 34px;
height: 34px;
border: 1px solid var(--border-color);
border-radius: 10px;
background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%);
color: var(--font-color);
font-size: 18px;
font-weight: 800;
line-height: 1;
cursor: pointer;
}

.edit-org-icon-btn {
color: #dc2626;
}

.edit-org-small-btn:hover,
.edit-org-icon-btn:hover {
background: #2f7df6;
border-color: #2f7df6;
color: #ffffff;
}

.edit-org-section .edit-save-btn {
margin-top: 12px;
min-width: 150px;
}

html[data-theme="dark"] .edit-org-summary.is-new > div:first-child {
background: #3b2d12;
border-color: #8f6d26;
}

html[data-theme="dark"] .edit-org-icon-btn,
html[data-theme="dark"] .edit-org-small-btn {
background: #171c24;
border-color: #3b3f48;
color: #eaf0fa;
}

html[data-theme="dark"] .edit-org-icon-btn {
color: #fca5a5;
}

html[data-theme="dark"] .edit-org-small-btn:hover,
html[data-theme="dark"] .edit-org-icon-btn:hover {
background: #2f7df6;
border-color: #2f7df6;
color: #ffffff;
}

@media (max-width: 768px) {
  .edit-org-summary,
  .edit-fiz-summary,
  .edit-fiz-fields {
    grid-template-columns: 1fr;
  }
}

.daily-date-filter {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 14px;
padding: 12px;
border: 1px solid var(--border-color);
border-radius: 12px;
background: color-mix(in srgb, var(--bg-color) 86%, #ffffff 14%);
}

.daily-date-filter__presets {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}

.daily-date-filter__btn {
border: 1px solid var(--border-color);
border-radius: 999px;
background: #ffffff;
color: #253044;
font-weight: 600;
padding: 8px 14px;
line-height: 1.1;
cursor: pointer;
transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.daily-date-filter__btn.active,
.daily-date-filter__btn:hover {
background: #2f7df6;
border-color: #2f7df6;
color: #ffffff;
}

.daily-date-filter__custom {
display: none;
align-items: center;
gap: 8px;
}

.daily-date-filter.is-custom .daily-date-filter__custom {
display: flex;
}

.daily-date-filter__custom label {
display: inline-flex;
align-items: center;
gap: 6px;
margin: 0;
font-weight: 600;
color: var(--font-color);
}

.daily-date-filter__custom input {
height: 36px;
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 6px 10px;
background: #ffffff;
color: #253044;
}

html[data-theme="dark"] .daily-date-filter {
background: #171c24;
border-color: #3b3f48;
}

html[data-theme="dark"] .daily-date-filter__btn,
html[data-theme="dark"] .daily-date-filter__custom input {
background: #202631;
border-color: #3b3f48;
color: #eaf0fa;
}

html[data-theme="dark"] #daily-date-from::-webkit-calendar-picker-indicator,
html[data-theme="dark"] #daily-date-to::-webkit-calendar-picker-indicator {
filter: invert(1) brightness(1.35) contrast(1.1);
opacity: 1;
cursor: pointer;
}

html[data-theme="dark"] .daily-date-filter__btn.active,
html[data-theme="dark"] .daily-date-filter__btn:hover {
background: #2f7df6;
border-color: #2f7df6;
color: #ffffff;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_info,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter label,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length label {
color: #d8deea !important;
}

.daily-info-filtered {
display: inline-block;
margin-top: 2px;
opacity: .86;
}

#daily-reports-table_wrapper .dataTables_paginate .paginate_button.previous,
#daily-reports-table_wrapper .dataTables_paginate .paginate_button.next {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
width: 42px !important;
height: 38px !important;
padding: 0 !important;
margin: 0 3px !important;
border: none !important;
border-radius: 10px !important;
background: transparent !important;
color: #2f7df6 !important;
font-size: 42px !important;
font-weight: 900 !important;
line-height: 1 !important;
text-align: center;
vertical-align: middle !important;
box-shadow: none !important;
transform: translateY(-5px);
}

#daily-reports-table_wrapper .dataTables_paginate .paginate_button.previous .page-link,
#daily-reports-table_wrapper .dataTables_paginate .paginate_button.next .page-link {
border: none !important;
border-width: 0 !important;
border-style: none !important;
background: transparent !important;
box-shadow: none !important;
color: inherit !important;
font-size: inherit !important;
font-weight: inherit !important;
line-height: 1 !important;
padding: 0 !important;
}

#daily-reports-table_wrapper .dataTables_paginate .paginate_button.previous:hover,
#daily-reports-table_wrapper .dataTables_paginate .paginate_button.next:hover {
background: transparent !important;
color: #165fc8 !important;
}

#daily-reports-table_wrapper .dataTables_paginate .pagination {
align-items: center !important;
}

#daily-reports-table_wrapper .dataTables_paginate .paginate_button:not(.previous):not(.next) {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
min-height: 38px;
}

.dataTables_wrapper .dataTables_length label {
display: inline-flex;
align-items: center;
gap: 8px;
}

.dataTables_wrapper .dataTables_length select {
min-width: 74px;
height: 36px;
padding: 4px 28px 4px 10px;
border: 1px solid var(--border-color);
border-radius: 8px;
background-color: #ffffff;
color: #222222;
line-height: 1.2;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
background-color: #171c24 !important;
color: #eaf0fa !important;
border-color: #3b3f48 !important;
}

#daily-reports-table_wrapper .dataTables_length {
float: right !important;
text-align: right !important;
}

#daily-reports-table_wrapper .dataTables_filter {
float: left !important;
text-align: left !important;
}

#daily-reports-table_wrapper > .row:first-child {
display: flex;
}

#daily-reports-table_wrapper > .row:first-child > .col-md-6:first-child {
order: 2;
}

#daily-reports-table_wrapper > .row:first-child > .col-md-6:nth-child(2) {
order: 1;
}

@media (max-width: 768px) {
  #daily-reports-table_wrapper > .row:first-child {
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 8px;
  }

  #daily-reports-table_wrapper > .row:first-child > .col-sm-12 {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: none !important;
    padding-left: 0;
    padding-right: 0;
  }

  #daily-reports-table_wrapper .dataTables_filter {
    flex: 1 1 auto;
    width: 100%;
  }

  #daily-reports-table_wrapper .dataTables_filter label,
  #daily-reports-table_wrapper .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    white-space: nowrap;
  }

  #daily-reports-table_wrapper .dataTables_filter input {
    width: min(42vw, 170px);
    min-width: 110px;
  }

  #daily-reports-table_wrapper .dataTables_length {
    flex: 0 0 auto;
    font-size: 0;
    width: auto !important;
  }

  #daily-reports-table_wrapper .dataTables_length label {
    width: auto !important;
    font-size: 0 !important;
    gap: 5px;
  }

  #daily-reports-table_wrapper .dataTables_length select {
    min-width: 62px;
    height: 34px;
    padding-left: 8px;
    padding-right: 22px;
    font-size: 13px;
  }

  #daily-reports-table_wrapper .dataTables_length label::after {
    content: "строк";
    font-size: 13px;
    color: var(--font-color);
  }

  .daily-date-filter {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .daily-date-filter__presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .daily-date-filter__btn {
    padding: 8px 8px;
    font-size: 13px;
  }

  .daily-date-filter.is-custom .daily-date-filter__custom {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
  }

  .daily-date-filter__custom label {
    align-items: center;
    flex-direction: row;
    gap: 4px;
    font-size: 12px;
    flex: 0 1 auto;
    max-width: none;
    min-width: 0;
  }

  .daily-date-filter__custom input {
    width: 132px;
    max-width: 100%;
    min-width: 0;
    height: 34px;
    padding: 5px 6px;
    font-size: 12px;
  }

  .contractor-info-summary {
    grid-template-columns: 1fr;
  }

  .contractor-info-history-wrap {
    max-height: 52vh;
  }

  .contractor-info-history th,
  .contractor-info-history td {
    font-size: 12px;
    padding: 8px 6px !important;
  }

  .contractor-date-filter {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .contractor-date-filter__presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .contractor-date-filter__btn {
    padding: 8px 8px;
    font-size: 13px;
  }

  .contractor-date-filter.is-custom .contractor-date-filter__custom {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
  }

  .contractor-date-filter__custom label {
    align-items: center;
    flex-direction: row;
    gap: 4px;
    font-size: 12px;
    flex: 0 1 auto;
    max-width: none;
    min-width: 0;
  }

  .contractor-date-filter__custom input {
    width: 132px;
    max-width: 100%;
    min-width: 0;
    height: 34px;
    padding: 5px 6px;
    font-size: 12px;
  }

  .contractor-info-total {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Mobile refinements */
@media (max-width: 768px) {
  .main-header .navbar .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar-user {
    gap: 6px;
  }

  .topbar-user .profile-username {
    display: none;
  }

  .theme-switch {
    width: 50px;
    height: 30px;
    margin: 0 6px;
  }

  .slider:before {
    width: 22px;
    height: 22px;
    bottom: 4px;
    left: 4px;
  }

  input:checked + .slider:before {
    transform: translateX(20px);
  }

  .page-inner {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .otchetobotgr {
    padding: 10px !important;
  }

  .otchetobotgr .main,
  .otchetobotgr .main2 {
    width: 100%;
  }

  .otchetobotgr .main td,
  .otchetobotgr .main2 td {
    display: block;
    width: 100% !important;
    padding: 4px 0;
  }

  .otchetobotgr .main tr,
  .otchetobotgr .main2 tr {
    display: block;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
  }

  .otchetobotgr .main tr.dispb,
  .otchetobotgr .main2 tr.dispb {
    display: none !important;
  }

  .otchetobotgr .form-control,
  .otchetobotgr .form-select,
  .otchetobotgr .Knopciform,
  .otchetobotgr .btn-primary2,
  .otchetobotgr .btn-danger2 {
    width: 100% !important;
    max-width: none !important;
    left: 0 !important;
  }

  .otchetobotgr .Knopciform {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .modal-dialog {
    margin: 8px;
  }

  .modal-body {
    padding: 12px;
  }
}

/* Report modals: prevent button overlap */
#orgReportModal .otchetobotgr .btn-primary2,
#orgReportModal .otchetobotgr .btn-danger2,
#fizReportModal .otchetobotgr .btn-primary2,
#fizReportModal .otchetobotgr .btn-danger2 {
left: 0 !important;
position: static !important;
}

#orgReportModal .otchetobotgr .btn-danger2,
#fizReportModal .otchetobotgr .btn-danger2 {
margin-left: 14px !important;
}

/* Mobile: stack report modal action buttons */
@media (max-width: 768px) {
  #orgReportModal .otchetobotgr .btn-danger2,
  #fizReportModal .otchetobotgr .btn-danger2 {
    display: block !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 10px !important;
    left: 0 !important;
    position: static !important;
  }
}

/* Desktop fit for Fiz report modal row */
#fizReportModal .otchetobotgr .main2 td {
white-space: nowrap;
}

#fizReportModal .otchetobotgr .main2 select[name="fizkontragent"] {
width: 240px !important;
max-width: 240px !important;
}

#fizReportModal .otchetobotgr .main2 input[name="datein[]"],
#fizReportModal .otchetobotgr .main2 input[name="tonn[]"],
#fizReportModal .otchetobotgr .main2 input[name="summ[]"],
#fizReportModal .otchetobotgr .main2 input[name="reiss[]"] {
width: 120px !important;
max-width: 120px !important;
}

#fizReportModal .otchetobotgr .main2 select[name="nalbeznal[]"] {
width: 100px !important;
max-width: 100px !important;
}

#fizReportModal .otchetobotgr .main2 td:last-child {
width: 98px !important;
min-width: 98px !important;
}

#fizReportModal .otchetobotgr .main2 td:last-child .Knopciform {
width: 42px !important;
height: 42px !important;
min-width: 42px !important;
margin: 0 !important;
}

/* Responsive modal sizing based on viewport */
#orgReportModal .modal-dialog,
#fizReportModal .modal-dialog,
#editContractorModal .modal-dialog,
#editFizModal .modal-dialog {
width: min(96vw, 1280px) !important;
max-width: min(96vw, 1280px) !important;
margin: 2vh auto !important;
}

#orgReportModal .modal-content,
#fizReportModal .modal-content,
#editContractorModal .modal-content,
#editFizModal .modal-content {
max-height: 96vh;
}

#orgReportModal .modal-body,
#fizReportModal .modal-body,
#editContractorModal .modal-body,
#editFizModal .modal-body {
overflow: auto;
max-height: calc(96vh - 120px);
}

@media (max-width: 992px) {
  #orgReportModal .modal-dialog,
  #fizReportModal .modal-dialog,
  #editContractorModal .modal-dialog,
  #editFizModal .modal-dialog {
    width: 98vw !important;
    max-width: 98vw !important;
    margin: 1vh auto !important;
  }
}

/* Responsive field widths inside modals */
#orgReportModal .otchetobotgr .form-control,
#orgReportModal .otchetobotgr .form-select,
#fizReportModal .otchetobotgr .form-control,
#fizReportModal .otchetobotgr .form-select,
#editContractorModal .form-control,
#editContractorModal .form-select,
#editFizModal .form-control,
#editFizModal .form-select {
width: 100% !important;
max-width: 100% !important;
}

#orgReportModal .otchetobotgr .main,
#fizReportModal .otchetobotgr .main2 {
table-layout: fixed;
width: 100%;
}

#orgReportModal .otchetobotgr .main td,
#fizReportModal .otchetobotgr .main2 td {
min-width: 110px;
}

#orgReportModal .otchetobotgr .main td:last-child,
#fizReportModal .otchetobotgr .main2 td:last-child {
min-width: 96px;
width: 96px;
}

/* Fix overlap in Fiz report modal fields */
#fizReportModal .otchetobotgr .main2 tr {
display: grid;
grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 96px;
gap: 8px;
align-items: end;
}

#fizReportModal .otchetobotgr .main2 tr.dispb {
display: grid !important;
}

#fizReportModal .otchetobotgr .main2 td {
display: block !important;
min-width: 0 !important;
width: 100% !important;
}

#fizReportModal .otchetobotgr .main2 .form-control,
#fizReportModal .otchetobotgr .main2 .form-select {
width: 100% !important;
max-width: 100% !important;
}

@media (max-width: 1200px) {
  #fizReportModal .otchetobotgr .main2 tr {
    grid-template-columns: minmax(160px, 2fr) repeat(5, minmax(100px, 1fr)) 96px;
  }
}

/* Keep +/- in same row for Org report modal */
#orgReportModal .otchetobotgr .main tr {
display: grid;
grid-template-columns: minmax(220px, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) 96px;
gap: 8px;
align-items: end;
}

#orgReportModal .otchetobotgr .main tr.dispb {
display: grid !important;
}

#orgReportModal .otchetobotgr .main td {
display: block !important;
min-width: 0 !important;
width: 100% !important;
}

#orgReportModal .otchetobotgr .main td:last-child {
width: 96px !important;
min-width: 96px !important;
}

#orgReportModal .otchetobotgr .main td:last-child .Knopciform {
width: 42px !important;
height: 42px !important;
min-width: 42px !important;
margin: 0 !important;
}

/* Ensure + and - stay on one line in report modals */
#orgReportModal .otchetobotgr .main td:last-child,
#fizReportModal .otchetobotgr .main2 td:last-child {
display: flex !important;
flex-wrap: nowrap !important;
align-items: center !important;
gap: 6px !important;
white-space: nowrap !important;
}

#orgReportModal .otchetobotgr .main td:last-child .Knopciform,
#fizReportModal .otchetobotgr .main2 td:last-child .Knopciform {
flex: 0 0 42px !important;
}

/* Mobile reset for report modals: stacked fields */
@media (max-width: 768px) {
  #orgReportModal .otchetobotgr .main tr,
  #fizReportModal .otchetobotgr .main2 tr {
    display: block !important;
    margin-bottom: 10px !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 8px !important;
  }

  #orgReportModal .otchetobotgr .main tr.dispb,
  #fizReportModal .otchetobotgr .main2 tr.dispb {
    display: none !important;
  }

  #orgReportModal .otchetobotgr .main td,
  #fizReportModal .otchetobotgr .main2 td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 4px 0 !important;
  }

  #orgReportModal .otchetobotgr .form-control,
  #orgReportModal .otchetobotgr .form-select,
  #fizReportModal .otchetobotgr .form-control,
  #fizReportModal .otchetobotgr .form-select {
    width: 100% !important;
    max-width: 100% !important;
  }

  #orgReportModal .otchetobotgr .main td:last-child,
  #fizReportModal .otchetobotgr .main2 td:last-child {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #orgReportModal .otchetobotgr .main td:last-child .Knopciform,
  #fizReportModal .otchetobotgr .main2 td:last-child .Knopciform {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
  }
}

/* Mobile dark: report date field calendar icon + picker */
@media (max-width: 768px) {
  html[data-theme="dark"] #orgReportModal input[name="datein[]"],
  html[data-theme="dark"] #fizReportModal input[name="datein[]"],
  html[data-theme="dark"] #editFizModal input#datepickerfiz {
    color: #eef3fb !important;
    background-color: #11151b !important;
    border-color: #3b3f48 !important;
  }

  html[data-theme="dark"] #orgReportModal input[name="datein[]"]::-webkit-calendar-picker-indicator,
  html[data-theme="dark"] #fizReportModal input[name="datein[]"]::-webkit-calendar-picker-indicator,
  html[data-theme="dark"] #editFizModal input#datepickerfiz::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.35) contrast(1.1);
    opacity: 1;
  }

  html[data-theme="dark"] .flatpickr-calendar {
    background: #11161e !important;
    border-color: #3b3f48 !important;
  }

  html[data-theme="dark"] .flatpickr-months,
  html[data-theme="dark"] .flatpickr-weekdays,
  html[data-theme="dark"] .flatpickr-time {
    background: #11161e !important;
  }

  html[data-theme="dark"] .flatpickr-day {
    color: #ecf1fa !important;
  }

  html[data-theme="dark"] .flatpickr-day:hover {
    background: #2a3342 !important;
    border-color: #2a3342 !important;
  }

  html[data-theme="dark"] .flatpickr-day.selected,
  html[data-theme="dark"] .flatpickr-day.startRange,
  html[data-theme="dark"] .flatpickr-day.endRange {
    background: #2f7df6 !important;
    border-color: #2f7df6 !important;
    color: #fff !important;
  }
}

/* Forced dark flatpickr skin */
.flatpickr-calendar.dark-calendar-force,
.flatpickr-calendar.dark-calendar-force .flatpickr-months,
.flatpickr-calendar.dark-calendar-force .flatpickr-weekdays,
.flatpickr-calendar.dark-calendar-force .flatpickr-time {
background: #11161e !important;
border-color: #3b3f48 !important;
color: #ecf1fa !important;
}

.flatpickr-calendar.dark-calendar-force .flatpickr-day {
color: #ecf1fa !important;
}

.flatpickr-calendar.dark-calendar-force .flatpickr-day.prevMonthDay,
.flatpickr-calendar.dark-calendar-force .flatpickr-day.nextMonthDay,
.flatpickr-calendar.dark-calendar-force .flatpickr-day.flatpickr-disabled {
color: #7f8794 !important;
}

.flatpickr-calendar.dark-calendar-force .flatpickr-day:hover {
background: #2a3342 !important;
border-color: #2a3342 !important;
}

.flatpickr-calendar.dark-calendar-force .flatpickr-day.selected,
.flatpickr-calendar.dark-calendar-force .flatpickr-day.startRange,
.flatpickr-calendar.dark-calendar-force .flatpickr-day.endRange {
background: #2f7df6 !important;
border-color: #2f7df6 !important;
color: #fff !important;
}

/* Buttons readability: light + dark */
.btn-primary2,
.btn-danger2,
.btn-report,
.btn-primary,
.btn-danger {
font-weight: 700 !important;
letter-spacing: 0.2px;
text-shadow: none !important;
}

/* Dedicated Report button palette */
.btn-report {
background-color: #1f8f63 !important;
border: 1px solid #1f8f63 !important;
color: #ffffff !important;
}

.btn-report:hover,
.btn-report:focus {
background-color: #19724f !important;
border-color: #19724f !important;
color: #ffffff !important;
}

html[data-theme="light"] .btn-primary2,
html:not([data-theme="dark"]) .btn-primary2 {
background-color: #2f7df6 !important;
border-color: #2f7df6 !important;
color: #ffffff !important;
box-shadow: 0 8px 18px rgba(47, 125, 246, .18);
}

html[data-theme="light"] .btn-primary2:hover,
html[data-theme="light"] .btn-primary2:focus,
html:not([data-theme="dark"]) .btn-primary2:hover,
html:not([data-theme="dark"]) .btn-primary2:focus {
background-color: #1f66d1 !important;
border-color: #1f66d1 !important;
color: #ffffff !important;
box-shadow: 0 10px 22px rgba(31, 102, 209, .22);
}

html[data-theme="light"] .btn-danger2,
html:not([data-theme="dark"]) .btn-danger2 {
background-color: #b56f52 !important;
border-color: #b56f52 !important;
color: #ffffff !important;
box-shadow: 0 8px 18px rgba(181, 111, 82, .16);
}

html[data-theme="light"] .btn-danger2:hover,
html[data-theme="light"] .btn-danger2:focus,
html:not([data-theme="dark"]) .btn-danger2:hover,
html:not([data-theme="dark"]) .btn-danger2:focus {
background-color: #9b5d45 !important;
border-color: #9b5d45 !important;
color: #ffffff !important;
box-shadow: 0 10px 22px rgba(155, 93, 69, .2);
}

html[data-theme="dark"] .btn-primary2 {
background-color: #3a86ff !important;
border-color: #3a86ff !important;
color: #ffffff !important;
}

html[data-theme="dark"] .btn-primary {
background-color: #3a86ff !important;
border-color: #3a86ff !important;
color: #ffffff !important;
font-weight: 800 !important;
box-shadow: 0 10px 22px rgba(58, 134, 255, .24);
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus {
background-color: #5a99ff !important;
border-color: #5a99ff !important;
color: #ffffff !important;
}

html[data-theme="dark"] .btn-danger2 {
background-color: #b56f52 !important;
border-color: #b56f52 !important;
color: #ffffff !important;
}

/* Report button adapted for dark theme */
html[data-theme="dark"] .btn-report {
background-color: #27b07a !important;
border-color: #27b07a !important;
color: #0f1a15 !important;
}

html[data-theme="dark"] .btn-report:hover,
html[data-theme="dark"] .btn-report:focus {
background-color: #2bc489 !important;
border-color: #2bc489 !important;
color: #0c1512 !important;
}

/* Readable close icon in dark theme modals */
html[data-theme="dark"] #orgReportModal .btn-close,
html[data-theme="dark"] #fizReportModal .btn-close,
html[data-theme="dark"] #editContractorModal .btn-close,
html[data-theme="dark"] #editFizModal .btn-close,
html[data-theme="dark"] #addRowModal .btn-close,
html[data-theme="dark"] .modal .btn-close {
filter: invert(1) brightness(1.35) contrast(1.2) !important;
opacity: 1 !important;
}

/* Mobile dark: force light calendar icon in report modals */
@media (max-width: 768px) {
  html[data-theme="dark"] #orgReportModal input#datepicker,
  html[data-theme="dark"] #fizReportModal input#datepicker,
  html[data-theme="dark"] #orgReportModal input.flatpickr-input,
  html[data-theme="dark"] #fizReportModal input.flatpickr-input {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f7ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px 16px !important;
    padding-right: 38px !important;
  }
}

/* Mobile dark: keep only one clickable (native) calendar icon */
@media (max-width: 768px) {
  html[data-theme="dark"] #orgReportModal input#datepicker,
  html[data-theme="dark"] #fizReportModal input#datepicker,
  html[data-theme="dark"] #orgReportModal input.flatpickr-input,
  html[data-theme="dark"] #fizReportModal input.flatpickr-input,
  html[data-theme="dark"] #editFizModal #datepickerfiz {
    background-image: none !important; /* remove decorative non-clickable icon */
    padding-right: 12px !important;
  }

  html[data-theme="dark"] #orgReportModal input#datepicker::-webkit-calendar-picker-indicator,
  html[data-theme="dark"] #fizReportModal input#datepicker::-webkit-calendar-picker-indicator,
  html[data-theme="dark"] #orgReportModal input.flatpickr-input::-webkit-calendar-picker-indicator,
  html[data-theme="dark"] #fizReportModal input.flatpickr-input::-webkit-calendar-picker-indicator,
  html[data-theme="dark"] #editFizModal #datepickerfiz::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.45) contrast(1.2) !important;
    opacity: 1 !important;
    cursor: pointer !important;
  }
}

/* Light calendar icon for Fiz edit modal in dark theme */
html[data-theme="dark"] #editFizModal #datepickerfiz {
  padding-right: 38px !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px 16px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f7ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>") !important;
}

/* Final override: light calendar icon in Fiz edit modal (all viewports) */
html[data-theme="dark"] #editFizModal #datepickerfiz {
  padding-right: 38px !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px 16px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f7ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>") !important;
}

@media (max-width: 768px) {
  html[data-theme="dark"] #editFizModal #datepickerfiz {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f7ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>") !important;
  }
}

/* Current requests cards (based on order cards) */
.current-requests-table .status-pill {
  border-radius: 999px;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.current-requests-table .status-pending {
  background: #dc2626;
  color: #ffffff;
}

.current-requests-table .status-done {
  background: #16a34a;
  color: #ffffff;
}

.current-requests-table .edit-btn {
  background: var(--panel, #ffffff);
  color: #175cd3;
  border: 1px solid #c8d5ef;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}

.current-requests-table .icon-only-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
}

@media (max-width: 760px) {
  .current-requests-table {
    min-width: 0 !important;
  }

  .current-requests-table thead {
    display: none;
  }

  .current-requests-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .current-requests-table tbody tr {
    display: grid;
    grid-template-columns: 40px 140px minmax(0, 1fr);
    grid-template-areas:
      "status name phone"
      "actions qty date"
      "comment comment comment";
    gap: 8px;
    border: 2px solid #8b96a8;
    border-radius: 8px;
    padding: 10px;
    background: var(--panel);
  }

  .current-requests-table tbody tr:hover {
    background: var(--panel);
  }

  .current-requests-table td {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
    display: block;
    line-height: 1.35;
    background: color-mix(in srgb, var(--panel) 92%, var(--bg) 8%);
  }

  .current-requests-table .cell-status {
    grid-area: status;
    border-color: transparent;
    background: transparent;
    padding: 0;
  }

  .current-requests-table .cell-name { grid-area: name; }
  .current-requests-table .cell-phone { grid-area: phone; }

  .current-requests-table .cell-qty {
    grid-area: qty;
    justify-self: start;
    width: 140px;
    max-width: 100%;
  }

  .current-requests-table .cell-date {
    grid-area: date;
    grid-column: 3;
  }

  .current-requests-table .cell-comment { grid-area: comment; }

  .current-requests-table .cell-actions {
    grid-area: actions;
    margin-top: 0;
    border: none;
    background: transparent;
    padding: 0;
  }

  .current-requests-table td::before {
    content: none;
  }
}

/* Current requests cards: no status/actions, one-line fields */
.current-requests-table .cell-name,
.current-requests-table .cell-phone,
.current-requests-table .cell-qty,
.current-requests-table .cell-date {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.current-requests-table .cell-comment {
white-space: normal;
word-break: break-word;
}

@media (max-width: 760px) {
  .current-requests-table tbody tr {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "name phone"
      "qty date"
      "comment comment";
  }

  .current-requests-table .cell-qty,
  .current-requests-table .cell-date {
    width: auto;
    max-width: none;
  }

  .current-requests-table .cell-status,
  .current-requests-table .cell-actions {
    display: none !important;
  }
}

/* Current requests cards layout: name-qty / phone-date / comment */
@media (max-width: 760px) {
  .current-requests-table tbody tr {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "name qty"
      "phone date"
      "comment comment";
  }

  .current-requests-table .cell-name { grid-area: name; }
  .current-requests-table .cell-qty { grid-area: qty; }
  .current-requests-table .cell-phone { grid-area: phone; }
  .current-requests-table .cell-date { grid-area: date; }
  .current-requests-table .cell-comment { grid-area: comment; }
}

/* Bigger current-request cards on mobile (option 2) */
@media (max-width: 760px) {
  .fiz-requests .table-responsive {
    padding-left: 6px;
    padding-right: 6px;
  }

  .current-requests-table tbody {
    gap: 14px;
    padding: 12px;
  }

  .current-requests-table tbody tr {
    padding: 14px;
    border-radius: 10px;
    gap: 10px;
  }

  .current-requests-table td {
    padding: 10px 12px;
    font-size: 15px;
  }
}

/* Force larger request cards on mobile */
@media (max-width: 760px) {
  .current-requests-table tbody {
    gap: 16px !important;
    padding: 14px !important;
  }

  .current-requests-table tbody tr {
    padding: 16px !important;
    border-radius: 12px !important;
    gap: 12px !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) !important;
  }

  .current-requests-table td {
    padding: 12px 14px !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
  }
}

/* Fallback for compact desktop/mobile windows */
@media (max-width: 1200px) {
  .fiz-requests .current-requests-table tbody {
    gap: 16px !important;
    padding: 14px !important;
  }

  .fiz-requests .current-requests-table tbody tr {
    padding: 16px !important;
    border-radius: 12px !important;
    gap: 12px !important;
  }

  .fiz-requests .current-requests-table td {
    padding: 12px 14px !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
  }
}

/* New container for current requests */
.current-requests-section {
margin: 0 0 20px;
padding: 0;
}

.current-requests-section > h2 {
margin: 0 0 10px;
}

.current-requests-section .table-responsive {
padding: 0;
margin: 0;
}

/* Restore request status coloring in new current requests container */
.current-requests-section td.request-new,
.current-requests-section td.request-planned {
font-weight: 600;
}

html[data-theme="light"] .current-requests-section td.request-new {
background-color: #ebb07a !important;
color: #2b1a10 !important;
}

html[data-theme="light"] .current-requests-section td.request-planned {
background-color: #f9ecb8 !important;
color: #2b2613 !important;
}

html[data-theme="dark"] .current-requests-section td.request-new {
background-color: #6f3f22 !important;
color: #f6f7fb !important;
}

html[data-theme="dark"] .current-requests-section td.request-planned {
background-color: #6a5a1f !important;
color: #f6f7fb !important;
}

@media (max-width: 760px) {
  html[data-theme="light"] .current-requests-section .current-requests-table td.request-new,
  html[data-theme="light"] .current-requests-section .current-requests-table td.request-planned,
  html[data-theme="dark"] .current-requests-section .current-requests-table td.request-new,
  html[data-theme="dark"] .current-requests-section .current-requests-table td.request-planned {
    background-image: none !important;
  }
}

/* Current requests card font size override */
.current-requests-table td {
font-size: 12px !important;
}

/* Equal field height in current request cards */
.current-requests-table td {
min-height: 40px !important;
display: flex !important;
align-items: center !important;
}

.current-requests-table .cell-comment {
align-items: flex-start !important;
min-height: 48px !important;
}

/* Compact current request card fields */
.current-requests-table td {
min-height: 28px !important;
}

.current-requests-table .cell-comment {
min-height: 28px !important;
}

/* Dense current request card fields */
.current-requests-table td {
padding: 4px 8px !important;
min-height: 28px !important;
line-height: 1.2 !important;
font-size: 12px !important;
}

.current-requests-table .cell-comment {
padding: 4px 8px !important;
min-height: 28px !important;
line-height: 1.2 !important;
}

@media (max-width: 1200px) {
  .fiz-requests .current-requests-table td,
  .current-requests-section .current-requests-table td {
    padding: 4px 8px !important;
    min-height: 28px !important;
    line-height: 1.2 !important;
    font-size: 12px !important;
  }
}

/* Current request card: make quantity field match date field */
.current-requests-table .cell-qty,
.current-requests-table .cell-date {
width: 100% !important;
max-width: 100% !important;
justify-self: stretch !important;
}

/* Edit contractor modal save button */
.edit-save-btn {
min-width: 128px;
min-height: 42px;
padding: 8px 18px !important;
border-radius: 8px;
font-weight: 700 !important;
line-height: 1.2 !important;
}

/* Add contractor modal */
#addRowModal .modal-dialog {
width: min(94vw, 840px) !important;
max-width: min(94vw, 840px) !important;
}

#addRowModal .add-contractor-modal {
border: none;
border-radius: 18px;
overflow: hidden;
box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

#addRowModal .modal-header {
align-items: flex-start;
border-bottom: 1px solid var(--border-color);
padding: 20px 22px 16px;
}

#addRowModal .modal-title {
font-size: 20px;
font-weight: 800;
line-height: 1.2;
margin: 0;
}

#addRowModal .add-contractor-modal__subtitle {
font-size: 13px;
font-weight: 600;
color: #6b7280;
margin-top: 5px;
}

#addRowModal .modal-body {
padding: 20px 22px 22px;
}

#addRowModal .add-contractor-section {
margin: 0 0 16px;
}

#addRowModal .add-contractor-section:last-of-type {
margin-bottom: 12px;
}

#addRowModal .add-contractor-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px;
}

#addRowModal .add-contractor-field,
#addRowModal .add-contractor-comment {
display: block;
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 12px;
background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%);
margin: 0;
min-height: 90px;
}

#addRowModal .add-contractor-required {
border-color: #f25961;
}

#addRowModal .add-contractor-field-wide {
grid-column: 1 / -1;
}

#addRowModal .add-contractor-field span,
#addRowModal .add-contractor-comment span {
display: block;
font-size: 12px;
font-weight: 800;
letter-spacing: .04em;
text-transform: uppercase;
color: #6b7280;
margin-bottom: 6px;
}

#addRowModal .add-contractor-messages {
margin-top: 12px;
}

#addRowModal .add-contractor-form .row {
row-gap: 12px;
}

#addRowModal .form-group-default {
border: 1px solid var(--border-color) !important;
border-radius: 12px;
padding: 10px 12px;
background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%);
box-shadow: none;
display: flex;
flex-direction: column;
justify-content: center;
min-height: 78px;
}

#addRowModal .add-contractor-required {
height: auto;
min-height: 90px;
box-sizing: border-box;
}

#addRowModal .form-group-default label {
font-size: 12px;
font-weight: 800;
letter-spacing: .035em;
text-transform: uppercase;
color: #6b7280;
margin-bottom: 6px;
}

#addRowModal .form-control {
border: 0 !important;
background: transparent !important;
box-shadow: none !important;
padding-left: 0;
padding-right: 0;
color: var(--font-color);
height: 34px;
min-height: 34px;
line-height: 34px;
}

#addRowModal textarea.form-control {
height: auto;
line-height: 1.45;
min-height: 88px;
resize: vertical;
}

#addRowModal .input-group {
align-items: center;
height: 34px;
min-height: 34px;
}

#addRowModal .input-group.mb-3 {
margin-bottom: 0 !important;
}

#addRowModal .phone-field {
margin: 0 !important;
}

.add-contractor-duplicate,
.add-contractor-validation {
display: none;
border: 1px solid #f4c76b;
border-radius: 12px;
background: #fff4d8;
color: #60430a;
font-weight: 700;
line-height: 1.35;
padding: 10px 12px;
}

.add-contractor-duplicate.is-visible,
.add-contractor-validation.is-visible {
display: block;
}

.add-contractor-check {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 12px 14px;
border: 1px solid var(--border-color);
border-radius: 12px;
background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%);
font-weight: 700;
cursor: pointer;
}

.add-contractor-check input {
width: 18px;
height: 18px;
accent-color: #2f7df6;
}

.add-contractor-actions {
display: flex;
justify-content: flex-end;
gap: 12px;
padding-top: 4px;
}

.add-contractor-submit,
.add-contractor-cancel {
min-width: 132px;
min-height: 42px;
border-radius: 10px;
font-weight: 800 !important;
}

html[data-theme="dark"] #addRowModal .add-contractor-modal {
background: #171c24;
color: #eaf0fa;
box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] #addRowModal .modal-header {
border-color: #3b3f48;
}

html[data-theme="dark"] #addRowModal .add-contractor-modal__subtitle,
html[data-theme="dark"] #addRowModal .form-group-default label,
html[data-theme="dark"] #addRowModal .add-contractor-field span,
html[data-theme="dark"] #addRowModal .add-contractor-comment span {
color: #aeb8c8;
}

html[data-theme="dark"] #addRowModal .form-group-default,
html[data-theme="dark"] #addRowModal .add-contractor-field,
html[data-theme="dark"] #addRowModal .add-contractor-comment,
html[data-theme="dark"] .add-contractor-check {
background: #202631;
border-color: #3b3f48 !important;
}

html[data-theme="dark"] #addRowModal .add-contractor-required {
border-color: #d86b73 !important;
}

html[data-theme="dark"] #addRowModal .form-control {
color: #eaf0fa !important;
}

html[data-theme="dark"] #addRowModal .form-control::placeholder {
color: #8d98aa;
}

html[data-theme="dark"] .add-contractor-duplicate,
html[data-theme="dark"] .add-contractor-validation {
background: #3b2d12;
border-color: #8f6d26;
color: #f8df9a;
}

html[data-theme="dark"] #addRowModal #datepicker::-webkit-calendar-picker-indicator {
filter: invert(1) brightness(1.35) contrast(1.1);
opacity: 1;
}

@media (max-width: 768px) {
  #addRowModal .modal-dialog {
    width: 96vw !important;
    max-width: 96vw !important;
    margin: 1vh auto !important;
  }

  #addRowModal .modal-header,
  #addRowModal .modal-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  #addRowModal .modal-header {
    padding-top: 12px;
    padding-bottom: 10px;
  }

  #addRowModal .modal-body {
    padding-top: 12px;
    padding-bottom: 12px;
    max-height: calc(98vh - 82px);
    overflow: auto;
  }

  #addRowModal .add-contractor-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #addRowModal .add-contractor-section {
    margin-bottom: 10px;
  }

  #addRowModal .contractor-info-history-title {
    margin-bottom: 8px;
    font-size: 14px;
  }

  #addRowModal .add-contractor-field,
  #addRowModal .add-contractor-comment {
    min-height: 56px;
    padding: 7px 10px;
    border-radius: 10px;
  }

  #addRowModal .add-contractor-required {
    min-height: 56px;
  }

  #addRowModal .add-contractor-field span,
  #addRowModal .add-contractor-comment span {
    font-size: 11px;
    margin-bottom: 3px;
  }

  #addRowModal .form-control {
    height: 30px;
    min-height: 30px;
    line-height: 30px;
  }

  #addRowModal textarea.form-control {
    min-height: 56px;
    line-height: 1.35;
  }

  #addRowModal .add-contractor-messages {
    margin-top: 8px;
  }

  .add-contractor-actions {
    flex-direction: row;
    gap: 8px;
    padding-top: 0;
  }

  .add-contractor-submit,
  .add-contractor-cancel {
    flex: 1 1 0;
    width: auto;
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
  }
}

/* Rebuilt Fiz report form */
#orgReportModal .org-report-grid {
width: 100%;
}

#orgReportModal .org-report-row {
display: grid;
grid-template-columns: minmax(320px, 1fr) minmax(140px, 180px) minmax(140px, 180px) 96px;
gap: 10px;
align-items: end;
width: 100%;
}

#orgReportModal .report-field,
#orgReportModal .report-actions {
display: block;
padding: 0 !important;
min-width: 0 !important;
width: 100% !important;
max-width: none !important;
}

#orgReportModal .report-field label {
display: block;
margin: 0 0 4px;
font-size: 12px;
font-weight: 700;
line-height: 1.1;
color: var(--font-color);
}

#orgReportModal .org-report-row.is-clone label {
display: none !important;
}

#orgReportModal .report-field .form-control,
#orgReportModal .report-field .form-select {
width: 100% !important;
max-width: 100% !important;
height: 42px !important;
min-height: 42px !important;
box-sizing: border-box !important;
display: block !important;
}

#orgReportModal .report-actions {
display: flex !important;
gap: 6px !important;
align-items: end !important;
white-space: nowrap !important;
}

#orgReportModal .report-actions .Knopciform {
flex: 0 0 42px !important;
width: 42px !important;
height: 42px !important;
min-width: 42px !important;
margin: 0 !important;
}

#fizReportModal .fiz-report-grid {
width: 100%;
border-collapse: separate;
border-spacing: 0;
display: block !important;
}

#fizReportModal .fiz-report-row {
display: grid;
grid-template-columns: 240px 120px 120px 112px 120px 120px 94px;
gap: 6px;
align-items: end;
justify-content: start;
width: max-content !important;
max-width: 100%;
}

#fizReportModal .fiz-report-grid tbody {
display: block !important;
width: max-content !important;
max-width: 100%;
}

#fizReportModal .report-field,
#fizReportModal .report-actions {
display: block;
padding: 0 !important;
min-width: 0 !important;
width: 100% !important;
max-width: none !important;
}

#fizReportModal .fiz-report-row {
padding: 0;
border: none;
border-radius: 8px;
background: transparent;
}

#fizReportModal .report-field,
#fizReportModal .report-actions {
outline: none;
outline-offset: 0;
}

#fizReportModal .report-field label {
display: block;
margin: 0 0 4px;
font-size: 12px;
font-weight: 700;
line-height: 1.1;
color: var(--font-color);
}

#fizReportModal .report-field .form-control,
#fizReportModal .report-field .form-select {
width: 100% !important;
max-width: 100% !important;
height: 42px !important;
min-height: 42px !important;
box-sizing: border-box !important;
display: block !important;
}

#fizReportModal .report-field input,
#fizReportModal .report-field select {
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
box-sizing: border-box !important;
display: block !important;
}

#fizReportModal .report-field-name { width: 240px !important; }
#fizReportModal .report-field-date { width: 120px !important; }
#fizReportModal .report-field-tonn { width: 120px !important; }
#fizReportModal .report-field-pay { width: 112px !important; }
#fizReportModal .report-field-summ { width: 120px !important; }
#fizReportModal .report-field-reiss { width: 120px !important; }
#fizReportModal .report-actions { width: 94px !important; }

#fizReportModal td.report-field > input.form-control,
#fizReportModal td.report-field > select.form-select,
#fizReportModal td.report-field > input,
#fizReportModal td.report-field > select {
width: inherit !important;
min-width: inherit !important;
max-width: inherit !important;
box-sizing: border-box !important;
}

/* Div-based Fiz report form: final layout */
#fizReportModal .fiz-report-grid {
display: block !important;
width: auto !important;
max-width: 100% !important;
}

#fizReportModal .fiz-report-row {
display: grid !important;
grid-template-columns: 240px 120px 120px 112px 120px 120px 94px !important;
gap: 6px !important;
align-items: end !important;
justify-content: start !important;
width: max-content !important;
max-width: 100% !important;
}

#fizReportModal .fiz-report-row .report-field,
#fizReportModal .fiz-report-row .report-actions {
width: 100% !important;
min-width: 0 !important;
max-width: none !important;
}

#fizReportModal .fiz-report-row .report-field > input,
#fizReportModal .fiz-report-row .report-field > select {
width: 100% !important;
min-width: 0 !important;
max-width: 100% !important;
box-sizing: border-box !important;
}

#fizReportModal .fiz-report-row.is-clone label {
display: none !important;
}

@media (max-width: 768px) {
  #orgReportModal .org-report-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px;
  }

  #orgReportModal .report-actions {
    width: 100% !important;
  }

  #orgReportModal .report-actions .Knopciform {
    flex: 1 1 0 !important;
    width: auto !important;
  }

  #fizReportModal .fiz-report-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    width: 100% !important;
  }
}

#fizReportModal .report-actions {
display: flex !important;
gap: 6px !important;
align-items: end !important;
white-space: nowrap !important;
}

#fizReportModal .report-actions .Knopciform {
flex: 0 0 42px !important;
width: 42px !important;
height: 42px !important;
min-width: 42px !important;
margin: 0 !important;
}

@media (max-width: 768px) {
  #fizReportModal .fiz-report-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  #fizReportModal .report-field-name,
  #fizReportModal .report-field-date,
  #fizReportModal .report-actions {
    grid-column: 1 / -1;
  }

  #fizReportModal .report-field-tonn {
    grid-column: 1;
    grid-row: 3;
  }

  #fizReportModal .report-field-reiss {
    grid-column: 2;
    grid-row: 3;
  }

  #fizReportModal .report-field-summ {
    grid-column: 1;
    grid-row: 4;
  }

  #fizReportModal .report-field-pay {
    grid-column: 2;
    grid-row: 4;
  }
}

@media (max-width: 760px) {
  .current-requests-table .cell-qty,
  .current-requests-table .cell-date {
    width: 100% !important;
    max-width: 100% !important;
    justify-self: stretch !important;
  }
}

/* Mobile: make all Fiz report fields equal width */
@media (max-width: 768px) {
  #fizReportModal .otchetobotgr .main2 tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  #fizReportModal .otchetobotgr .main2 td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #fizReportModal .otchetobotgr .main2 .form-control,
  #fizReportModal .otchetobotgr .main2 .form-select,
  #fizReportModal .otchetobotgr .main2 select,
  #fizReportModal .otchetobotgr .main2 input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  #fizReportModal .otchetobotgr .main2 select[name="fizkontragent"],
  #fizReportModal .otchetobotgr .main2 select[name="nalbeznal[]"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }

  #fizReportModal .otchetobotgr .main2 tr td:nth-child(1),
  #fizReportModal .otchetobotgr .main2 tr td:nth-child(2),
  #fizReportModal .otchetobotgr .main2 tr td:nth-child(7) {
    grid-column: 1 / -1;
  }

  #fizReportModal .otchetobotgr .main2 tr td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }

  #fizReportModal .otchetobotgr .main2 tr td:nth-child(6) {
    grid-column: 2;
    grid-row: 3;
  }

  #fizReportModal .otchetobotgr .main2 tr td:nth-child(5) {
    grid-column: 1;
    grid-row: 4;
  }

  #fizReportModal .otchetobotgr .main2 tr td:nth-child(4) {
    grid-column: 2;
    grid-row: 4;
  }

  #fizReportModal .otchetobotgr form > div[style*="padding-top"] {
    display: flex !important;
    gap: 8px !important;
  }

  #fizReportModal .otchetobotgr form > div[style*="padding-top"] .btn-primary2,
  #fizReportModal .otchetobotgr form > div[style*="padding-top"] .btn-danger2 {
    flex: 1 1 0 !important;
    width: auto !important;
    margin: 0 !important;
  }
}

/* Desktop: make Fiz report modal fields denser */
@media (min-width: 769px) {
  #fizReportModal .otchetobotgr .main2 tr {
    gap: 6px !important;
    grid-template-columns: minmax(170px, 1.35fr) minmax(110px, 0.85fr) minmax(105px, 0.8fr) minmax(105px, 0.8fr) minmax(105px, 0.8fr) minmax(105px, 0.8fr) 96px !important;
  }

  #fizReportModal .otchetobotgr .main2 td {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #fizReportModal .otchetobotgr .main2 .form-control,
  #fizReportModal .otchetobotgr .main2 .form-select {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* Final rebuilt Fiz report field sizing */
@media (min-width: 769px) {
  #orgReportModal .report-modal-body,
  #fizReportModal .report-modal-body {
    padding: 18px;
  }

  #orgReportModal .otchetobotgr .main {
    width: 100% !important;
    table-layout: fixed !important;
  }

  #orgReportModal .otchetobotgr .main td {
    padding: 0 6px 0 0 !important;
    vertical-align: bottom !important;
  }

  #orgReportModal .otchetobotgr .main td:nth-child(1) {
    width: auto !important;
  }

  #orgReportModal .otchetobotgr .main td:nth-child(2),
  #orgReportModal .otchetobotgr .main td:nth-child(3) {
    width: 180px !important;
  }

  #orgReportModal .otchetobotgr .main td:nth-child(4) {
    width: 104px !important;
    padding-right: 0 !important;
  }

  #orgReportModal .otchetobotgr .main select,
  #orgReportModal .otchetobotgr .main input[type="text"],
  #orgReportModal .otchetobotgr .main .form-control,
  #orgReportModal .otchetobotgr .main .form-select {
    width: 100% !important;
    max-width: 100% !important;
  }

  #fizReportModal .fiz-report-grid {
    width: 100% !important;
  }

  #fizReportModal .fiz-report-row {
    grid-template-columns:
      minmax(260px, 2fr)
      minmax(130px, .85fr)
      minmax(130px, .85fr)
      minmax(130px, .9fr)
      minmax(130px, .85fr)
      minmax(110px, .75fr)
      96px !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 10px !important;
  }

  #fizReportModal .fiz-report-row > .report-field,
  #fizReportModal .fiz-report-row > .report-actions {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  #fizReportModal .fiz-report-row > .report-field > input,
  #fizReportModal .fiz-report-row > .report-field > select,
  #fizReportModal .fiz-report-row > .report-field > .form-control,
  #fizReportModal .fiz-report-row > .report-field > .form-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* Desktop: current requests must remain a regular table */
@media (min-width: 761px) {
  .current-requests-table {
    display: table !important;
    width: 100% !important;
    min-width: 780px !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
  }

  .current-requests-table thead {
    display: table-header-group !important;
  }

  .current-requests-table tbody {
    display: table-row-group !important;
    padding: 0 !important;
  }

  .current-requests-table tr,
  .current-requests-table tbody tr {
    display: table-row !important;
    padding: 0 !important;
    border: none !important;
  }

  .current-requests-table th,
  .current-requests-table td {
    display: table-cell !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px 10px !important;
    vertical-align: middle !important;
    border-radius: 0 !important;
    white-space: nowrap !important;
  }

  .current-requests-table .cell-comment {
    white-space: normal !important;
  }

  .current-requests-table th:nth-child(1),
  .current-requests-table td:nth-child(1) {
    width: 30ch !important;
    min-width: 30ch !important;
  }

  .current-requests-table th:nth-child(2),
  .current-requests-table td:nth-child(2) {
    width: 20ch !important;
    min-width: 20ch !important;
  }

  .current-requests-table th:nth-child(3),
  .current-requests-table td:nth-child(3) {
    width: 12ch !important;
    min-width: 12ch !important;
  }

  .current-requests-table th:nth-child(4),
  .current-requests-table td:nth-child(4) {
    width: 14ch !important;
    min-width: 14ch !important;
  }

  .current-requests-table th:nth-child(5),
  .current-requests-table td:nth-child(5) {
    width: auto !important;
  }
}

/* Dark theme: readable header for current requests table */
html[data-theme="dark"] .current-requests-table thead th {
  background-color: #151920 !important;
  color: #eaf0fa !important;
  border-color: #3b3f48 !important;
}

/* Desktop: contractor check table column sizing */
@media (min-width: 761px) {
  #multi-filter-select {
    table-layout: auto !important;
    min-width: 960px !important;
  }

  #multi-filter-select th:nth-child(1),
  #multi-filter-select td:nth-child(1) {
    width: 30ch !important;
    min-width: 30ch !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  #multi-filter-select th:nth-child(2),
  #multi-filter-select td:nth-child(2) {
    width: 10ch !important;
    min-width: 10ch !important;
    white-space: nowrap !important;
  }

  #multi-filter-select th:nth-child(3),
  #multi-filter-select td:nth-child(3) {
    width: 20ch !important;
    min-width: 20ch !important;
    white-space: nowrap !important;
  }

  #multi-filter-select th:nth-child(4),
  #multi-filter-select td:nth-child(4) {
    width: auto !important;
    white-space: normal !important;
  }
}

/* Rebuilt contractor check table */
.contractor-check-section {
margin: 0 0 20px;
padding: 0;
}

.contractor-check-section > h2 {
margin: 0 0 10px;
}

@media (min-width: 761px) {
  .contractor-check-table {
    width: 100% !important;
    min-width: 760px !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
  }

  .contractor-check-table .contractor-name {
    width: 30ch !important;
    min-width: 30ch !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .contractor-check-table .contractor-inn {
    width: 10ch !important;
    min-width: 10ch !important;
    white-space: nowrap !important;
  }

  .contractor-check-table .contractor-phone {
    width: 20ch !important;
    min-width: 20ch !important;
    white-space: nowrap !important;
  }

  .contractor-check-table .contractor-cars {
    width: auto !important;
    white-space: normal !important;
  }
}

/* Mobile theme switch in visible header */
.mobile-theme-switch {
display: none;
}

.page-theme-switch {
display: none;
}

@media (max-width: 991px) {
  .mobile-theme-switch {
    display: flex !important;
    position: fixed;
    top: 14px;
    right: 48px;
    z-index: 2200;
    margin: 0;
    background: transparent;
    pointer-events: auto;
  }

  .mobile-theme-switch * {
    pointer-events: auto;
  }

  .mobile-theme-switch span {
    font-size: 12px;
  }

  .mobile-theme-switch .theme-switch {
    width: 46px;
    height: 28px;
    margin: 0 5px;
  }

  .mobile-theme-switch .slider:before {
    width: 20px;
    height: 20px;
  }

  .mobile-theme-switch input:checked + .slider:before {
    transform: translateX(18px);
  }
}

@media (max-width: 991px) {
  .main-panel .page-header,
  .page-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 12px;
    width: 100%;
    text-align: left !important;
    min-height: auto !important;
  }

  .main-panel .page-header .fw-bold,
  .page-header .fw-bold {
    margin-bottom: 0 !important;
    text-align: left !important;
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-theme-switch {
    display: flex !important;
    margin-left: auto;
    flex: 0 0 auto !important;
    white-space: nowrap;
  }

  .page-theme-switch span {
    font-size: 12px;
  }

  .page-theme-switch .theme-switch {
    width: 46px;
    height: 28px;
    margin: 0 5px;
  }

  .page-theme-switch .slider:before {
    width: 20px;
    height: 20px;
  }

  .page-theme-switch input:checked + .slider:before {
    transform: translateX(18px);
  }
}

@media (max-width: 768px) {
  input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not(.theme-checkbox),
  select,
  textarea,
  .form-control,
  .form-select,
  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select,
  .report-modal .form-control,
  .report-modal .form-select,
  .otchetobotgr .form-control,
  .otchetobotgr .form-select,
  #addRowModal .form-control,
  #editContractorModal .form-control,
  #editContractorModal .form-select,
  #editFizModal .form-control,
  #editFizModal .form-select {
    font-size: 16px !important;
  }
}

/* Report modals: make row controls and mobile report cards easier to scan */
#orgReportModal .report-actions .Knopciform,
#fizReportModal .report-actions .Knopciform,
#orgReportModal .otchetobotgr .main .Knopciform,
#fizReportModal .otchetobotgr .main2 .Knopciform {
  border-width: 1px !important;
  box-shadow: 0 6px 14px rgba(21, 27, 38, .08) !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

#orgReportModal .report-actions .Knopciform[name="drop"],
#fizReportModal .report-actions .Knopciform[name="drop"],
#orgReportModal .otchetobotgr .main .Knopciform[name="drop"],
#fizReportModal .otchetobotgr .main2 .Knopciform[name="drop"] {
  background: #f7dfdc !important;
  border-color: #e7aaa2 !important;
  color: #8f3029 !important;
}

#orgReportModal .report-actions .Knopciform:not([name="drop"]),
#fizReportModal .report-actions .Knopciform:not([name="drop"]),
#orgReportModal .otchetobotgr .main .Knopciform:not([name="drop"]),
#fizReportModal .otchetobotgr .main2 .Knopciform:not([name="drop"]) {
  background: #dcefe5 !important;
  border-color: #9fceb5 !important;
  color: #1f6840 !important;
}

#orgReportModal .report-actions .Knopciform:hover,
#fizReportModal .report-actions .Knopciform:hover,
#orgReportModal .otchetobotgr .main .Knopciform:hover,
#fizReportModal .otchetobotgr .main2 .Knopciform:hover {
  transform: translateY(-1px);
}

html[data-theme="dark"] #orgReportModal .report-actions .Knopciform[name="drop"],
html[data-theme="dark"] #fizReportModal .report-actions .Knopciform[name="drop"],
html[data-theme="dark"] #orgReportModal .otchetobotgr .main .Knopciform[name="drop"],
html[data-theme="dark"] #fizReportModal .otchetobotgr .main2 .Knopciform[name="drop"] {
  background: #3f2627 !important;
  border-color: #7d3d3e !important;
  color: #ffb7b2 !important;
}

html[data-theme="dark"] #orgReportModal .report-actions .Knopciform:not([name="drop"]),
html[data-theme="dark"] #fizReportModal .report-actions .Knopciform:not([name="drop"]),
html[data-theme="dark"] #orgReportModal .otchetobotgr .main .Knopciform:not([name="drop"]),
html[data-theme="dark"] #fizReportModal .otchetobotgr .main2 .Knopciform:not([name="drop"]) {
  background: #20352b !important;
  border-color: #3d7856 !important;
  color: #a9e4bf !important;
}

@media (max-width: 768px) {
  #orgReportModal .org-report-row,
  #fizReportModal .fiz-report-row,
  #orgReportModal .otchetobotgr .main tr:not(.dispb),
  #fizReportModal .otchetobotgr .main2 tr:not(.dispb) {
    padding: 12px !important;
    margin-bottom: 12px !important;
    border: 1px solid rgba(47, 125, 246, .18) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, .58) !important;
    box-shadow: 0 10px 24px rgba(21, 27, 38, .08) !important;
  }

  #orgReportModal .org-report-row + .org-report-row,
  #fizReportModal .fiz-report-row + .fiz-report-row {
    margin-top: 10px !important;
  }

  html[data-theme="dark"] #orgReportModal .org-report-row,
  html[data-theme="dark"] #fizReportModal .fiz-report-row,
  html[data-theme="dark"] #orgReportModal .otchetobotgr .main tr:not(.dispb),
  html[data-theme="dark"] #fizReportModal .otchetobotgr .main2 tr:not(.dispb) {
    background: #1a2029 !important;
    border-color: #3b4f68 !important;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .22) !important;
  }

  #orgReportModal .report-actions,
  #fizReportModal .report-actions {
    padding-top: 2px !important;
  }

  #orgReportModal .report-field label,
  #fizReportModal .report-field label {
    display: none !important;
  }

  #orgReportModal .report-actions .Knopciform,
  #fizReportModal .report-actions .Knopciform {
    flex: 1 1 0 !important;
    width: auto !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    line-height: 42px !important;
    border-radius: 10px !important;
  }

  #orgReportModal .report-modal-actions,
  #fizReportModal .report-modal-actions {
    align-items: center !important;
  }

  #orgReportModal .report-modal-actions .btn,
  #orgReportModal .report-modal-actions input.btn,
  #fizReportModal .report-modal-actions .btn,
  #fizReportModal .report-modal-actions input.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }
}

/* Calculator page styles: merged from calculator.css */
.calc-page { padding-bottom: 40px; }
.calc-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.calculator-shell { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; align-items: stretch; }
.calc-card { background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%); border: 1px solid var(--border-color); border-radius: 18px; padding: 20px; box-shadow: 0 12px 32px rgba(21, 27, 38, .07); }
.calc-section-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.calc-section-title h4, .calc-card h4 { margin: 0; font-weight: 800; color: var(--font-color); }
.calc-section-title p { margin: 4px 0 0; color: #7b8495; }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 14px; }
.calc-field-wide { grid-column: 1 / -1; }
.calc-field span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.calc-field .form-control, .calc-field .form-select { min-height: 46px; border-radius: 12px; font-size: 16px; }
.calc-switches { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.calc-check { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--border-color); border-radius: 14px; background: rgba(47, 125, 246, .055); cursor: pointer; }
.calc-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: #2f7df6; }
.calc-check b, .calc-check small { display: block; }
.calc-check small { margin-top: 3px; opacity: .72; line-height: 1.35; }
.calc-summary { display: grid; gap: 12px; }
.summary-item { border-radius: 16px; padding: 14px; background: #f4f7fb; border: 1px solid var(--border-color); }
.summary-item span, .summary-item small { display: block; opacity: .72; font-weight: 700; }
.summary-item strong { display: block; margin-top: 5px; font-size: 24px; font-weight: 900; color: #2f7df6; }
.summary-main { background: linear-gradient(135deg, #2f7df6, #65a6ff); color: #fff; border: none; }
.summary-main strong { color: #fff; font-size: 28px; }
.summary-main span, .summary-main small { opacity: .9; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.calc-card-wide { grid-column: 1 / -1; }
.calc-discount-summary h4, .calc-party-summary h4 { margin: 0 0 14px; }
.discount-summary-cards, .party-summary-cards { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; }
.discount-summary-cards .summary-main, .party-summary-cards .summary-main { grid-column: 1 / -1; }
.discount-summary-cards .summary-item:not(.summary-main) small, .party-summary-cards .summary-item:not(.summary-main) small { margin-top: 4px; }
.party-summary-cards { grid-template-columns: 1fr; }
.party-summary-cards .summary-main { grid-column: auto; }
.calc-table { margin: 14px 0 0; }
.calc-table td, .calc-table th { padding: 12px 10px !important; vertical-align: middle; border-color: var(--border-color) !important; }
.calc-table td:first-child { font-weight: 700; color: var(--font-color); }
.calc-row-muted td { opacity: .58; }
.calc-row-total td { opacity: 1; background: rgba(47, 125, 246, .08) !important; border-top: 2px solid rgba(47, 125, 246, .38) !important; border-bottom: 2px solid rgba(47, 125, 246, .22) !important; }
.calc-row-total td:first-child { font-size: 17px; font-weight: 900; color: #1d4ed8 !important; }
.calc-value { text-align: right; white-space: nowrap; font-size: 17px; font-weight: 900; color: #2f7df6 !important; }
.calc-value-main { line-height: 1.1; }
.calc-vat-note { display: block; margin-top: 5px; font-size: 11px; line-height: 1.2; font-weight: 700; color: var(--font-color); opacity: .6; }
.calc-row-total .calc-value { font-size: 24px; color: #1d4ed8 !important; }
.calc-row-total .calc-vat-note { font-size: 12px; opacity: .8; }
.calc-extra { text-align: right; white-space: nowrap; opacity: .75; }
.calc-table-head th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #f4f7fb !important; color: #344054 !important; }
html[data-theme="dark"] .calc-card { background: #1e232c; border-color: #3b3f48; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
html[data-theme="dark"] .calc-section-title p { color: #9aa3b2; }
html[data-theme="dark"] .summary-item, html[data-theme="dark"] .calc-check { background: #171c24; border-color: #3b3f48; }
html[data-theme="dark"] .calc-table-head th { background: #151920 !important; color: #eaf0fa !important; }
html[data-theme="dark"] .calc-table td { background: #171c24 !important; color: #eaf0fa !important; border-color: #3b3f48 !important; }
html[data-theme="dark"] .calc-table td:first-child { color: #eaf0fa !important; }
html[data-theme="dark"] .calc-table tbody tr:nth-child(even) td { background: #1b2028 !important; }
html[data-theme="dark"] .calc-value { color: #7db2ff !important; }
html[data-theme="dark"] .calc-row-total td { background: rgba(125, 178, 255, .12) !important; border-color: rgba(125, 178, 255, .34) !important; }
html[data-theme="dark"] .calc-row-total td:first-child, html[data-theme="dark"] .calc-row-total .calc-value { color: #9cc6ff !important; }
@media (max-width: 992px) { .calculator-shell, .results-grid, .discount-summary-cards, .party-summary-cards { grid-template-columns: 1fr; } .discount-summary-cards .summary-main, .party-summary-cards .summary-main { grid-column: auto; } }
@media (max-width: 640px) { .calc-grid, .calc-switches { grid-template-columns: 1fr; } .calc-header { align-items: flex-start; } .page-theme-switch { display: none; } }

.calc-admin-settings { margin-top: 26px; opacity: .92; }
.calc-settings-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px dashed var(--border-color); border-radius: 16px; padding: 14px 16px; background: color-mix(in srgb, var(--bg-color) 92%, #ffffff 8%); color: var(--font-color); font-weight: 800; cursor: pointer; }
.calc-settings-toggle span { display: inline-flex; align-items: center; gap: 9px; }
.calc-settings-toggle small { font-weight: 700; opacity: .58; }
.calc-settings-toggle.is-open { border-style: solid; background: rgba(47, 125, 246, .075); }
.calc-settings-body { margin-top: 12px; border: 1px solid var(--border-color); border-radius: 18px; padding: 18px; background: color-mix(in srgb, var(--bg-color) 88%, #ffffff 12%); }
.calc-settings-note { margin-bottom: 14px; font-weight: 700; opacity: .72; }
.calc-settings-grid { display: grid; gap: 14px; margin-top: 14px; }
.calc-settings-grid:first-of-type { margin-top: 0; }
.calc-settings-grid-row5 { grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.calc-settings-grid-row4 { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.calc-settings-grid-row3 { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
.calc-settings-grid-row2 { grid-template-columns: repeat(2, minmax(150px, 1fr)); max-width: calc(50% - 7px); }
.calc-settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.calc-settings-saved { font-weight: 800; color: #1f9d55; min-width: 86px; }
html[data-theme="dark"] .calc-settings-toggle, html[data-theme="dark"] .calc-settings-body { background: #171c24; border-color: #3b3f48; }
html[data-theme="dark"] .calc-settings-toggle.is-open { background: rgba(47, 125, 246, .14); }
@media (max-width: 992px) { .calc-settings-grid-row5, .calc-settings-grid-row4, .calc-settings-grid-row3, .calc-settings-grid-row2 { grid-template-columns: repeat(2, minmax(150px, 1fr)); max-width: none; } }
@media (max-width: 640px) { .calc-settings-toggle { align-items: flex-start; flex-direction: column; } .calc-settings-grid-row5, .calc-settings-grid-row4, .calc-settings-grid-row3, .calc-settings-grid-row2 { grid-template-columns: 1fr; max-width: none; } .calc-settings-actions { align-items: stretch; flex-direction: column; justify-content: stretch; } .calc-settings-actions .btn { width: 100%; } .calc-settings-saved { text-align: center; min-width: 0; } }

/* v5 layout updates */
.calc-left-column { display: grid; gap: 18px; }
.calc-grid-params { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
.calc-discount-card .calc-section-title { margin-bottom: 14px; }
.discount-metrics { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.discount-metrics .summary-item strong { font-size: 14px; }
.discount-metrics .summary-item small { margin-top: 4px; line-height: 1.25; }
.calc-plain-summary h4 { margin: 0 0 14px; }
.plain-summary-cards { display: grid; gap: 12px; }
.summary-muted { opacity: .72; }
.summary-muted strong { font-size: 20px; color: var(--font-color); opacity: .74; }
.calc-plain-summary .summary-item:not(.summary-main) strong,
.discount-summary-cards .summary-item:not(.summary-main) strong,
.party-summary-cards .summary-item:not(.summary-main) strong { font-size: 14px; }
.calc-plain-summary .summary-item:not(.summary-main) small { font-size: 12px; }
.calc-plain-summary .summary-review strong { color: var(--font-color); opacity: .74; }
.calc-plain-summary .summary-main { box-shadow: 0 14px 28px rgba(47, 125, 246, .18); }
.calc-plain-summary .summary-main strong { font-size: 30px; }
.calc-plain-summary .summary-item:not(.summary-main) small { margin-top: 4px; }
.calc-check span { min-height: 22px; display: flex; align-items: center; }
@media (max-width: 992px) { .discount-metrics { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .calc-grid-params { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  .calc-page {
    padding-bottom: 20px;
  }

  .calc-header {
    margin-bottom: 8px;
  }

  .calc-header h3 {
    font-size: 22px;
    line-height: 1.15;
  }

  .calculator-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .calc-left-column {
    display: contents;
  }

  .calc-inputs {
    order: 1;
  }

  .calc-plain-summary {
    order: 2;
  }

  .calc-discount-card {
    order: 3;
  }

  .results-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .calc-card {
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 22px rgba(21, 27, 38, .05);
  }

  .calc-section-title,
  .calc-plain-summary h4,
  .calc-discount-summary h4,
  .calc-party-summary h4,
  .calc-card h4 {
    margin-bottom: 10px;
  }

  .calc-section-title h4,
  .calc-card h4 {
    font-size: 18px;
  }

  .calc-grid,
  .calc-switches,
  .discount-metrics,
  .plain-summary-cards,
  .discount-summary-cards,
  .party-summary-cards {
    gap: 8px;
  }

  .calc-field span {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .calc-field .form-control,
  .calc-field .form-select {
    min-height: 38px;
    border-radius: 10px;
    font-size: 16px;
  }

  .calc-grid-params {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-grid-params .calc-field-wide {
    grid-column: 1 / -1;
  }

  .calc-check {
    align-items: center;
    padding: 10px;
    border-radius: 12px;
  }

  .calc-check input {
    width: 18px;
    height: 18px;
    margin-top: 0;
  }

  .summary-item {
    border-radius: 12px;
    padding: 10px;
  }

  .summary-item span,
  .summary-item small {
    font-size: 11px;
    line-height: 1.25;
  }

  .summary-item strong {
    margin-top: 3px;
    font-size: 19px;
  }

  .calc-plain-summary .summary-item:not(.summary-main) strong,
  .discount-metrics .summary-item strong,
  .discount-summary-cards .summary-item:not(.summary-main) strong,
  .party-summary-cards .summary-item:not(.summary-main) strong {
    font-size: 12px;
  }

  .calc-plain-summary .summary-item:not(.summary-main) small {
    font-size: 10px;
  }

  .summary-main strong,
  .calc-plain-summary .summary-main strong {
    font-size: 24px;
  }

  .calc-plain-summary .plain-summary-cards,
  .discount-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-plain-summary .summary-main,
  .discount-summary-cards .summary-main {
    grid-column: 1 / -1;
  }

  .calc-plain-summary .summary-main {
    grid-column: auto;
  }

  .calc-table {
    margin-top: 10px;
  }

  .calc-table td,
  .calc-table th {
    padding: 8px 7px !important;
    font-size: 12px;
  }

  .calc-admin-settings {
    margin-top: 14px;
  }
}

@media (min-width: 993px) {
  .calculator-shell {
    align-items: start;
    gap: 12px;
    grid-template-columns: minmax(0, 1.35fr) minmax(420px, 1fr);
  }

  .calc-left-column {
    gap: 12px;
  }

  .results-grid {
    gap: 12px;
    margin-top: 12px;
  }

  .calc-card {
    padding: 16px;
    border-radius: 16px;
  }

  .calc-section-title {
    margin-bottom: 12px;
  }

  .calc-section-title h4,
  .calc-card h4 {
    font-size: 20px;
  }

  .calc-grid {
    gap: 10px;
  }

  .calc-field span {
    margin-bottom: 5px;
  }

  .calc-field .form-control,
  .calc-field .form-select {
    min-height: 40px;
    border-radius: 10px;
    font-size: 16px;
  }

  .calc-switches {
    gap: 10px;
    margin-top: 12px;
  }

  .calc-check {
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .calc-check input {
    width: 18px;
    height: 18px;
    margin-top: 0;
  }

  .discount-metrics {
    gap: 10px;
    margin-top: 12px;
  }

  .summary-item {
    padding: 11px 12px;
    border-radius: 13px;
  }

  .summary-item strong {
    font-size: 21px;
  }

  .calc-plain-summary .summary-item:not(.summary-main) strong,
  .discount-metrics .summary-item strong,
  .discount-summary-cards .summary-item:not(.summary-main) strong,
  .party-summary-cards .summary-item:not(.summary-main) strong {
    font-size: 14px;
  }

  .calc-plain-summary .summary-item:not(.summary-main) small {
    font-size: 12px;
  }

  .summary-item span,
  .summary-item small {
    line-height: 1.25;
  }

  .summary-main strong,
  .calc-plain-summary .summary-main strong {
    font-size: 26px;
  }

  .plain-summary-cards,
  .discount-summary-cards,
  .party-summary-cards {
    gap: 10px;
  }

  .calc-discount-summary {
    padding: 14px;
  }

  .calc-discount-summary h4 {
    margin-bottom: 10px;
  }

  .calc-discount-summary .summary-item {
    padding: 9px 11px;
    border-radius: 12px;
  }

  .calc-discount-summary .summary-item span,
  .calc-discount-summary .summary-item small {
    font-size: 11px;
  }

  .calc-discount-summary .summary-item strong {
    margin-top: 3px;
    font-size: 14px;
  }

  .calc-discount-summary .summary-main strong {
    font-size: 24px;
  }

  .calc-plain-summary .plain-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-plain-summary .summary-main {
    grid-column: auto;
  }

  .calc-plain-summary .summary-review {
    background: rgba(47, 125, 246, .075);
    border-color: rgba(47, 125, 246, .22);
  }

  .calc-plain-summary .summary-review strong {
    color: var(--font-color);
    opacity: .74;
  }

  .calc-party-summary {
    align-self: start;
  }

  .party-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .party-summary-cards .summary-main {
    grid-column: 1 / -1;
  }

  .party-summary-cards .summary-main strong {
    font-size: 26px;
  }
}
