/* TMS Component Styles */
#tms-menu {
    position: absolute;
    top: 60px;
    left: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#tms-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

#tms-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#tms-toggle.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.tms-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tms-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.tms-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.tms-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
}

.tms-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.delivery-list {
    margin-bottom: 16px;
}

.delivery-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.location-group {
    display: flex;
    margin-bottom: 6px;
}

.location-group input {
    flex: 1;
    margin-right: 4px;
}

.location-group input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
}

.location-group button {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.location-group button:hover {
    background: #4b5563;
}

.package-input {
    margin-bottom: 6px;
}

.package-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
}

.delivery-item .remove-delivery {
    align-self: flex-end;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.delivery-item .remove-delivery:hover {
    background: #dc2626;
}

.add-delivery {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.add-delivery:hover {
    background: #059669;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    flex: 1;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #4b5563;
}

.route-info {
    margin-top: 16px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border-left: 4px solid #10b981;
}

.route-info h4 {
    margin: 0 0 8px 0;
    color: #065f46;
    font-size: 14px;
}

.route-item {
    font-size: 12px;
    color: #374151;
    margin-bottom: 4px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}