body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    color: #000;
    font-size: 16px;
}

.container {
    margin: 0 auto;
    max-width: 1300px;
    padding: 0 40px;
    width: 100%;
    box-sizing: border-box;
}

@media screen and (max-width: 991px) {
    body {
        font-size: 18px;
    }
    
    .container {
        padding: 0 16px;
    }
}

h1 {
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 15px;
}

h3 {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 15px;
}

@media screen and (max-width: 991px) {
    h1 {
        font-size: 28px;
    }
    h3 {
        font-size: 24px;
    }
}

/* Статус пинга */
.ping-status {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 24px;
    cursor: pointer;
    display: inline-block;
    background: none;
}

.ping-status.ok {
    background: none;
    color: #155724;
}

.ping-status.error {
    background: none;
    color: #721c24;
}

.ping-message {
    font-size: 14px;
    margin-left: 10px;
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
}

.ping-message.hidden {
    display: none;
}

/* Форма поиска */
.search-form {
    margin: 30px 0;
}

.form-section {
    background: #f5f5f5;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 4px;
}

@media screen and (max-width: 991px) {
    .form-section {
        padding: 20px;
    }
}

.form-section h3 {
    margin: 0 0 20px 0;
    color: #0030ac;
    font-size: 22px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 25px;
}

@media screen and (max-width: 991px) {
    .form-group {
        margin-bottom: 30px;
    }
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 400;
    color: #000;
    font-size: 16px;
}

