/* =====================================================================
   НІЧНА ТЕМА — те саме світле оформлення, затемнене, у пастельних кольорах.
   Діє лише коли <html data-theme="dark"> (перемикач ☀/☾ у правому верхньому куті).
   Палітра: фон сторінки #1f2329, картка #282d35, лінії #3d4450,
            текст #cfd4dc, другорядний #9aa3ae, акцент (пастельно-блакитний) #9dbbe8.
   ===================================================================== */

html[data-theme="dark"] body { background: #1f2329; color: #cfd4dc; }
html[data-theme="dark"] #page { background: #282d35; border-color: #3d4450; }
html[data-theme="dark"] #footer { border-top-color: #3d4450; }
html[data-theme="dark"] #logo { color: #d6dbe2; }

/* посилання */
html[data-theme="dark"] a,
html[data-theme="dark"] a:visited { color: #8fb4ef; }
html[data-theme="dark"] a:hover { color: #b7cff5; }

/* заголовки */
html[data-theme="dark"] .container h1,
html[data-theme="dark"] h1,
html[data-theme="dark"] #page-card-view h2 { color: #9dbbe8; }
html[data-theme="dark"] .container h2,
html[data-theme="dark"] h2, html[data-theme="dark"] h3 { color: #c3c9d2; }
html[data-theme="dark"] #content .header { border-bottom-color: #3d4450; }
html[data-theme="dark"] hr { background: #3d4450; color: #3d4450; }

/* праве верхнє меню */
html[data-theme="dark"] #right-menu,
html[data-theme="dark"] #right-menu p { color: #9aa3ae; }
html[data-theme="dark"] #right-menu a { color: #8fb4ef; }
html[data-theme="dark"] .lang-switch b { color: #e3e7ec; }
html[data-theme="dark"] .theme-switch { color: #f1d38a !important; }

/* головне меню — приглушений синьо-сірий замість яскравого синього */
html[data-theme="dark"] .nav-bar { background: #34485d; border-top-color: #2a3949; border-bottom-color: #2a3949; }
html[data-theme="dark"] #nav li { background: none; border-left: 1px solid #2f4154; }
html[data-theme="dark"] #nav li:first-child { border-left: 0; }
html[data-theme="dark"] #nav li a { color: #e1e7ee; }
html[data-theme="dark"] #nav > li.active > a,
html[data-theme="dark"] #nav > li > a:hover { background: #46607c; }
html[data-theme="dark"] #nav ul { border-color: #46607c; }
html[data-theme="dark"] #nav ul li { background: #2d3540; border-bottom-color: #46607c; color: #cfd4dc; }
html[data-theme="dark"] #nav ul li a { color: #d6dce4; }
html[data-theme="dark"] #nav ul li:hover { background: #38424f; }
html[data-theme="dark"] #mainmenu { background: #34485d; }

/* поля вводу */
html[data-theme="dark"] input[type=text],
html[data-theme="dark"] input[type=password],
html[data-theme="dark"] input[type=number],
html[data-theme="dark"] input:not([type]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
	background: #1f242b; color: #dfe3e8; border: 1px solid #4a525e;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus { border-color: #8fb4ef; outline: none; }
html[data-theme="dark"] input[disabled], html[data-theme="dark"] select[disabled] { opacity: .6; }
html[data-theme="dark"] option { background: #1f242b; color: #dfe3e8; }
html[data-theme="dark"] label { color: #c3c9d2; }
html[data-theme="dark"] .form .note, html[data-theme="dark"] .hint { color: #9aa3ae; }

/* таблиці (CGridView) */
html[data-theme="dark"] .grid-view table.items { background: #282d35; border-color: #3d4450; }
html[data-theme="dark"] .grid-view table.items th,
html[data-theme="dark"] .grid-view table.items td { border-color: #3d4450; color: #cfd4dc; }
html[data-theme="dark"] .grid-view table.items thead,
html[data-theme="dark"] .grid-view table.items th { background: #333a45; }
html[data-theme="dark"] .grid-view table.items th a { color: #d6dce4; }
html[data-theme="dark"] .grid-view tr.filters td { background: #2b3139; }
html[data-theme="dark"] .grid-view table.items tr.odd { background: #2a323b; }
html[data-theme="dark"] .grid-view table.items tr.even { background: #2c3630; }
html[data-theme="dark"] .grid-view table.items tr.selected { background: #3a4a35; }
html[data-theme="dark"] .grid-view .filters input,
html[data-theme="dark"] .grid-view .filters select { border-color: #4a525e; }
html[data-theme="dark"] .grid-view .summary, html[data-theme="dark"] .grid-view .empty { color: #9aa3ae; }
html[data-theme="dark"] .grid-view .error-cell,
html[data-theme="dark"] #operations-grid .warning-cell { color: #eca3a3; }
/* звичайні таблиці (картка, звіти) */
html[data-theme="dark"] table, html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: #3d4450; }
html[data-theme="dark"] th { color: #d6dce4; }
html[data-theme="dark"] tbody tr:nth-child(even) td { background: transparent; }

/* кольори операцій — пастельні, але помітні на темному фоні */
html[data-theme="dark"] #operations-grid .oper-refill   { color: #e7aaaa; }
html[data-theme="dark"] #operations-grid .oper-autonom  { color: #f0a0a0; }
html[data-theme="dark"] #operations-grid .oper-service  { color: #9fd9b4; }
html[data-theme="dark"] #operations-grid .oper-move     { color: #bfaeee; }
html[data-theme="dark"] [style*="color: maroon"], html[data-theme="dark"] [style*="color:maroon"] { color: #e7aaaa !important; }

/* фільтри звітів */
html[data-theme="dark"] .filter { background: #2d3540; }
html[data-theme="dark"] div.search-form, html[data-theme="dark"] div.view { background: #2b3139; border-color: #3d4450; }

/* сторінки (пейджер) */
html[data-theme="dark"] ul.yiiPager a:link,
html[data-theme="dark"] ul.yiiPager a:visited { border-color: #4b5a75; color: #9dbbe8; }
html[data-theme="dark"] ul.yiiPager a:hover { border-color: #9dbbe8; }
html[data-theme="dark"] ul.yiiPager .selected a { background: #46607c; color: #f1f4f8; }
html[data-theme="dark"] ul.yiiPager .hidden a { border-color: #3d4450; color: #6f7883; }

/* повідомлення */
html[data-theme="dark"] div.flash-success { background: #2e3a2b; color: #c8dcb4; border-color: #4d6342; }
html[data-theme="dark"] div.flash-error   { background: #3d2c2e; color: #eab4b4; border-color: #6a4448; }
html[data-theme="dark"] div.flash-notice  { background: #3b3626; color: #e6d9a6; border-color: #6a5f3a; }
html[data-theme="dark"] .errorSummary { background: #3d2c2e; color: #eab4b4; border-color: #6a4448; }
html[data-theme="dark"] .errorMessage { color: #eca3a3; }
html[data-theme="dark"] #page #notice { border-color: #4a525e; color: #eca3a3; }

/* кнопки і віджети jQuery UI (кнопки, календар, автодоповнення) */
html[data-theme="dark"] .ui-state-default,
html[data-theme="dark"] .ui-widget-content .ui-state-default,
html[data-theme="dark"] .ui-button { background-color: #363e49; border-color: #4f5866; color: #e1e5ea; }
html[data-theme="dark"] .ui-state-hover,
html[data-theme="dark"] .ui-widget-content .ui-state-hover,
html[data-theme="dark"] .ui-state-focus { background-color: #424b57; border-color: #66717f; color: #f1f4f8; }
html[data-theme="dark"] .ui-state-active,
html[data-theme="dark"] .ui-widget-content .ui-state-active { background-color: #46607c; border-color: #5d7a98; color: #f1f4f8; }
html[data-theme="dark"] .ui-state-highlight,
html[data-theme="dark"] .ui-widget-content .ui-state-highlight { background-color: #4a5a3a; border-color: #6a7d52; color: #eef3e6; }
html[data-theme="dark"] .ui-widget-content { background-color: #282d35; border-color: #3d4450; color: #cfd4dc; }
html[data-theme="dark"] .ui-widget-header { background-color: #333a45; border-color: #3d4450; color: #e1e5ea; }
html[data-theme="dark"] .ui-button-text { color: inherit; }
html[data-theme="dark"] .toolbar .tb-btn { background-color: #d9dee5; border-radius: 3px; }   /* іконка XLS лишається читабельною */
html[data-theme="dark"] .ui-menu .ui-menu-item a.ui-state-hover { background-color: #424b57; color: #f1f4f8; }

/* дрібниці */
html[data-theme="dark"] .checkboxlist label, html[data-theme="dark"] .checkboxlist span { color: #cfd4dc; }
html[data-theme="dark"] .portlet-content { background: #2b3139; }
html[data-theme="dark"] .portlet-decoration { background: #333a45; border-left-color: #46607c; }
html[data-theme="dark"] ::selection { background: #46607c; color: #fff; }

/* jQuery UI малює фон картинками-градієнтами — у нічній темі прибираємо їх (лишаємо колір) */
html[data-theme="dark"] .ui-state-default, html[data-theme="dark"] .ui-widget-content .ui-state-default,
html[data-theme="dark"] .ui-state-hover, html[data-theme="dark"] .ui-widget-content .ui-state-hover, html[data-theme="dark"] .ui-state-focus,
html[data-theme="dark"] .ui-state-active, html[data-theme="dark"] .ui-widget-content .ui-state-active,
html[data-theme="dark"] .ui-state-highlight, html[data-theme="dark"] .ui-widget-content .ui-state-highlight,
html[data-theme="dark"] .ui-widget-content, html[data-theme="dark"] .ui-widget-header { background-image: none; }
/* ...але іконки-кнопки (XLS) повертаємо */
html[data-theme="dark"] .toolbar .xls-tb-btn { background-image: url("../images/btn-xls-2.png"); background-size: cover; }
html[data-theme="dark"] .toolbar .xls-tb-btn.ui-state-hover { background-image: url("../images/btn-xls-1.png"); }
html[data-theme="dark"] .toolbar .del-tb-btn { background-image: url("../images/btn-del.png"); background-repeat: no-repeat; }
/* календар */
html[data-theme="dark"] .ui-datepicker { border-color: #3d4450; }
html[data-theme="dark"] .ui-datepicker th { color: #c3c9d2; }

/* картка/деталі (CDetailView): таблиці «Реєстраційна інформація», «Ліміти», «Баланс» */
html[data-theme="dark"] table.detail-view tr.odd  { background: #2a323b; }
html[data-theme="dark"] table.detail-view tr.even { background: #2e343d; }
html[data-theme="dark"] table.detail-view th { color: #9aa3ae; }
html[data-theme="dark"] table.detail-view td { color: #dfe3e8; }
html[data-theme="dark"] table.detail-view th, html[data-theme="dark"] table.detail-view td { border-color: #3d4450; }

/* стан резервуарів — картки */
html[data-theme="dark"] .tank-card { background: #2b3139; border-color: #3d4450; box-shadow: none; color: #cfd4dc; }
html[data-theme="dark"] .tank-card .tc-head { border-bottom-color: #3d4450; }
html[data-theme="dark"] .tank-card .tc-name { color: #9dbbe8; }
html[data-theme="dark"] .tank-card .tc-fuel { color: #dfe3e8; }
html[data-theme="dark"] .tank-card .tc-fuel i { border-color: rgba(255,255,255,.35); }
html[data-theme="dark"] .tank-card .tc-vol { color: #9aa3ae; }
html[data-theme="dark"] .tank-card .tc-vol b, html[data-theme="dark"] .tank-card table.tc-data td { color: #e3e7ec; }
html[data-theme="dark"] .tank-card table.tc-data th { color: #9aa3ae; }
html[data-theme="dark"] .tank-card table.tc-data th, html[data-theme="dark"] .tank-card table.tc-data td { border-bottom-color: #3d4450; }
html[data-theme="dark"] .tank-card .tc-unit, html[data-theme="dark"] .tank-card .tc-src { color: #8a939e; }
html[data-theme="dark"] .tank-card tr.tc-bad td, html[data-theme="dark"] .tank-card tr.tc-bad th,
html[data-theme="dark"] .tank-card .tc-vol.tc-bad b { color: #eca3a3; }
html[data-theme="dark"] .tank-gauge .tg-empty { fill: #c9d3dd; }      /* світла «порожнеча» — темне паливо добре видно */
html[data-theme="dark"] .tank-gauge .tg-outline { stroke: #7d8a99; }
html[data-theme="dark"] #tank-state-view h2, html[data-theme="dark"] #tank-state-view a { color: #9dbbe8; }
