/*
 * Читаемый текст на iPhone/iPad (Safari + Chrome).
 * Подключать ПОСЛЕДНИМ в <head>. Класс sigma-ios — js/mobile-legible.js
 *
 * Inter Variable на кириллице в iOS Chrome выглядит слишком тонко — system-ui + жирнее.
 */

html.sigma-ios {
    -webkit-font-smoothing: auto !important;
    text-rendering: optimizeLegibility !important;
}

html.sigma-ios body,
html.sigma-ios body *:not(svg):not(svg *):not(path):not(circle):not(rect):not(line):not(polyline):not(polygon):not(use) {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif !important;
    font-variation-settings: normal !important;
    font-feature-settings: normal !important;
    font-synthesis: weight style !important;
    -webkit-font-smoothing: auto !important;
}

html.sigma-ios body {
    opacity: 1 !important;
    color: #1d1d1f !important;
    font-weight: 500 !important;
}

html.sigma-ios .font-normal { font-weight: 500 !important; }
html.sigma-ios .font-medium { font-weight: 600 !important; }
html.sigma-ios .font-semibold { font-weight: 650 !important; }
html.sigma-ios .font-bold { font-weight: 700 !important; }

html.sigma-ios h1,
html.sigma-ios h2,
html.sigma-ios h3,
html.sigma-ios h4,
html.sigma-ios h5,
html.sigma-ios h6,
html.sigma-ios strong,
html.sigma-ios b {
    font-weight: 700 !important;
}

/* Tailwind gray — как на ПК по контрасту, но жирнее начертание */
html.sigma-ios .text-gray-300 { color: #d1d5db !important; font-weight: 500 !important; }
html.sigma-ios .text-gray-400 { color: #9ca3af !important; font-weight: 600 !important; }
html.sigma-ios .text-gray-500 { color: #6b7280 !important; font-weight: 600 !important; }
html.sigma-ios .text-gray-600 { color: #4b5563 !important; font-weight: 600 !important; }
html.sigma-ios .text-gray-700 { color: #374151 !important; font-weight: 600 !important; }
html.sigma-ios .text-gray-800 { color: #1f2937 !important; font-weight: 600 !important; }
html.sigma-ios .text-gray-900 { color: #111827 !important; font-weight: 600 !important; }

html.sigma-ios label.text-gray-400,
html.sigma-ios label.text-gray-500,
html.sigma-ios .text-xs.font-bold.text-gray-400,
html.sigma-ios .text-xs.font-bold.text-gray-500,
html.sigma-ios label.block.text-xs.font-bold.text-gray-400,
html.sigma-ios label.block.text-xs.font-bold.text-gray-500 {
    color: #4b5563 !important;
    font-weight: 700 !important;
}

html.sigma-ios input,
html.sigma-ios textarea,
html.sigma-ios select {
    color: #1d1d1f !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

html.sigma-ios input::placeholder,
html.sigma-ios textarea::placeholder {
    color: #6b7280 !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

html.sigma-ios .reveal,
html.sigma-ios .reveal.active {
    opacity: 1 !important;
}

/* ——— Футер ——— */
html.sigma-ios .site-layout-footer ul,
html.sigma-ios .site-layout-footer ul a,
html.sigma-ios .site-layout-footer .footer-address-lines,
html.sigma-ios .site-layout-footer .text-gray-500,
html.sigma-ios .site-layout-footer .space-y-3 {
    color: #6b7280 !important;
    font-weight: 600 !important;
}

html.sigma-ios .site-layout-footer h4,
html.sigma-ios .site-layout-footer .font-bold.text-gray-900 {
    color: #111827 !important;
    font-weight: 800 !important;
}

html.sigma-ios .site-layout-footer .text-gray-400,
html.sigma-ios .site-layout-footer .site-layout-footer__bottom p {
    color: #9ca3af !important;
    font-weight: 600 !important;
}

html.sigma-ios .site-layout-footer .font-bold.text-gray-900.group-hover\:text-blue-600 {
    font-weight: 700 !important;
}

/* ——— Контакты ——— */
html.sigma-ios .contact-section-title {
    color: #4b5563 !important;
    font-weight: 800 !important;
}

html.sigma-ios .contact-method-label {
    color: #374151 !important;
    font-weight: 700 !important;
}

html.sigma-ios .contact-qr-caption {
    color: #4b5563 !important;
    font-weight: 700 !important;
}

html.sigma-ios .legal-info-heading,
html.sigma-ios .legal-address-title {
    color: #374151 !important;
    font-weight: 800 !important;
}

html.sigma-ios .legal-info-lines,
html.sigma-ios .legal-info-lines p {
    color: #4b5563 !important;
    font-weight: 600 !important;
}

html.sigma-ios .legal-info-icon {
    color: #4b5563 !important;
}

/* ——— Админка: подписи, фильтры, статусы ——— */
html.sigma-ios .admin-card label.text-gray-400,
html.sigma-ios .admin-card label.text-gray-500,
html.sigma-ios .admin-card h2.text-gray-500 {
    color: #4b5563 !important;
    font-weight: 700 !important;
}

html.sigma-ios .admin-card input,
html.sigma-ios .admin-card select,
html.sigma-ios .admin-card textarea {
    font-weight: 500 !important;
    color: #1d1d1f !important;
}

html.sigma-ios .admin-bottom-nav__item {
    font-weight: 700 !important;
    color: #48484a !important;
}

html.sigma-ios #cargo-list-tab .status-filter-btn {
    color: #4b5563 !important;
    font-weight: 800 !important;
}

html.sigma-ios #cargo-list-tab .status-filter-btn.is-active {
    color: #ffffff !important;
}

html.sigma-ios #cargo-list-tab .cargo-status-chip {
    font-weight: 800 !important;
    font-size: 10px !important;
}

html.sigma-ios #cargo-list-tab .cargo-status-chip--blue {
    color: #1d4ed8 !important;
    background-color: #bfdbfe !important;
}

html.sigma-ios #cargo-list-tab .cargo-status-chip--blue.is-active {
    color: #ffffff !important;
    background-color: #2563eb !important;
}

html.sigma-ios #cargo-list-tab .cargo-status-chip--yellow {
    color: #92400e !important;
    background-color: #fde68a !important;
}

html.sigma-ios #cargo-list-tab .cargo-status-chip--yellow.is-active {
    color: #ffffff !important;
    background-color: #ca8a04 !important;
}

html.sigma-ios #cargo-list-tab .cargo-status-chip--green {
    color: #166534 !important;
    background-color: #bbf7d0 !important;
}

html.sigma-ios #cargo-list-tab .cargo-status-chip--green.is-active {
    color: #ffffff !important;
    background-color: #16a34a !important;
}