@media screen and (max-width: 991px) {
    .form-group label {
        font-size: 18px;
        margin-bottom: 12px;
    }
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    background: #fff;
    border: 1px solid #e6f0f6;
    font-size: 16px;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

@media screen and (max-width: 991px) {
    .form-group input[type="text"],
    .form-group select,
    .form-group textarea {
        font-size: 18px;
        padding: 18px;
    }
}

.form-group select {
    height: 45px;
    padding: 0 15px;
    background-color: #fff;
}

@media screen and (max-width: 991px) {
    .form-group select {
        height: 54px;
    }
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

@media screen and (max-width: 991px) {
    .filters-grid {
        gap: 25px;
    }
}

.form-actions {
    text-align: right;
    margin-top: 20px;
}

.form-actions button {
    background: #0030ac;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
    font-family: Arial, Helvetica, sans-serif;
}

@media screen and (max-width: 991px) {
    .form-actions button {
        width: 100%;
        padding: 18px 30px;
        font-size: 18px;
    }
}

.form-actions button:hover {
    background: #114bde;
}

/* Карточки результатов */
.shipment-result {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.shipment-card {
    border: 1px solid #e6f0f6;
    border-radius: 0;
    overflow: hidden;
}

.shipment-header {
    background: #e6f0f6;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media screen and (max-width: 991px) {
    .shipment-header {
        padding: 18px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

.shipment-label {
    font-size: 18px;
    font-weight: 700;
    color: #0030ac;
}

@media screen and (max-width: 991px) {
    .shipment-label {
        font-size: 20px;
    }
}

.shipment-size {
    background: #0030ac;
    color: #fff;
    padding: 6px 15px;
    font-size: 14px;
}

@media screen and (max-width: 991px) {
    .shipment-size {
        font-size: 16px;
        padding: 8px 18px;
    }
}

.shipment-details {
    padding: 25px;
}

@media screen and (max-width: 991px) {
    .shipment-details {
        padding: 20px;
    }
}

.detail-row {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
}

@media screen and (max-width: 991px) {
    .detail-row {
        margin-bottom: 20px;
    }
}

.detail-label {
    font-weight: 700;
    width: 140px;
    color: #000;
}

@media screen and (max-width: 991px) {
    .detail-label {
        width: 100%;
        margin-bottom: 8px;
        font-size: 16px;
    }
    
    .detail-value {
        font-size: 18px;
        line-height: 1.4;
    }
}

.events-section {
    margin-top: 25px;
    border-top: 1px solid #e6f0f6;
    padding-top: 25px;
}

.events-section h4 {
    font-size: 17px;
    font-weight: 400;
    margin: 0 0 15px 0;
    color: #0030ac;
}

@media screen and (max-width: 991px) {
    .events-section h4 {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

.event-row {
    padding: 15px;
    background: #f5f5f5;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media screen and (max-width: 991px) {
    .event-row {
        padding: 18px;
        gap: 15px;
        flex-direction: column;
        align-items: flex-start;
    }
}

.event-type {
    font-weight: 700;
    min-width: 200px;
}

.event-time {
    color: #666;
}

.event-vehicle {
    background: #e0e0e0;
    padding: 4px 12px;
    font-size: 14px;
}

@media screen and (max-width: 991px) {
    .event-vehicle {
        font-size: 16px;
        padding: 6px 15px;
    }
}

.event-row.unloading .event-type { color: #f92b00; }
.event-row.loading .event-type { color: #0030ac; }
.event-row.yard_in .event-type { color: #000; }
.event-row.yard_out .event-type { color: #666; }

/* Ошибки и отладка */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 18px;
    margin-bottom: 20px;
    font-size: 16px;
}

@media screen and (max-width: 991px) {
    .error-message {
        padding: 20px;
        font-size: 18px;
    }
}

.debug {
    background: #f5f5f5;
    padding: 20px;
    margin-top: 20px;
    overflow-x: auto;
    font-size: 14px;
}

@media screen and (max-width: 991px) {
    .debug {
        padding: 18px;
        font-size: 16px;
    }
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #f5f5f5;
    font-size: 16px;
}

@media screen and (max-width: 991px) {
    .no-results {
        padding: 50px 20px;
        font-size: 18px;
    }
}
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.filters-header h3 {
    margin: 0;
}

.toggle-icon {
    font-size: 20px;
    color: #0030ac;
    transition: transform 0.2s;
}

.filters-section .form-section {
    padding-bottom: 25px;
}

#filtersContent {
    margin-top: 20px;
}

@media screen and (max-width: 991px) {
    .filters-header {
        padding: 5px 0;
    }
    
    .toggle-icon {
        font-size: 24px;
    }
}
.event-location {
    background: #e0e0e0;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 4px;
}

.event-quantity {
    background: #0030ac;
    color: #fff;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 4px;
}

.event-row.gate_in .event-type,
.event-row.gate_out .event-type {
    color: #856404;
}

.event-row.connection .event-type,
.event-row.disconnection .event-type {
    color: #004085;
}

.event-row.temperature_check .event-type {
    color: #155724;
}

.event-row.alarm .event-type {
    color: #721c24;
}

@media screen and (max-width: 991px) {
    .event-location,
    .event-quantity {
        font-size: 15px;
        padding: 6px 15px;
    }
}
.radio-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.radio-label span {
    font-size: 16px;
    color: #000;
}

@media screen and (max-width: 991px) {
    .radio-group {
        gap: 20px;
    }
    
    .radio-label input[type="radio"] {
        width: 22px;
        height: 22px;
    }
    
    .radio-label span {
        font-size: 18px;
    }
}
.toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

.toggle-label {
    font-size: 16px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-label.active {
    color: #0030ac;
    /* Убираем font-weight: 700 */
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #0030ac; /* синий для контейнера */
    transition: 0.4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    box-sizing: border-box;
}

.toggle-slider:before {
    position: absolute;
    content: "◀";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
}

input:checked + .toggle-slider {
    background-color: #2e7d32; /* зеленый для коносамента */
}

input:checked + .toggle-slider:before {
    content: "▶";
    transform: translateX(26px);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px #0030ac;
}

@media screen and (max-width: 991px) {
    .toggle-label {
        font-size: 18px;
    }
    
    .toggle-switch {
        width: 70px;
        height: 40px;
    }
    
    .toggle-slider:before {
        height: 32px;
        width: 32px;
        left: 4px;
        bottom: 4px;
        font-size: 16px;
    }
    
    input:checked + .toggle-slider:before {
        transform: translateX(30px);
    }
}
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e6f0f6;
    align-items: center;
}

.ping-indicator {
    margin-left: auto;
    cursor: pointer;
    position: relative;
}

.ping-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.ping-indicator.ok .ping-dot {
    background: #2e7d32;
    box-shadow: 0 0 5px rgba(46, 125, 50, 0.5);
}

.ping-indicator.error .ping-dot {
    background: #f92b00;
    box-shadow: 0 0 5px rgba(249, 43, 0, 0.5);
}

.ping-message {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e6f0f6;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 8px;
}

.ping-message.hidden {
    display: none;
}

.ping-message:before {
    content: '';
    position: absolute;
    top: -6px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e6f0f6;
    border-top: 1px solid #e6f0f6;
    transform: rotate(45deg);
}

@media screen and (max-width: 991px) {
    .ping-dot {
        width: 16px;
        height: 16px;
    }
    
    .ping-message {
        font-size: 16px;
    }
}

.tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    font-size: 18px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab.active {
    color: #0030ac;
    border-bottom-color: #0030ac;
}

.tab:hover {
    color: #0030ac;
}

.vessels-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.vessel-card {
    border: 1px solid #e6f0f6;
    overflow: hidden;
}

.vessel-header {
    background: #e6f0f6;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vessel-name {
    font-size: 18px;
    font-weight: 700;
    color: #0030ac;
}

.vessel-status {
    padding: 4px 12px;
    font-size: 14px;
}

.vessel-status.active {
    background: #2e7d32;
    color: #fff;
}

.vessel-status.finished {
    background: #666;
    color: #fff;
}

.vessel-details {
    padding: 20px;
}

.totals-section {
    margin-top: 20px;
    border-top: 1px solid #e6f0f6;
    padding-top: 20px;
}

.totals-section h4 {
    font-size: 17px;
    font-weight: 400;
    margin: 0 0 15px 0;
    color: #0030ac;
}

.total-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    background: #f5f5f5;
    margin-bottom: 5px;
    align-items: center;
}

.total-type {
    font-weight: 700;
    min-width: 80px;
}

.total-cargo {
    color: #666;
    min-width: 120px;
}

.total-count {
    background: #e0e0e0;
    padding: 2px 8px;
    font-size: 13px;
}

.total-weight {
    color: #000;
}

@media screen and (max-width: 991px) {
    .tab {
        font-size: 20px;
        padding: 12px 20px;
    }
    
    .vessel-name {
        font-size: 20px;
    }
    
    .total-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .total-type, .total-cargo {
        min-width: auto;
    }
}
.vessel-card {
    border: 1px solid #e6f0f6;
    margin-bottom: 20px;
}

.vessel-header {
    background: #e6f0f6;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.vessel-name {
    font-size: 18px;
    font-weight: 700;
    color: #0030ac;
}

.vessel-status {
    padding: 4px 12px;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
}

.vessel-status.processing {
    background: #0030ac;
}

.vessel-status.expected {
    background: #ff9800;
}

.vessel-status.finished {
    background: #666;
}

.vessel-details {
    padding: 20px;
}

.vessel-route {
    font-size: 16px;
    color: #0030ac;
    margin-bottom: 10px;
    font-weight: 700;
}

.vessel-route span {
    color: #000;
    font-weight: 400;
}

.vessel-location {
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.vessel-timestamp {
    color: #000;
    margin-bottom: 5px;
    font-size: 14px;
}

.vessel-progress {
    margin-top: 10px;
    font-size: 14px;
    color: #2e7d32;
    font-weight: 700;
}

@media screen and (max-width: 991px) {
    .vessel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vessel-name {
        font-size: 20px;
    }
    
    .vessel-route {
        font-size: 18px;
    }
    
    .vessel-location,
    .vessel-timestamp,
    .vessel-progress {
        font-size: 16px;
    }
}

.vessel-badge.expected {
    background: #ff9800;
    color: #fff;
    padding: 4px 12px;
    font-size: 14px;
}

.vessel-badge.processing {
    background: #0030ac;
    color: #fff;
    padding: 4px 12px;
    font-size: 14px;
}

.vessel-finished-badge {
    background: #666;
    color: #fff;
    padding: 4px 12px;
    font-size: 14px;
}
.port-code {
    font-size: 11px;
    color: #777 !important;
    margin-left: 4px;
}

.handling-totals {
    margin-top: 15px;
    border-top: 1px solid #e6f0f6;
    padding-top: 15px;
}

.handling-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #0030ac;
    font-weight: 700;
    margin-bottom: 10px;
}

.handling-content {
    display: block;
}

.handling-content.hidden {
    display: none;
}

.handling-item {
    padding: 10px;
    background: #f5f5f5;
    margin-bottom: 5px;
    border-radius: 4px;
}

.handling-type {
    font-weight: 700;
    margin-bottom: 5px;
    color: #0030ac;
}

.handling-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.handled {
    color: #2e7d32;
}

.weight {
    color: #666;
}

@media screen and (max-width: 991px) {
    .handling-stats {
        flex-direction: column;
        gap: 5px;
    }
}