html.sigma-ios .status-select,
html.sigma-ios select.status-select,
html.sigma-ios #shipments-tab select,
html.sigma-ios .multi-part-status {
    color: #1d1d1f !important;
    font-weight: 600 !important;
}

html.sigma-ios .tab-link.text-gray-400 {
    color: #6b7280 !important;
    font-weight: 700 !important;
}

html.sigma-ios .tab-link.text-black {
    font-weight: 800 !important;
}

/* ЛК: статусы грузов */
html.sigma-ios .shipment-status {
    font-weight: 700 !important;
}

html.sigma-ios .shipment-status.bg-inprogress {
    color: #1d4ed8 !important;
    background: #bfdbfe !important;
}

html.sigma-ios .shipment-status.bg-done {
    color: #15803d !important;
    background: #bbf7d0 !important;
}

html.sigma-ios .shipment-status.bg-other {
    color: #374151 !important;
    background: #e5e7eb !important;
}

/* Главная: списки услуг */
html.sigma-ios ul.text-gray-400,
html.sigma-ios ul.text-gray-400 li {
    color: #6b7280 !important;
    font-weight: 600 !important;
}

html.sigma-ios .text-sm.text-gray-500 {
    color: #6b7280 !important;
    font-weight: 600 !important;
}

@media (max-width: 767px) {
    html.sigma-ios #cargo-list-tab .admin-cargo-status-filters .cargo-status-chip {
        font-size: 10px !important;
        font-weight: 800 !important;
    }
}

/*
 * Админка (body.admin-shell) + тёмная тема (html.dark).
 * Одна схема для iPhone, Android и любого браузера: sigma-ios выше не перебивает светлый текст.
 */
html.dark body.admin-shell {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

html.dark body.admin-shell .admin-content-wrap h2 {
    color: #f4f4f5 !important;
    -webkit-text-fill-color: #f4f4f5 !important;
}

html.dark body.admin-shell .admin-card label.text-gray-400,
html.dark body.admin-shell .admin-card .text-xs.font-bold.text-gray-400,
html.dark body.admin-shell .admin-card h2.text-gray-500,
html.dark body.admin-shell #team-tab p.text-gray-500,
html.dark body.admin-shell #team-tab .admin-card .text-gray-500 {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

html.dark body.admin-shell .text-gray-300,
html.dark body.admin-shell .text-gray-400,
html.dark body.admin-shell .text-gray-500,
html.dark body.admin-shell .text-gray-600,
html.dark body.admin-shell .text-gray-700,
html.dark body.admin-shell .text-gray-800,
html.dark body.admin-shell .text-gray-900 {
    color: #d1d5db !important;
    -webkit-text-fill-color: #d1d5db !important;
}

html.dark body.admin-shell .admin-card .bg-gray-50\/80,
html.dark body.admin-shell .admin-card .multi-truck-mode-block {
    background-color: #1e1e1e !important;
    border-color: #3f3f46 !important;
}

html.dark body.admin-shell .admin-card .multi-truck-mode-block .text-gray-800,
html.dark body.admin-shell .admin-card .multi-truck-mode-block .text-gray-500 {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

html.dark body.admin-shell .text-blue-600:not(.text-white),
html.dark body.admin-shell .text-blue-700:not(.text-white),
html.dark body.admin-shell .text-blue-800,
html.dark body.admin-shell [class*="text-blue-"]:not(.text-white):not([class*="bg-blue-"]) {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

html.dark body.admin-shell #cargo-list-tab thead th,
html.dark body.admin-shell #cargo-list-tab thead th.text-gray-400 {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

html.dark body.admin-shell #chat-tab .admin-card h2.text-gray-500,
html.dark body.admin-shell #guest-support-tab .admin-card h2.text-gray-500 {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

html.dark body.admin-shell #chat-tab #chatsList .text-gray-400,
html.dark body.admin-shell #chat-tab #chatsList .vk-convo-preview,
html.dark body.admin-shell #guest-support-tab #guestSupportList .vk-convo-preview,
html.dark body.admin-shell #guest-support-tab #guestSupportList .text-gray-400 {
    color: #d1d5db !important;
    -webkit-text-fill-color: #d1d5db !important;
}

html.dark body.admin-shell #chat-tab #chatsList .vk-convo-time,
html.dark body.admin-shell #guest-support-tab #guestSupportList .vk-convo-time {
    color: #a1a1aa !important;
    -webkit-text-fill-color: #a1a1aa !important;
}

html.dark body.admin-shell #chat-tab .chat-list-pin-mode-btn,
html.dark body.admin-shell #guest-support-tab .chat-list-pin-mode-btn {
    color: #f4f4f5 !important;
    -webkit-text-fill-color: #f4f4f5 !important;
}

html.dark body.admin-shell #chat-tab #chatsList .chat-row-avatar,
html.dark body.admin-shell #guest-support-tab #guestSupportList .chat-row-avatar {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
    background-color: #3f3f46 !important;
}

html.dark body.admin-shell .admin-card input,
html.dark body.admin-shell .admin-card select,
html.dark body.admin-shell .admin-card textarea {
    color: #f4f4f5 !important;
    -webkit-text-fill-color: #f4f4f5 !important;
}

html.dark body.admin-shell #cargo-list-tab .cargo-status-chip--blue:not(.is-active) {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

html.dark body.admin-shell .admin-bottom-nav__item {
    color: #aeaeb2 !important;
    -webkit-text-fill-color: #aeaeb2 !important;
}

html.dark body.admin-shell .admin-bottom-nav__item--active {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html.dark body.admin-shell .admin-logout-btn {
    color: #f87171 !important;
    -webkit-text-fill-color: #f87171 !important;
    background-color: rgba(69, 10, 10, 0.55) !important;
    border: 1px solid rgba(248, 113, 113, 0.45) !important;
}

html.dark body.admin-shell .admin-logout-btn:hover {
    color: #fca5a5 !important;
    -webkit-text-fill-color: #fca5a5 !important;
    background-color: rgba(127, 29, 29, 0.65) !important;
}
